Extensis Logo SUPPORT | FORUMS | KNOWLEDGE BASE

Export catalog data in TSV via API


#1

I’d like to automate the data export feature discussed here:

via the API. Although it’s possible to re-created this export in code with multiple API calls and transformation from JSON into a tab separated document, it would be great to have direct access to this existing feature. Is it possible to trigger this job and get the download url via the API?


#2

Hi Yoon,

Yes, you can export field values with the API method “runJob”. You can then monitor the status of the export job using the API method “getStatusForJobs”. Finally, when the export is complete, you can use the API method “getJobDetails” to get the location of the new exported CSV file, and then use an HTTP download to get the file.

(The following samples are for the Java/SOAP API, but the same thing can be achieved with the REST API. For REST API docs, see: viewtopic.php?f=31&t=213)

I’d suggest looking at the example code for configuring and running jobs here:
doc.extensis.com/api/portfolio/C … .html#java
doc.extensis.com/api/portfolio/C … .html#java

To configure an Export Data job:
• Give the Job a jobType of “JOB_TYPE_EXPORT_DATA” and set its sourceImage to “original”.
• Give the Job a Task with a taskType of “exportData”
• Create a query that specifies which assets should be exported. You can export all items in a catalog, or just the ones matching a query you write. You can read more about how to create queries here:
doc.extensis.com/api/portfolio/C … .html#java

Let us know if you run into any questions or problems and we can help you out!
-Loren


#3

Loren,

Thanks for the info. I’m able to get the download location, which looks like:

but I get a 500 error when I try and use HTTP to download that that URL. I’m trying:

http://our.server:8090/FileTransfer/download?jobId=JOB_ID

Any ideas?


#4

Figured it out, also have to have &sessionId=SESSION_ID in the url


#5

Cool, so it sounds like you’ve successfully downloaded an export, all via the API. Great!

Let us know if you have any more questions!

-Loren