Get campaign error while sending to recipients

61 views Asked by At

I am working on the surveymonkey API and I am trying to send a message throw an email collector. The first send is ok but I get the error : 409 : Campaign status is completed when I send to a new contact.

Do I have to create a new collector?

1

There are 1 answers

0
General Kandalaft On BEST ANSWER

You don't have to create a new collector but you have to create a new message (unless you close your collector, which you can re-open).

See the documentation for collectors/messages on how to create collectors and messages.

Example:

Create a new collector:

POST /surveys/<survey_id>/collectors
{
    "type": "email"
}

That'll return the collector you just created, you can then add a message to that collector:

POST /v3/collectors/<collector_id>/messages
{
    "type": "invite"
}

You can then add recipients to your message:

POST /v3/collectors/<collector_id>/messages/<message_id>/recipients
{
    "email": "[email protected]"
}

Then send that message.

POST /v3/collectors/<collector_id>/messages/<message_id>/send

You can then do steps 2-4 above on the same collector to create new messages, add recipients, then send it out. You can keep using the same collector.