Skip to main content
Solved

Load CSV Data from API

  • July 24, 2024
  • 1 reply
  • 55 views

I have an API that requires an access token to be retrieved using a POST request, which is returned as JSON. Most of the endpoints also return the data in JSON, which I can already extract using custom rsd files. However, there is one endpoint that returns custom reports in text/CSV format. So I'm looking for a way to retrieve the token from a JSON response and use it to do a second request to retrieve a CSV response.

I've tried using the CSV provider to do this, but I get an error when I want to combine jsonproviderGet and csvproviderGet in a nested call using an rsd file based on my already working all-json rsd file:

 

Is there a way to make this work?

 

Thanks,

Jasper 

Best answer by Christian Hauggaard

Hi @jasperp 

Cdata has advised using the REST 2023 provider rather than the CSV provider. Please add the following connection properties to the REST data source

Format=CSV;DataModel=Relational

and please add the following to the rsd file:

  <api:script method="GET">
    <api:call op="csvproviderGet">
      <api:push/>
    </api:call>
  </api:script>

 

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

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

Hi @jasperp 

Cdata has advised using the REST 2023 provider rather than the CSV provider. Please add the following connection properties to the REST data source

Format=CSV;DataModel=Relational

and please add the following to the rsd file:

  <api:script method="GET">
    <api:call op="csvproviderGet">
      <api:push/>
    </api:call>
  </api:script>

 


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