Oauth2 Token Return
I am new to working with Celigo and seem to have run up against a brick wall trying to get an Oauth2 token to use in making REST API calls. I can make them all work correctly in Postman yet I keep getting errors in Celigo when I "test" the setup. Here is the call that I use to get the token: (values changed...)
https://api.target.us/oauth2/token?client_id=CLIENT-KEY&api_key=API-KEY
This call returns:
"access_token": "2e77d.47a0479900504cb3ab4a1f626d174d2d"
}
-
Hi Paul Siegerist -
Thanks for posting this to the community. I'm reaching out to some internal folks to see if someone can assist here. However, you may also want to open a Support ticket.Thanks,
Kate
0 -
Hi Paul,
To debug this issue further can you please provide:
- The API doc you're referring to for making the API calls.
- Postman screenshots(by hiding the sensitive information like - client ID, API key, etc.,)
Thank you!
0 -
Here's a link to the API documentation:
API - Application Program Interface - FastSensor Knowledge Base
Here's the result from Postman:0 -
Thank you Paul for the details.
Can you please try creating a connection in the following way:- Provide your Base URI
- Select Auth type as "Token" and provide access_token value from your postman call. Select Send token via, Header name and field as shown below:
- Check the "Configure refresh token" checkbox and provide refresh token details. Provide a dummy value in the "Refresh token" and provide method, URL, and path to fetch the token
Method: POST
URL: https://api.fastsensor.us/oauth2/token?client_id={{{connection.http.encrypted.client_id}}}&api_key={{{connection.http.encrypted.api_key}}}
Path to token field in HTTP response body: access_token - Select Method and populate the Relative URL to test the connection
- In the "Advanced" section of your connection, save your client_id and api_key in the encrypted.
{
"client_id": "replace-with-your-client-id",
"api_key": "replace-with-your-api-key"
}
Hope this helps!
Please reach out if you have any further issues.
Thank you!0 - Provide your Base URI
-
Srilekha-Tirumala, thank you for the "guide" and it works correctly now! I am guessing that because you added the "POST" in with a fake value that each time the API is called, it will retrieve a new token, so that one does not need to worry about their "timeout" property?
0 -
Hi Paul,
Glad to know that the above configuration worked.
Yes, the settings configure under "Configure refresh token" should refresh the token automatically.
Please do let us know if that is not the case. We can assist you further.
Thank you!0
Please sign in to leave a comment.
Comments
6 comments