I am having issues getting the new ODX TimeXtender Rest API to connect using OAuth2 and an authentication service to generate an expiring bearer token.
I have been able to generate a token successfully using Postman, and I have been able to configure the standard ODX CData Rest datasource successfully with the authentication service. But using the same setup I am getting errors on the TimeXtender Rest service.
This is the OAuth2 settings from the standard Rest Data Source
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/1efcbfc6-9cc6-497e-a2cb-fd71cdd68da7.png)
This is the OAuth settings from the new TimeXtender Rest datasource that don’t work.
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/c1235147-7aef-4a3c-8217-90f944e328ed.png)
The only thing potentially unusual was that when setting up my postman request to generate the Bearer Toekn the connection instructions specifically stated to setup the body as follows:
![](https://uploads-eu-west-1.insided.com/timextender-en/attachment/3ec51f3c-9a1f-4f72-b56d-21f8e212e238.png)
However I did not have to set the encoding in the standard CData Rest.
I did try generating the bearer token in postman and then using that as a not expiring Bearer token to verify my core URL and Endpoint setup and that worked fine. just cant get the authentication service to work.
The error message I get is like the get request is not being passed the token.
My Error message received is as below:
Failed to execute endpoint 'datasets':
Failed to execute request for endpoint 'datasets'.
HTTP Status Code 401 Unauthorized
Response body:
{"message":"Unauthorized"}
System.Exception: Failed to execute request for endpoint 'datasets'.
HTTP Status Code 401 Unauthorized
Response body:
{"message":"Unauthorized"}
at TimeXtender.ODX.RestEngine.RestEngine.ExecuteHttpRequest(ExecutionConfigurationContainer configContainer)
at TimeXtender.ODX.RestEngine.RestEngine.ExecutePaginationLoop(ExecutionConfigurationContainer configContainer, CallbackObject callbackObject, Dictionary`2 dynamicValues)
at TimeXtender.ODX.RestEngine.RestEngine.ExecuteDynamicValuesLoop(ExecutionConfigurationContainer configContainer, CallbackObject callbackObject)
at TimeXtender.ODX.RestEngine.RestEngine.<>c__DisplayClass25_0.<CreateExecutionTask>b__0()