API service does not return full interview

Good morning, consulting the api/v1/questionnaires/{id}/1/interviews service, I only receive the cover fields, I would like to receive all the interview fields.

https://xxxx-demo.mysurvey.solutions​/api/v1/questionnaires/xxxxxxxxxxxx/1/interviews

“Interviews”: [

    {

        "FeaturedQuestions": [

            {

                "Id": 131072,

                "Question": "G01. Qual é a província do AF?",

                "Answer": "Luanda"

            },

            {

                "Id": 131073,

                "Question": "G02. Qual é o município do AF?",

                "Answer": "Luanda"

            },

            {

                "Id": 131074,

                "Question": "G03. Qual é a comuna do AF?",

                "Answer": "Sambizanga"

            },

            {

                "Id": 131075,

                "Question": "G04. Qual é o bairro/aldeia do AF?",

                "Answer": "Bairro Operário"

            },

            {

                "Id": 131076,

                "Question": "G05. Qual é a área de residência?",

                "Answer": "Rural"

            },

            {

                "Id": 131077,

                "Question": "G06. Número do conglomerado",

                "Answer": "90999"

            }

        ],

        "InterviewId": "6605e536-a312-4a8d-a077-770d9378e530",

        "QuestionnaireId": "d9ea7a82-d3d0-469e-bbf1-fc926ffc4ce5",

        "QuestionnaireVersion": 1,

        "AssignmentId": 1,

        "ResponsibleId": "8ee86535-4a41-4b6c-a314-abc04fa50650",

        "ResponsibleName": "aurorachocolate",

        "ErrorsCount": 2,

        "Status": "ApprovedByHeadquarters",

        "LastEntryDate": "2021-10-02T22:32:05.278108Z",

        "ReceivedByDevice": false,

        "ReceivedByDeviceAtUtc": null

    },

    {

        "FeaturedQuestions": [

            {

                "Id": 32774,

                "Question": "G01. Qual é a província do AF?",

                "Answer": "Luanda"

            },

            {

                "Id": 32775,

                "Question": "G02. Qual é o município do AF?",

                "Answer": "Luanda"

            },

            {

                "Id": 32776,

                "Question": "G03. Qual é a comuna do AF?",

                "Answer": "Sambizanga"

            },

            {

                "Id": 32777,

                "Question": "G04. Qual é o bairro/aldeia do AF?",

                "Answer": "Bairro Operário"

            },

            {

                "Id": 32778,

                "Question": "G05. Qual é a área de residência?",

                "Answer": "Rural"

            },

            {

                "Id": 32779,

                "Question": "G06. Número do conglomerado",

                "Answer": "90999"

            }

        ],

        "InterviewId": "fb73ba93-cf15-4d8b-a828-a256b50dc0ab",

        "QuestionnaireId": "d9ea7a82-d3d0-469e-bbf1-fc926ffc4ce5",

        "QuestionnaireVersion": 1,

        "AssignmentId": 1,

        "ResponsibleId": "8ee86535-4a41-4b6c-a314-abc04fa50650",

        "ResponsibleName": "aurorachocolate",

        "ErrorsCount": 0,

        "Status": "ApprovedByHeadquarters",

        "LastEntryDate": "2021-10-02T16:03:38.850053Z",

        "ReceivedByDevice": false,

        "ReceivedByDeviceAtUtc": null

    }

]
Any solution to receive all fields of the interview?

Note :The other questions are within the list.

The only way to receive all variables for all (or filtered by interview status) interviews is through the export request:

https://xxxx-demo.mysurvey.solutions/primary/api/v2/export

Note: You have to use version 2 format, since the version 1 reuqest has been deprecated.

1 Like

While I’ve not worked with this endpoint, GET ​/api​/v1​/interviews​/{id} appears to yield what you need. See example return value from the API docs below:

1 Like

@ arthurshaw2002: You are right, the export request is not the only way to get the information.
But I interpreted @Nata23’s question as getting all variables for all interviews. So with your solution he would have to get first a list of the uuids of all interviews, then call the request for each one of them.

BTW, the endpoint for getting a list of all interviews is now deprecated, so you should use the graphQL request for this.

1 Like

@klaus , you’re exactly right: one would need to collect the interview__id of all interviews of interest and then loop over them somehow.

@Nata23 , Here’s a roadmap for fetching those interviews with GraphQL:

  1. Get the number of interviews. See query here, albeit wrapped in an R function and GraphQL client.
  2. Fetch batches of 100 interviews–that being the largest amount the API permits. See query here.
  3. Repeat query until you’ve fetched all interviews of interest

I managed to solve my problem, build a .NET core service, which extracts new interviewIDs from the note every hour and then I created another service that makes a query of an interview and records a complete one in a sqlserver base,