Campaign Recipients
GET /campaigns/:campaign/campaign_recipients/:campaign_filter{?failure_type}
A CampaignRecipient tracks what happened with individual Recipients of a Campaign.
Examples
List all recipients in filter
Request
GET /campaigns/joOQd57/campaign_recipients/total
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
-H Authorization:"Bearer {token}" \
-X GET /campaigns/joOQd57/campaign_recipients/total
Response
Status
200
Response Type
Example Body
{
"@type": "CampaignRecipientCollection",
"@context": "/contexts/CampaignRecipientCollection.jsonld",
"id": "/campaigns/joOQd57/campaign_recipients/total",
"members": [
{
"@type": "CampaignRecipient",
"@context": "/contexts/CampaignRecipient.jsonld",
"id": "/campaign_recipients/joOQd57",
"state": "sent",
"errorDescription": null,
"createdAt": "2018-11-19T20:49:03.581Z",
"scheduledAt": "2018-11-19T20:49:03.581Z",
"sentAt": "2019-02-28T21:19:42.000Z",
"replyLag": "PT59M",
"delivered": true,
"unknown": false,
"contactPhone": {
"@type": "RecipientContactPhone",
"id": "/contact_phones/mxvbRw",
"@context": "/contexts/ContactPhone.jsonld",
"phoneNumber": "13035551234",
"formattedPhoneNumber": "+1 303-555-1234",
"extension": null,
"type": "Mobile",
"deliverabilityStatus": "unknown",
"contact": {
"id": "/contacts/Vled2N",
"@type": "ContactItem",
"@context": "/contexts/Contact.jsonld",
"name": "Jamel Hirthe",
"firstName": "Jamel",
"lastName": "Hirthe",
"phones": "/contacts/Vled2N/phones",
"notes": "/contacts/Vled2N/notes",
"data": {},
"formattedData": {},
"conversations": "/contacts/Vled2N/conversations",
"createdAt": "2020-01-06T21:49:58.312Z"
}
},
"message": "/messages/joBW57",
"campaign": "/campaigns/joOQd57"
}
],
"totalItems": 1,
"blockContacts": "/campaigns/joOQd57/campaign_recipients/total/block",
"unblockContacts": "/campaigns/joOQd57/campaign_recipients/total/block",
"subscribeContacts": "/campaigns/joOQd57/campaign_recipients/total/subscribe",
"unsubscribeContacts": "/campaigns/joOQd57/campaign_recipients/total/subscribe",
"sendCampaign": "/campaigns/joOQd57/campaign_recipients/total/contact_filter",
"view": {
"@type": "hydra:PartialCollectionView",
"@context": "/contexts/hydra:PartialCollectionView.jsonld",
"id": "/campaigns/joOQd57/campaign_recipients/total",
"first": "/campaigns/joOQd57/campaign_recipients/total",
"next": null,
"previous": null
}
}
Filter by failure type
Failure types can be “spam”, “landline”, or “other”
Request
GET /campaigns/joOQd57/campaign_recipients/total?failure_type=spam
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
-H Authorization:"Bearer {token}" \
-X GET /campaigns/joOQd57/campaign_recipients/total?failure_type=spam
Response
Status
200
Response Type
Example Body
{
"@type": "CampaignRecipientCollection",
"@context": "/contexts/CampaignRecipientCollection.jsonld",
"id": "/campaigns/joOQd57/campaign_recipients/total?failure_type=spam",
"members": [
{
"@type": "CampaignRecipient",
"@context": "/contexts/CampaignRecipient.jsonld",
"id": "/campaign_recipients/joOQd57",
"state": "sent",
"errorDescription": "3007",
"createdAt": "2018-11-19T20:49:03.581Z",
"scheduledAt": "2018-11-19T20:49:03.581Z",
"sentAt": "2019-02-28T21:19:42.000Z",
"replyLag": "PT59M",
"delivered": true,
"unknown": false,
"contactPhone": {
"@type": "RecipientContactPhone",
"id": "/contact_phones/mxvbRw",
"@context": "/contexts/ContactPhone.jsonld",
"phoneNumber": "13035551234",
"formattedPhoneNumber": "+1 303-555-1234",
"extension": null,
"type": "Mobile",
"deliverabilityStatus": "unknown",
"contact": {
"id": "/contacts/Vled2N",
"@type": "ContactItem",
"@context": "/contexts/Contact.jsonld",
"name": "Jamel Hirthe",
"firstName": "Jamel",
"lastName": "Hirthe",
"phones": "/contacts/Vled2N/phones",
"notes": "/contacts/Vled2N/notes",
"data": {},
"formattedData": {},
"conversations": "/contacts/Vled2N/conversations",
"createdAt": "2020-01-06T21:49:58.312Z"
}
},
"message": "/messages/joBW57",
"campaign": "/campaigns/joOQd57"
}
],
"totalItems": 1,
"blockContacts": "/campaigns/joOQd57/campaign_recipients/total/block",
"unblockContacts": "/campaigns/joOQd57/campaign_recipients/total/block",
"subscribeContacts": "/campaigns/joOQd57/campaign_recipients/total/subscribe",
"unsubscribeContacts": "/campaigns/joOQd57/campaign_recipients/total/subscribe",
"sendCampaign": "/campaigns/joOQd57/campaign_recipients/total/contact_filter",
"view": {
"@type": "hydra:PartialCollectionView",
"@context": "/contexts/hydra:PartialCollectionView.jsonld",
"id": "/campaigns/joOQd57/campaign_recipients/total?failure_type=spam",
"first": "/campaigns/joOQd57/campaign_recipients/total?failure_type=spam",
"next": null,
"previous": null
}
}