Campaign

Summary

Resource

Operation

Description

Campaign

POST /api/campaigns

Creates a new campaign.

GET /api/campaigns/(int:campaign_id)

Gets a single campaign given its ID.

GET /api/campaigns

Gets a list of all the campaigns.

PUT /api/campaigns/(int:campaign_id)

Updates an existing campaign.

DELETE /api/campaigns/(int:campaign_id)

Deletes a campaign.

Create

JSON Schema

Required parameters are in bold.

type

object

properties

  • name

type

string

maxLength

255

minLength

1

  • aliases

type

array

items

type

string

maxLength

255

minLength

1

minItems

1

additionalProperties

False


POST /api/campaigns

Creates a new campaign.

Example request:

POST /campaigns HTTP/1.1
Host: 127.0.0.1
Content-Type: application/json

{
  "name": "LOLcats",
  "aliases": ["icanhaz"]
}

Example response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": 1,
  "aliases": ["icanhaz"],
  "created_time": "Thu, 28 Feb 2019 17:10:44 GMT",
  "modified_time": "Thu, 28 Feb 2019 17:10:44 GMT",
  "name": "LOLcats"
}
Request Headers
Response Headers
Status Codes

Read Single

GET /api/campaigns/(int: campaign_id)

Gets a single campaign given its ID.

Example request:

GET /campaigns/1 HTTP/1.1
Host: 127.0.0.1
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 1,
  "aliases": ["icanhaz"],
  "created_time": "Thu, 28 Feb 2019 17:10:44 GMT",
  "modified_time": "Thu, 28 Feb 2019 17:10:44 GMT",
  "name": "LOLcats"
}
Request Headers
Response Headers
Status Codes

Read Multiple

GET /api/campaigns

Gets a list of all the campaigns.

Example request:

GET /campaigns HTTP/1.1
Host: 127.0.0.1
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "id": 1,
    "aliases": ["icanhaz"],
    "created_time": "Thu, 28 Feb 2019 17:10:44 GMT",
    "modified_time": "Thu, 28 Feb 2019 17:10:44 GMT",
    "name": "LOLcats"
  },
  {
    "id": 2,
    "aliases": [],
    "created_time": "Thu, 28 Feb 2019 17:11:37 GMT",
    "modified_time": "Thu, 28 Feb 2019 17:11:37 GMT",
    "name": "Derpsters"
  }
]
Request Headers
Response Headers
Status Codes

Update

JSON Schema

Required parameters are in bold.

type

object

properties

  • name

type

string

maxLength

255

minLength

1

additionalProperties

False


PUT /api/campaigns/(int: campaign_id)

Updates an existing campaign.

Example request:

PUT /campaigns/1 HTTP/1.1
Host: 127.0.0.1
Content-Type: application/json

{
  "name": "Derpsters",
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 1,
  "aliases": ["icanhaz"],
  "created_time": "Thu, 28 Feb 2019 17:10:44 GMT",
  "modified_time": "Thu, 28 Feb 2019 17:18:29 GMT",
  "name": "Derpsters"
}
Request Headers
Response Headers
Status Codes

Delete

DELETE /api/campaigns/(int: campaign_id)

Deletes a campaign.

Example request:

DELETE /campaigns/1 HTTP/1.1
Host: 127.0.0.1

Example response:

HTTP/1.1 204 No Content
Request Headers
Status Codes