Question

Missing "Response_id" and "Field_id" in the "retrieve response file api".


Userlevel 1
Badge

Hi, I am testing the APIs but I am unable to find anything related to these terms; “Response_id”, “Field_id” and “filename” from the documentation. 

The Url 

https://api.typeform.com/forms/{form_id}/responses/{response_id}/fields/{field_id}/files/{filename}

Kindly guide me from where should i fill the required ids?


10 replies

Userlevel 7
Badge +5

Hi again, @Sibqo ! You can first find this information when making this call here. Then, in the JSON, you’ll find the information you’re looking for. :grin: Let me know if you have any troubles finding that information after making that call!

 

Userlevel 1
Badge

I have run the request https://developers.typeform.com/responses/reference/retrieve-responses/

but still I am not getting any “response_id” and “field_id” in the response of the respective call.

Userlevel 7
Badge +5

Hi @Sibqo If you feel comfortable doing so, can you paste one of the responses from that call here? I can then highlight where to find this info. 

Userlevel 1
Badge

the attached screenshot is of call “retrieve responses”

 

Userlevel 7
Badge +5

Hi @Sibqo Apologies for the delay - do you mind sharing the screenshot again? It didn’t seem to attach. :( 

Userlevel 1
Badge

 

Userlevel 7
Badge +5

Hi @Sibqo thank you! Has this form collected any results? 

Userlevel 1
Badge

Thankyou so much. your guidelines are really helpful for mein resolving the call issue. 

Userlevel 7
Badge +5

Glad to hear! Let us know if we can help answer anything else, @Sibqo . :grinning:

Userlevel 7
Badge +5

Hi @Sibqo 

To follow up for anybody that would have the same issue.

If you want to retrieve a file that has been uploaded via your typeform you need to use the Retrieve Response File endpoint.

To call this endpoint you would need few things:

  • form_id, it’s your typeform id, its the 8 characters string in the url usually after “/to/”. example: https://kiki.typeform.com/to/KKS7qMpL
  • response_id, is the id of this specific response, you will find either in the Responses API or the webhook payload
  • field_id, the id of the question field that is a file upload. You can get either via the Responses API or by looking at the form definition of your form https://api.typeform.com/to/{id_of_your_form}
     

But you should not this to create this URL manually, as the Responses API and the webhook payload both give you directly the response in the form of
 

{
"field": {
"id": "jrWzekvzk2O9",
"ref": "f5a13563-adc0-4710-ac2b-dbc2a601743d",
"type": "file_upload"
},
"type": "file_url",
"file_url": "https://api.typeform.com/forms/DqvzRJgo/responses/x9o9y1iw3fellcmr379e9x9o9y1iwt3c/fields/jrWzekvzk2O9/files/3417a2798f67-_wunexf.jpg"
}

And you can just extract `file_url` and call directly this url via an authenticated call.

Hope it helps

Reply