Skip to main content
Solved

Cdata Json


avanrijn
Contributor
Forum|alt.badge.img+2

Dear Sir,

I am trying to set up a CData Json datasource connection with TimeXtender.

This is my connectionstring:
Auth Scheme=OAuth;Data Model=Document;Initiate OAuth=REFRESH;OAuth Access Token URL=https://pilot.binnenbeter.nl/api/v2/login/venray;OAuth Grant Type=PASSWORD;OAuth Refresh Token URL=https://pilot.binnenbeter.nl/api/v2/login/venray;Row Scan Depth=100;User=api@venray.nl

I am able to get the bearer Token with Postman with this:

url: https://pilot.binnenbeter.nl/api/v2/login/venray

JSON Body:

{

  "id""",

  "language""en",

  "data": {

    "resourceType""AUTH",

    "item": {

          "loginName"api@venray.nl

          "password""password",

          "module""API"

    }

  }



This is the documentation I used for the connectionstring:

Password

Finally there also is an Password method. It is similar to the others, in that it requires an Access Token URL and an Refresh Token URL, the difference is that it uses an User and Password instead of client and secret. Notice that these fields are in the "Authentication" section, not in the area of the other OAuth fields.

mceclip0.png

But it doesn’t work:
Service request failed: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> djo230f.nQ: URI or DataSource must be set if schemas are not available in C:\Users\RijnA\AppData\Roaming\CData\JSON...

Module: TimeXtender.ODX.Engine

TimeXtender.ODX.Engine.ODXFaultException

   at TimeXtender.ODX.Engine.ODXEngine.SendServiceRequest[C](WcfServerSettings serverSettings, ProjectInformation projectInformation, Action`2 action)

   at TimeXtender.ODX.Engine.DataSourceController`1.TestConnection(DataSourceModel dataSourceModel)

   at TimeXtender.DataManager.ConnectingThread.ExecuteConnectingThread(Object dummy)

 

Please advice, this is a tough cookie.

 

Regards,

Arthur

Best answer by Christian Hauggaard

During the call we determined that the issue seems to be related to internal problems at the API vendor since some calls were successful, and other calls with the same settings failed from another machine

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

rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7
  • TimeXtender Xpert
  • July 18, 2024

Hi,

have you set up the datasource URI under the connection settings? You need to specifiy everything in one go in CData, you are not defining separate calls.


avanrijn
Contributor
Forum|alt.badge.img+2
  • Contributor
  • July 22, 2024

Hi Rory,

I updated the connectionstring with the datasource URI:

Auth Scheme=OAuth;Data Model=Document;Initiate OAuth=REFRESH;OAuth Access Token URL=https://pilot.binnenbeter.nl/api/v2/login/venray;OAuth Grant Type=PASSWORD;OAuth Refresh Token URL=https://pilot.binnenbeter.nl/api/v2/login/venray;Row Scan Depth=100;URI=https://pilot.binnenbeter.nl/api/v2/organization/reports/find/venray?;User=api@venray.nl

Can not find any valid JSON resource for supplied URI


Is it possible to create a support ticket for this ?

Thanks in advance.

Regards,

Arthur


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

Hi @avanrijn 

Do you have a link to the API documentation?


avanrijn
Contributor
Forum|alt.badge.img+2
  • Contributor
  • July 22, 2024

  • Contributor
  • July 22, 2024

I think Christian means this: https://pilot.binnenbeter.nl/api/index.html


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

Hi yes, @avanrijn could you please provide API documentation for https://pilot.binnenbeter.nl/api/index.html?


avanrijn
Contributor
Forum|alt.badge.img+2
  • Contributor
  • July 24, 2024

Hi Christian,

Sorry I misunderstood.

Here is  the link to the binnenbeter documentation: https://app.loopedin.io/binnenbeter/kb/open-api

Open API | BinnenBeter (loopedin.io)

Regards,

Arthur


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

@avanrijn Thanks, I have created a support ticket for this now


avanrijn
Contributor
Forum|alt.badge.img+2
  • Contributor
  • September 30, 2024

Dear Sir,

Please find in the attachment the configuration for our Json connectivity, including the Log files.

I setup a Json and a REST CDATA datasource in TX.

Maybe, it would be nice to set up a call for this.

Now I have a Unsupported Media Type error.

Thanks in advance.

 

Regards,

Arthur


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

@avanrijn have you tried the get call in Postman? If so can you please confirm what the content type is set to?

 


avanrijn
Contributor
Forum|alt.badge.img+2
  • Contributor
  • October 7, 2024

Hi Christian,

I have used Postman to connect. The connection is succesful.
Please have a look at the attached Word file for details (Doc1.docx).

TimeXtender on the other hand is giving me an error: 415 Unsupported Media Type

Please assist, I don't know to handle the Json Web Token (JWT) I recieve from Postman in TimeXtender JSON CDATA.

Hope you can shine a light on this.

Regards,

Arthur

Attachment: Doc1.docx


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

@avanrijn thanks for the info. I have passed this onto Cdata and will let you know as soon as I have a response.


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

Hi @avanrijn 

Please see below response from Cdata:

“After reviewing the request body required to obtain an Access Token from the API, it seems that this uses a custom OAuth authentication method that cannot be handled by the connection manager. To address this, I have created an RSB schema file to manage the OAuth flow. Please find attached the GetOAuthAccessToken.rsb schema file. You will need to place it in the directory specified by the Location property (default: %APPDATA%\\CData\\REST Data Provider\\Schema): https://cdn.cdata.com/help/DWK/ado/RSBREST_p_Location.htm

NOTE: Please ensure that the RSB is placed in the correct location, as the OAuth flow logic is implemented within the RSB schema file. The driver must access this RSB to connect with the API. As mentioned, customization of the RSB is necessary because the OAuth flow for this API is non-standard. More details on Customizing Schemas: https://cdn.cdata.com/help/DWK/ado/pg_CustomSchemas.htm

The connection properties you need to configure in this case are:
AuthScheme=OAuth; Data Model=Document;Initiate OAuth=GETANDREFRESH; URI=https://pilot.binnenbeter.nl/api/v2/organization/reports/find/venray; OAuthClientId= api_prod@venray.nl; OAuthClientSecret=YourPassword;

In the RSB schema file, I have mapped the OAuthClientId to your "loginName": and OAuthClientSecret to your "password", allowing you to set them from the connection manager.

The only changes you may need to make in the RSB schema file are for the "id": "" field, as I’m unsure if you specify an ID in Postman to obtain the token. Additionally, I have set the ExpiresIn value to 900 seconds, meaning the token is valid for only 900 seconds, after which the driver will request a new token. If you know the actual duration of the token's validity, you can adjust this value accordingly. 
I ran the tests on my end using the REST driver, but I believe the JSON driver should work as well.”


avanrijn
Contributor
Forum|alt.badge.img+2
  • Contributor
  • October 9, 2024

Hi Christian,

I opened ticket #31920 again for this topic. The CData solution is not working on my side.

I hope Thomas can have a look at this. 

Thanx.

 

Regards,

Arthur

Request #31920


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

During the call we determined that the issue seems to be related to internal problems at the API vendor since some calls were successful, and other calls with the same settings failed from another machine


Reply


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