API - Discador - Reagendar ligação de campanha
Para utilizar a API é necessário um Token de API.
API URL | /api/v1/campaign/<campaign_id>/reschedule_call |
---|---|
Method | POST |
Esta API reagenda um assinante da campanha. O campaign_id pode ser obtido através da URL da campanha, ex: https://evolux.c.evolux.net.br/monitor/campaign/show/114, 114 é o campaign_id.
A API responde uma mensagem em formato JSON.
Parâmetros
external_id | string - opcional se enviado o subscriber_id |
---|---|
subscriber_id | integer - opcional se enviado o external_id |
date | ISO 8601 em UTC - obrigatório. |
number | string - opcional. Se não for passado será usado o primeiro telefone do assinante. |
Header
Token | Obrigatório |
---|
Exemplos de requisição
POST
URL: https://example.evolux.net.br/api/v1/campaign/<campaign_id>/reschedule_call BODY: external_id=XXXXX subscriber_id=XXXXXX date=<Date> Header: token=<API_TOKEN>
POST
URL: https://example.evolux.net.br/api/v1/campaign/114/reschedule_call Header: token=c0f16dcd-c0f4-4139-b547-b19ad207bb17 BODY: external_id=12345633j subscriber_id=8763 date=2018-01-08T17:34:02+00:00
Exemplos de respostas
Sucesso
curl -X POST -H "token: <TOKEN>" -d="subscriber_id=1&number=601&date=2018-01-20T12:03:12+00:00" http://<EVOLUX_URL>/api/v1/campaign/1/reschedule_call {"meta": {"status": 200, "message": "OK"}, "data": {"message": "Call scheduled."}}
curl -X POST -H "token: <TOKEN>" -d="external_id=123456&date=2018-01-20T12:03:12+00:00" http://<EVOLUX_URL>/api/v1/campaign/1/reschedule_call {"meta": {"status": 200, "message": "OK"}, "data": {"message": "Call scheduled."}}
Falhas
curl -X POST -H "token: <TOKEN>" -d="subscriber_id=1&number=601&date=2018-01-20T12:03:12+00:00" http://<EVOLUX_URL>/api/v1/campaign/112/reschedule_call {"meta": {"status": 404, "message": "Campaign not found."}}
curl -X POST -H "token: <TOKEN>" -d="subscriber_id=1&number=605&date=2018-01-20T12:03:12+00:00" http://<EVOLUX_URL>/api/v1/campaign/1/reschedule_call {"meta": {"status": 410, "message": "Campaign archived."}}
curl -X POST -H "token: <TOKEN>" -d="subscriber_id=1&number=605&date=2018-01-11T12:03:12+00:00" http://<EVOLUX_URL>/api/v1/campaign/1/reschedule_call {"meta": {"status": 400, "message": "Bad request"}, "errors": {"date": ["The schedule date could not be less than current date (2018-01-11T20:11:50.811184+00:00)."]}}
curl -X POST -H "token: <TOKEN>" -d="subscriber_id=2&number=605&date=2018-01-20T12:03:12+00:00" http://<EVOLUX_URL>/api/v1/campaign/1/reschedule_call {"meta": {"status": 400, "message": "Bad request"}, "errors": {"external_id": ["Invalid external_id value."], "subscriber_id": ["Invalid subscriber_id value."]}}
curl -X POST -H "token: <TOKEN>" -d="date=2018-01-20T12:03:12+00:00" http://<EVOLUX_URL>/api/v1/campaign/1/reschedule_call {"meta": {"status": 400, "message": "Bad request"}, "errors": {"external_id": ["Missing subscriber_id or external_id params."], "subscriber_id": ["Missing subscriber_id or external_id params."]}}