Get a campaign’s report
const url = 'https://api.sendwing.app/api/organizations/example/campaigns/example/report';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.sendwing.app/api/organizations/example/campaigns/example/report \ --header 'x-api-key: <x-api-key>'Its results so far. opened and clicked count each recipient once, opens and clicks count repeats. Rates are of delivered emails, except bounces and complaints, which are of sent ones.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The workspace, like org_…. An OAuth access token works in the one the member picked when connecting, which GET /me returns.
Like cmp_…
Responses
Section titled “Responses”The report
object
How many contacts it’s sent to; 0 before it starts sending
Not sent yet
Accepted for delivery
Couldn’t be sent
Not sent, like when the campaign was canceled
Reached the inbox server
Recipients who opened it
Opens, repeats included
Recipients who clicked a link
Clicks, repeats included
Recipients whose email bounced
Recipients who reported it as spam
Recipients who unsubscribed from it
Fractions from 0 to 1, to four decimal places
object
Of delivered
Of delivered
Of delivered
Of sent, the measure mailbox providers use
Of sent, the measure mailbox providers use
Example generated
{ "recipients": 1, "queued": 1, "sent": 1, "failed": 1, "skipped": 1, "delivered": 1, "opened": 1, "opens": 1, "clicked": 1, "clicks": 1, "bounced": 1, "complained": 1, "unsubscribed": 1, "rates": { "open": 1, "click": 1, "unsubscribe": 1, "bounce": 1, "complaint": 1 }}The request isn’t valid; issues lists each problem
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}The API key or access token is missing, invalid or expired
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}The API key’s permissions, or the app’s scopes and the member’s role, don’t allow this
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}Not found in this workspace
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}Too many requests; wait for the seconds in Retry-After
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}