Campaign
Set of endpoints used for the campaign creation/modification/lists.
Create
Create Campaign from Template Campaign
POST /api/create-or-update-campaign
Auth [Identifier], Scope [User]
Params
| Name | Required | Type | Default | Comment |
|---|---|---|---|---|
| identifier | yes | string | ||
| name | yes | string | ||
| template_campaign_id | yes | integer | ||
| login_options | json | |||
| ssid | string | |||
| text_color | string | |||
| background | string | |||
| footer_text | string | |||
| title_text | string | |||
| custom_terms | string | |||
| redirect_url | string | |||
| login_facebook | string | 0,1 | ||
| login_custom | string | 0,1 | ||
| login_twitter | string | 0,1 | ||
| login_instagram | string | 0,1 | ||
| login_linkedin | string | 0,1 |
Notes:
nameThe name must be alphanumerictemplate_campaign_idThe template_campaign_id must be an existing campaignlogin_optionsThe login_options must be a validated JSON payload of the appropriate login options that will override all login_* parameters passed belowssidThe ssid must be alphanumeric, the “#” symbol may also be usedtext_colorThe text_color is the hex code for the colour of the text that appears on the login page (without the leading # sign)backgroundThe background is the hex code for the colour of the background (without the leading # sign)footer_textThe footer_text must be a stringtitle_textThe title_text must be a stringcustom_termsThe custom_terms must be a string, and does accept html markupredirect_urlThe redirect_url must be a proper URL format (including http/https)login_facebookThe login_facebook must be [1 / 0] - false if you want to not include this login optionlogin_customThe login_custom must be [1 / 0] - 0 if you want to not include this login optionlogin_twitterThe login_twitter must be [1 / 0] - 0 if you want to not include this login optionlogin_instagramThe login_instagram must be [1 / 0] - 0 if you want to not include this login optionlogin_linkedinThe login_inkedin must be [1 / 0] - 0 if you want to not include this login option
Success [200]
{
"status": "success",
"data": [
"id": "[campaign-id]",
"name": "[Campaign Name]",
"ssid": "[SSID]",
"payload": "[Campaign JSON Payload]",
"date_created": "[datetime]",
"last_modified": "[datetime]",
"deleted": "[0|1]"
]
}
Error [400]
{
"status": "success",
"message": "Campaign has been created successfully.",
"campaign_id": [campaign_id],
"campaign_filename": "[campaign_filename]"
}
Update
Update Campaign
POST /api/create-or-update-campaign
Auth [Identifier], Scope [Campaign]
Params
| Name | Required | Type | Default | Comment |
|---|---|---|---|---|
| identifier | yes | string | ||
| name | yes | string | ||
| campaign_id | yes | integer | ||
| login_options | json | |||
| ssid | string | |||
| text_color | string | |||
| background | string | |||
| footer_text | string | |||
| title_text | string | |||
| custom_terms | string | |||
| redirect_url | string | |||
| login_facebook | string | 0,1 | ||
| login_custom | string | 0,1 | ||
| login_twitter | string | 0,1 | ||
| login_instagram | string | 0,1 | ||
| login_linkedin | string | 0,1 |
Notes:
nameThe name must be alphanumericcampaign_idThe campaign_id must be an existing campaignlogin_optionsThe login_options must be a validated JSON payload of the appropriate login options that will override all login_* parameters passed belowssidThe ssid must be alphanumeric, the “#” symbol may also be usedtext_colorThe text_color is the hex code for the colour of the text that appears on the login page (without the leading # sign)backgroundThe background is the hex code for the colour of the background (without the leading # sign)footer_textThe footer_text must be a stringtitle_textThe title_text must be a stringcustom_termsThe custom_terms must be a string, and does accept html markupredirect_urlThe redirect_url must be a proper URL format (including http/https)login_facebookThe login_facebook must be [1 / 0] - false if you want to not include this login optionlogin_customThe login_custom must be [1 / 0] - 0 if you want to not include this login optionlogin_twitterThe login_twitter must be [1 / 0] - 0 if you want to not include this login optionlogin_instagramThe login_instagram must be [1 / 0] - 0 if you want to not include this login optionlogin_linkedinThe login_inkedin must be [1 / 0] - 0 if you want to not include this login option
Success [200]
{
"status": "success",
"message": "Campaign has been updated successfully.",
"campaign_id": [campaign_id],
"campaign_filename": "[campaign_filename]"
}
Error [400]
{
"status": "error",
"message": {
[error_msgs]
}
}
Retrieve
Retrieve data for multiple or single Campaign(s)
GET /api/get-campaign
Auth [Identifier], Scope [Campaign]
Params
| Name | Required | Type | Default | Comment |
|---|---|---|---|---|
| identifier | yes | string | ||
| campaign_ids | yes | string |
Notes:
campaign_idsThe campaign_ids must be either a single campaign_id integer or a comma separated list of campaign_ids [maximum 10 campaign_ids]
Success [200]
{
"status": "success",
"data": [
"id": "[campaign-id]",
"name": "[Campaign Name]",
"ssid": "[SSID]",
"payload": "[Campaign JSON Payload]",
"date_created": "[datetime]",
"last_modified": "[datetime]",
"deleted": "[0|1]"
]
}
Error [400]
{
"status": "error",
"message": {
[error_msgs]
}
}
Delete
Delete Campaign
POST /api/delete-campaign
Auth [Identifier], Scope [Campaign]
Params
| Name | Required | Type | Default | Comment |
|---|---|---|---|---|
| identifier | yes | string | ||
| campaign_id | yes | integer |
Notes:
campaign_idThe campaign_id must be a Campaign ID# from the MyWiFi Dashboard
Success [200]
{
"status": "success",
"message": "Campaign has been successfully deleted."
}
Error [400]
{
"status": "error",
"message": {
[error_msgs]
}
}