Any reason why this endpoint could be returning randomly an empty body with status code 200?

  • 24 November 2021
  • 4 replies


I am using in an app this library so once the user fills the form, I get the response id and I send it to my api to get the answers and store them in my database.

So the problem is that the data is sent correctly to my api, but this endpoint /forms/:formId/responses?included_response_ids=:response_id randomly (sometimes happen and sometimes don’t) returns an empty body with status code 200 so the responses are not stored in the db and I don’t get any error so don’t know why.

Any idea?


Best answer by mathio 25 November 2021, 10:18

View original

4 replies

Userlevel 7
Badge +5

Hi @GaroLuis Happy Wednesday! Thanks for stopping by the community. Would you mind providing a little more info on how you’re calling that endpoint? That’ll help us see why it’s sending back a 200 at random times. 

@LizNothing special, I’m just using Guzzle:

$this->client = new Client([    'base_uri' => '',    'headers' => [        'Content-Type' => 'application/json',        'Authorization' => 'Bearer ' . $token,    ],]);
$response = $this->client->get('forms/' . $formId . '/responses?included_response_ids=' . $responseId);

$content = json_decode($response->getBody()->getContents(), true, 512, \JSON_THROW_ON_ERROR);


It only happens when the response is just created (I can replicate it using postman) so I was thinking that maybe it’s something like the response is not fully stored when I am doing the call, but it doesn’t make much sense.

Userlevel 7
Badge +5

Hello @GaroLuis 

typeform is processing responses asynchronously and it can take some time before a submitted response is available via the API endpoint. You could request the response in a while cycle like I showed in this article or you can receive responses via webhooks in real time.

Hope this help.

Userlevel 7
Badge +5

Hi @GaroLuis were you able to utilize either of the methods @mathio mentioned? :grinning: