CampaignAlias¶
Summary¶
Resource |
Operation |
Description |
---|---|---|
CampaignAlias |
Creates a new campaign alias. |
|
Gets a single campaign alias given its ID. |
||
Gets a list of all the campaign aliases. |
||
Updates an existing campaign alias. |
||
Deletes an campaign alias. |
Create¶
JSON Schema
Required parameters are in bold.
type |
object |
|
properties |
||
|
type |
string |
maxLength |
255 |
|
minLength |
1 |
|
|
type |
string |
maxLength |
255 |
|
minLength |
1 |
|
additionalProperties |
False |
-
POST
/api/campaigns/alias
¶ Creates a new campaign alias.
Example request:
POST /campaigns/alias HTTP/1.1 Host: 127.0.0.1 Content-Type: application/json { "alias": "icanhaz", "campaign": "LOLcats" }
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "alias": "icanhaz", "campaign": "LOLcats" }
- Request Headers
Authorization – Optional Apikey value
- Response Headers
Content-Type – application/json
- Status Codes
201 Created – Campaign alias created
400 Bad Request – JSON does not match the schema
401 Unauthorized – Invalid role to perform this action
404 Not Found – Campaign does not exist
409 Conflict – Campaign alias already exists
409 Conflict – Campaign alias cannot be the same as its name
Read Single¶
-
GET
/api/campaigns/alias/
(int: campaign_alias_id)¶ Gets a single campaign alias given its ID.
Example request:
GET /campaigns/alias/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, "alias": "icanhaz", "campaign": "LOLcats" }
- Request Headers
Authorization – Optional Apikey value
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – Campaign alias found
401 Unauthorized – Invalid role to perform this action
404 Not Found – Campaign alias ID not found
Read Multiple¶
-
GET
/api/campaigns/alias
¶ Gets a list of all the campaign aliases.
Example request:
GET /campaigns/alias HTTP/1.1 Host: 127.0.0.1 Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": 1, "alias": "icanhaz", "campaign": "LOLcats" }, { "id": 2, "alias": "Dino", "campaign": "Riders" } ]
- Request Headers
Authorization – Optional Apikey value
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – Campaign aliases found
401 Unauthorized – Invalid role to perform this action
Update¶
JSON Schema
Required parameters are in bold.
type |
object |
|
properties |
||
|
type |
string |
maxLength |
255 |
|
minLength |
1 |
|
|
type |
string |
maxLength |
255 |
|
minLength |
1 |
|
additionalProperties |
False |
-
PUT
/api/campaigns/alias/
(int: campaign_alias_id)¶ Updates an existing campaign alias.
Example request:
PUT /campaigns/alias/1 HTTP/1.1 Host: 127.0.0.1 Content-Type: application/json { "alias": "Dino", "campaign": "Riders" }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "alias": "Dino", "campaign": "Riders" }
- Request Headers
Authorization – Optional Apikey value
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – Campaign alias updated
400 Bad Request – JSON does not match the schema
401 Unauthorized – Invalid role to perform this action
404 Not Found – Campaign alias ID not found
404 Not Found – Campaign not found
409 Conflict – Campaign alias already exists
409 Conflict – Campaign alias cannot be the same as its name
Delete¶
-
DELETE
/api/campaigns/alias/
(int: campaign_alias_id)¶ Deletes a campaign alias.
Example request:
DELETE /campaigns/alias/1 HTTP/1.1 Host: 127.0.0.1
Example response:
HTTP/1.1 204 No Content
- Request Headers
Authorization – Optional Apikey value
- Status Codes
204 No Content – Campaign alias deleted
401 Unauthorized – Invalid role to perform this action
404 Not Found – Campaign alias ID not found
409 Conflict – Unable to delete campaign alias due to foreign key constraints