Skip to main content
Solved

API with redirect cookie

  • November 4, 2024
  • 7 replies
  • 63 views

Forum|alt.badge.img

I have an API with the following documentation:

https://baseball.help.trumedianetworks.com/baseball/data-pro-api-docs

 

According to the API documentation, a token must be generated and included as a parameter. This is done using a master token provided by the supplier. When testing in Postman, I receive a response in CSV format; however, the same does not work in TimeXtender. In Postman, the request automatically generates a header "cookie" containing an access token (through redirection).

 

Is it possible to use a cookie container with a redirect option? In cases where a query is redirected to another URL and an authentication cookie obtained from the original URL needs to be set in the redirected request?

 

If so, is this option available in TimeXtender's REST or RSD functionality?

Best answer by DylanW.

Hi @Thomas Lind

Thank you for your quick response. I understand that we will need to retrieve the necessary information from a header.

Unfortunately, I’m unable to share access information for this API due to client regulations.

After discussing this API internally, we’ve decided to use a different tool to obtain this data.

Thank you for your support.

View original
Did this topic help you find an answer to your question?

7 replies

Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • November 11, 2024

Hi @DylanW. 

 

How is it returned in Postman?

As a header called cookie something with values, or as a cookies file.


Forum|alt.badge.img
  • Author
  • Contributor
  • 8 replies
  • November 12, 2024

Hello Thomas,

The system generates an access token, which is stored in the cookies section and also included in the headers (though this part is hidden). It appears that the user must log in to obtain the access token, which is then retained by the system.

Please let me know if you have further questions.

 


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • November 12, 2024

How would you then use this cookie in the next postman call?


Christian Hauggaard
Community Manager
Forum|alt.badge.img+5

Hi @DylanW. 

Which version of TimeXtender are you using?

The product team have looked into your issue, and informed me that it seems that you can get json data from the endpoint. This might be preferable since Json would be consumed easily by the connector.

According to the API documentation, it does not appear that Authentication requires the use of cookies since cookies are not mentioned in the documentation. It might be necessary to setup an endpoint that posts to the token url, gets a token. Then that token should be used as a query parameter in the actual data request.


Forum|alt.badge.img
  • Author
  • Contributor
  • 8 replies
  • November 13, 2024

@Thomas Lind  You cannot manually generate the access token; it is created automatically. It works similarly to logging into a website, where the browser stays logged in using cookies. The master token provides a temporary "login token." Once logged in, a redirect creates a cookie that holds the access token, which is automatically generated and retained as a cookie.

@Christian Hauggaard  I understand. I'm using the latest version of TX. Unfortunately, the documentation is lacking, which is why this information isn’t mentioned. The JSON data is poorly structured, which led me to choose CSV instead. However, this doesn't resolve the issue with the cookies.

I know this is a very poor API and it look a little bit like this:

 


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • November 13, 2024

Hi @DylanW. 

The reason for all my questions is that, there is not an existing method for automatically using specifically cookies for gaining access.

You will need to either get the necessary info from a header or use an endpoint to generate it.

If you have seen the Exact guide you also know that getting the OAuth setup done is pretty difficult and requires a lot of steps that is not being done in our program but in external ones like Postman.

Do you know if we can get access to the baseball info API?


Forum|alt.badge.img
  • Author
  • Contributor
  • 8 replies
  • Answer
  • November 13, 2024

Hi @Thomas Lind

Thank you for your quick response. I understand that we will need to retrieve the necessary information from a header.

Unfortunately, I’m unable to share access information for this API due to client regulations.

After discussing this API internally, we’ve decided to use a different tool to obtain this data.

Thank you for your support.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings