Forum Discussion

ldelagoutte's avatar
4 years ago

Bull API return cvs instead of json

 

Hi, 

 

I am using Excel VBA, and I wrote the code below

[...]

httpObject.Open "GET", sUrl
httpObject.setRequestHeader "client-id", KHOROS_CLIENT
httpObject.setRequestHeader "Authorization", "Basic " & EncodeBase64(KHOROS_TOKEN & ":")
httpObject.setRequestHeader "Accept", "application/json"

 

but I got results in CSV.

 

what is weird, is that in a previous call I used httpObject.setRequestHeader "Accept", "text/csv", and since when it seems that there is a cache mechanism that keeps returning CVS, even if I ask JSON

 

is my assumption correct ? Is it a bug or a feature ?

Do you know how to 'force' the result to be JSON, and 'forget' the previous CSV results ?

 

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)

    Hi ldelagoutte,

    I'm hoping that another Atlas member has some insight to offer. In the meantime, I've sent your question to the team that maintains the Bulk Data API.

  • SudhakaraS's avatar
    SudhakaraS
    Khoros Alumni (Retired)

    ldelagoutte 

    There is no cache mechanism in Bulk API to remember the previous calls, each call is treated as independent. We just tried both CSV and JSON it works as expected, not seeing any issue. 

    here is the CURL we used for testing JSON export for 

    curl --location --request GET 'https://eu.api.lithium.com/lsi-data/v1/data/export/community/schneider.prod?fromDate=20200923&toDate=20200926' \
    --header 'client-id: **********' \
    --header 'Authorization: Basic *********' \
    --header 'Accept: application/json' -k -o schneider_20210913