What's the API to retrieve all interviews

Hello,

I’m trying to retrieve all interviews using /api​/v1​/interviews endpoint, but when I call this API from Postman it is giving me 10 interviews only yet I have 24 interviews? Any help would be appreciated. Thanks

See the “Export” section of the API.

I have tried the following API http://172.16.60.195:9700/api/v2/export?exportType=Tabular&interviewStatus=ApprovedByHeadquarters&questionnaireIdentity=7caba39e60884c4c9df0c39bbde2bd9e$1, it results to 200 OK but I don’t get any export. What I want to achieve is to retrieve all interviewIds and use them to retrieve interviews’ answers. Thanks

And this is correct. Refer to the chart in this thread for the calls you need to make to get the exported data.

[quote=“manipack, post:1, topic:4112”]

[quote]

[quote=“manipack, post:3, topic:4112”]

I have tried the following API http://172.16.60.195:9700/api/v2/export?exportType=Tabular&interviewStatus=ApprovedByHeadquarters&questionnaireIdentity=7caba39e60884c4c9df0c39bbde2bd9e$1, it results to 200 OK but I don’t get any export.
[/quote]

And this is correct. Refer to the chart in this thread for the calls you need to make to get the exported data.

[quote]
@andresarau , I am not sure I fully understand the R-code that you’ve posted, but here is a rough chart of what is expected. [image] I am not seeing a delay line in your code, so I think you are making a mistake of hoping you will be the only user of the server and that it will produce the output immediately. Both are unlikely. It is much more likely that you post a job request, and then will have to wait periodically polling the status.
[/quote]Thanks, this chart really helped to understand what APIs I need to call

Hello @sergiy ,

Where do I retrieve this list of interviews when I use the export method. The picture is the export I made but I can’t find the list of interview ids.

Following the Questionnaire Data - Export File Anatomy, there is no dedicated/seperate file/list of interview__id's when using the “Data Export method”.

However, you can derive this list by identifiying the unique interview__id's in most exported files.

The easiest would be to look into your main interview file, named after your questionnaire variable (DMIS_DEMO_1121.tab(?)). Each row in this file = one Interview, i.e variable interview__id stores all the unique identifiers of all interviews of that particular questionnaire version.

Or use system generated file interview__diagnostics which also has one observation per interview, along with its unique identifier.

1 Like

This works universally for all surveys now.

This is the classical way of doing it, which is also applicable to versions prior to introduction of the interview__diagnostics export file (prior to version 18.08).