Joe Ireland
Joe Ireland

Reputation: 21

SurveyMonkey v3 API: How do I determine what language a submission was made in?

I have a SurveyMonkey Form. The form is set up in multiple languages/translations, and can be submitted by anonymous users in any of the languages.

I'm running an API to download the survey responses and save them to a database.

The form has a few comment boxes where the user can enter some feedback; ostensibly the feedback would be provided in the respondent's language. We want to grab the text, then hand it off to a Google Translate API to translate it to English and save the original and translated text back to the db, so that we can do other stuff with the translated text including providing trends on submissions and grouping together everyone who mentioned, for example, the word balloons, whether they said it in English, Spanish, Icelandic, etc.

If I hit the v3/surveys/{SurveyId}/responses/{ResponseId}/details endpoint for a given response, then the header data contains:

"metadata": {
  "respondent": {
    "language" : {
      "type": "string",
      **"value": "es"**
}

And that's exactly what I want, because we can then say "this is a Spanish submission, hand it to Google Translate with the source language set to Spanish." Or French, or Italian.

However, when I hit the v3/surveys/{SurveyId}/responses/bulk endpoint and review the details of the same response (confirmed I'm definitely looking at the same response Id!), the header data contains:

"metadata": {
  "contact": {}
}

The language is not present, and so I don't have a reliable way to route the submission for translation in the specific language it was given in. For my use case, I do not want to rely on detecting the language using the detect endpoint.

I'm trying to figure out why the /bulk endpoint header data doesn't contain the same data in the metadata object. Is this a configuration issue with my survey or collector, or is this a design issue with SurveyMonkey's API that prevents it from being included?

If it's not possible to get the respondent object out of the bulk endpoint, Is there another way to get the language of submission?

Upvotes: 0

Views: 60

Answers (0)

Related Questions