Skip to main content

I was able to use the NPM “intercom-client” successfully to dataExport a day (as a sample). But I failed to download it.

First, I can’t find a way to use the NPM to download the file.

Second, trying the job identifier in the documentation and from a normal Axios call throw this error:

So in my axios call I added the needed headers as below - I used the dataExport.find to get the download URL:

But when the file is downloaded, I get the below:

 

Hey @Bassam Tantawi ! Oséas here from the Support Engineering team 🕵️

 

The request in our doc is throwing that error because we didn’t specify the required headers in our online API tool. Thanks for flagging this. I’ll pass this on to our team.

 

There are two things I’ve noticed from the request in the screenshot:

  1. You’re passing the accept header as “application/json”. The correct one to be used in this endpoint is application/octet-stream.
  2.  The dataExport.find will only return you a dowload_url if the export job is successful and there’s data to be exported. Did you check the response from dataExport.find to see if it gives you a valid URL?

Hi @Oseas ,

 

Yes, I get a download URL back. I actually have a loop and I wait till I get a Completed status, then check if there is a download URL.

 

I changed the Accept header to “application/octet-stream” and got a bigger file this time 🙂 … but I can’t open it. Isn’t it a CSV file?


Reply