Manage campaigns

Notes

API allows you to create, retrieve, update and delete campaign. Each method operates per one campaign.
Methods listed on this page are only available to registered users.

Get campaign

GET track/campaign/{id}?auth={auth}

Parameters

auth string required API key for authentication. Get API key at your Profile page.
id string required Campaign identifier.

Response

id string Campaign identifier.
name string Campaign name.
description string Campaign description.
created timestamp Date and time when the campaign was created.

Example

Get the campaign data with id ebf4e007447846f292234ea185a6b95d. Note that response is re-formatted and simplified for human reading.
Request:
GET http://www.esponce.com/api/v3/track/campaign/ebf4e007447846f292234ea185a6b95d?auth=d3m04u7h
Response:
{
  id: "ebf4e007447846f292234ea185a6b95d",
  name: "API codes",
  description: "Campaign contains QR Codes for testing web service.",
  created: "2012-01-10T12:16:13Z"
}

Insert a new campaign

POST track/campaign?auth={auth}

Parameters

auth string required API key for authentication.
name string required Campaign name.
description string optional Campaign description.

Response

id string Campaign identifier.
created timestamp Date and time when the campaign was created.

Example

Request:
POST http://www.esponce.com/api/v3/track/campaign?auth=d3m04u7h
{
  name: "API codes",
  description: "Campaign contains QR Codes for testing web service."
}
Response:
{
  id: "ebf4e007447846f292234ea185a6b95d",
  created: "2012-01-10T12:16:13Z"
}

Update a campaign

PUT track/campaign/{id}?auth={auth}

Parameters

auth string required API key for authentication.
name string required Campaign name.
description string optional Campaign description.

Response

No data in response, only headers.

Example

Request:
PUT http://www.esponce.com/api/v3/track/campaign/ebf4e007447846f292234ea185a6b95d?auth=d3m04u7h
{
  name: "New Campaign Name",
  description: "Campaign contains QR Codes for testing web service. Campaign has been updated recently."
}
Response:
(no content)

Delete a campaign

DELETE track/campaign/{id}
Warning: deleting a campaign may delete also QR Codes from the campaign (depending on the parameter)

Parameters

auth string required API key for authentication. This parameter is required.
id string required Campaign identifier.
keep bool optional Flag that indicates whether to keep or delete QR Codes from the campaign. Default: false

Response

No data in response, only headers.

Example

Delete the campaign "API codes" but keep QR Codes from inside the campaign. Those QR Codes will no longer be attached to the campaign.
Request:
DELETE http://www.esponce.com/api/v3/track/campaign/ebf4e007447846f292234ea185a6b95d?auth=d3m04u7h&keep=true
Response:
(no content in response but check if HTTP status code returns 200 OK)