Pregunta

I'm trying to use the create_flow endpoint to the Survey Monkey API. It is sending back a status 3 message with the following error:

additional properties not defined by 'properties' are not allowed in field '_data'

I'm able to do successfully use all other API endpoints and have a valid API key and durable OAuth token.

Here's an example JSON body that I'm sending to: https://api.surveymonkey.net/v2/batch/create_flow?api_key=apikeyhere

{
 "survey": {
 "template_id": "566",
 "survey_title": "test1",
 "collector": {
    "type": "email",
    "name": "collector1",
    "recipients": [
    {
      "email": "email@example.com" 
    } 
    ] 
  },
 "email_message": {
   "reply_email": "myemail@example.com",
   "subject": "this is a test" 
 } 
}

Note: JSON formatting here is being generated automatically using RJSONIO

Any ideas what might be causing the error? It seems like all fields are correctly named and where they're supposed to be, so I'm not sure what the problem is.

¿Fue útil?

Solución

It's a bad error message unfortunately - it's a known issue. It means you are providing extra keys that are not part of the create_flow schema.

The issue here is that the "email_message" and "collector" keys have been nested inside of "survey", instead of being in the main JSON body like the "survey" key. Move them out a level and it should work.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top