How to send a new conversation to all your subscribers
Type : POST
1°) SEND NOW
@TODO changer l'url pour passer par l'api botchimp. Mieux pour toutes les data
url : http://www.vizirworkerapi.eu-central-1.elasticbeanstalk.com/task
Body / Raw / JSON
{
"appID":"xxxx",
"surveyID":"d27.....",
"overrideBool": true | false,
"newActiveStatus": true | false
}
The answer should be :
{
"status" : "OK",
"message" : "Message sent to all your subscribers"
}
2°) PLAN A TASK ::::::: TO DO IMPORTANT
url : https://apibotchimp.herokuapp.com/api/task/create
{
task : {
"appID":appID,
"surveyID":'d2751bfb1029369926fe382ce1a84873c5e7e750b2f15ddc',
"type":"specific",
"timestamp":date,
"filters":{
"states":[],
"respondents" : users,
"answeredQuestions" : [],
"surveysTaken" : [],
"facebookUserData":null
}
}
}
Response : error
{
"status": 400,
"data": "Your appID is not correct, please consider creating an app on Botchimp for this page before."
}
Response ok :
{
"appID": "699115713490740",
"surveyID": "d27519f8137366c472ac332bbaf34873c5e7e450e3aa058f",
"type": "specific",
"timestamp": "1494257683898",
"filters": {
"respondents": [
"1276358755731356"
]
},
"overrideBool": true,
"newActiveStatus": true,
"title": "Titre de la tache pour botchimp",
"message": "",
"createdAt": "2017-05-08T16:17:58.286Z",
"updatedAt": "2017-05-08T16:17:58.286Z",
"id": "59109a369114bfa019b9082b"
}
3°) Send a survey NOW
url : POST : /api/task/sendNow
data:
{
task : {
"appID":appID,
"surveyID":'d2751bfb1029369926fe382ce1a84873c5e7e750b2f15ddc',
"type":"specific",
"timestamp":date,
"filters":{
"states":[],
"respondents" : users,
"answeredQuestions" : [],
"surveysTaken" : [],
"facebookUserData":null
}
}
}
response : 200
Successfully sent message to 1 respondants