The Report Opt Out and Abuse Details command allows you to get the details seen in the Campaign Details page for Opt Out (Unsubscribe) and Abuse (Complaint) events.
GET /campaigns/[campaignId]/abuseActivity
https://[siteurl]/rest/campaigns/[campaignId]/abuseActivity
Request Body Parameters
The Report Opt Out and Abuse Details command requires only the URI call. No additional fields are required in the JSON.
Request Body Example
Using Report Bounce Details:
curl --request GET \
--url 'https://mail.mydomain.com/rest/campaigns/123/abuseActivity \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--header 'content-type: application/json' \
--include
Response Body
The response returns report data in JSON format for opt out statistics in a specific Campaign.
- topComplaintDomains - The Top 10 Complain Domains (name) and total (count)
- unsubscribeDetails - The total, unique, and rate of each unsubscribe type
- AllUnsubscribes
- Unsubscribes
- GlobalUnsubscribes
- UniversalUnsubscribes
- Complaints
Based on the example above the response returns:
HTTP/1.1 200 OK
Server: serverName
Content-Type: application/json
Link: <https://mail.mydomain.com/rest/campaigns/123/bounceActivity>;
Date: Fri, 17 Jun 2016 12:54:44 GMT
{
"topComplaintDomains":
{
"name": "gmail.com"
"count": 10
}
{
"name": "hotmail.com"
"count": 5
}
{
"name": "whatcounts.com"
"count": 1
}
"unsubscribeDetails": {
"uniqueAllUnsubscribes": 26
"uniqueUnsubscribes": 9
"uniqueGlobalUnsubscribes": 1
"uniqueUniversalUnsubscribes": 0
"uniqueComplaints": 16
"totalAllUnsubscribes": 26
"totalUnsubscribes": 9
"totalGlobalUnsubscribes": 1
"totalUniversalUnsubscribes": 0
"complaints": 16
"uniqueTotalUnsubscribeRate": 26
"uniqueUnsubscribesRate": 9
"uniqueGlobalUnsubscribeRate": 1
"uniqueUniversalUnsubscribeRate": 0
"complaintsRate": 16
}
}
Error Response
Error Response Codes include both Client Errors (4xx) and Server Errors (5xx). Descriptions of each can be found in Response Codes.
For example, if the Authorization is incorrect, the error would appear as:
{
"error": "Unauthorized"
"status": "Unauthorized"
"statusCode": 401
}