Get a campaign’s opens and clicks over time
const url = 'https://api.sendwing.app/api/organizations/example/campaigns/example/report/timeline';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/timeline \ --header 'x-api-key: <x-api-key>'When its recipients first opened and first clicked it, from the hour or day it started sending to now, or to 30 days after it started. No points before it starts sending.
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 timeline
object
What each point counts: by the hour for up to three days, else by the day
The workspace’s IANA time zone, which hours and days are in
object
When the hour or day starts, ISO 8601 in UTC
Recipients who first opened in it
Recipients who first clicked in it
Example
{ "interval": "hour"}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"}