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

NameRequiredTypeDefaultComment
identifieryesstring
nameyesstring
template_campaign_idyesinteger
login_optionsjson
ssidstring
text_colorstring
backgroundstring
footer_textstring
title_textstring
custom_termsstring
redirect_urlstring
login_facebookstring0,1
login_customstring0,1
login_twitterstring0,1
login_instagramstring0,1
login_linkedinstring0,1

Notes:

  • name The name must be alphanumeric
  • template_campaign_id The template_campaign_id must be an existing campaign
  • login_options The login_options must be a validated JSON payload of the appropriate login options that will override all login_* parameters passed below
  • ssid The ssid must be alphanumeric, the “#” symbol may also be used
  • text_color The text_color is the hex code for the colour of the text that appears on the login page (without the leading # sign)
  • background The background is the hex code for the colour of the background (without the leading # sign)
  • footer_text The footer_text must be a string
  • title_text The title_text must be a string
  • custom_terms The custom_terms must be a string, and does accept html markup
  • redirect_url The redirect_url must be a proper URL format (including http/https)
  • login_facebook The login_facebook must be [1 / 0] - false if you want to not include this login option
  • login_custom The login_custom must be [1 / 0] - 0 if you want to not include this login option
  • login_twitter The login_twitter must be [1 / 0] - 0 if you want to not include this login option
  • login_instagram The login_instagram must be [1 / 0] - 0 if you want to not include this login option
  • login_linkedin The 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

NameRequiredTypeDefaultComment
identifieryesstring
nameyesstring
campaign_idyesinteger
login_optionsjson
ssidstring
text_colorstring
backgroundstring
footer_textstring
title_textstring
custom_termsstring
redirect_urlstring
login_facebookstring0,1
login_customstring0,1
login_twitterstring0,1
login_instagramstring0,1
login_linkedinstring0,1

Notes:

  • name The name must be alphanumeric
  • campaign_id The campaign_id must be an existing campaign
  • login_options The login_options must be a validated JSON payload of the appropriate login options that will override all login_* parameters passed below
  • ssid The ssid must be alphanumeric, the “#” symbol may also be used
  • text_color The text_color is the hex code for the colour of the text that appears on the login page (without the leading # sign)
  • background The background is the hex code for the colour of the background (without the leading # sign)
  • footer_text The footer_text must be a string
  • title_text The title_text must be a string
  • custom_terms The custom_terms must be a string, and does accept html markup
  • redirect_url The redirect_url must be a proper URL format (including http/https)
  • login_facebook The login_facebook must be [1 / 0] - false if you want to not include this login option
  • login_custom The login_custom must be [1 / 0] - 0 if you want to not include this login option
  • login_twitter The login_twitter must be [1 / 0] - 0 if you want to not include this login option
  • login_instagram The login_instagram must be [1 / 0] - 0 if you want to not include this login option
  • login_linkedin The 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

NameRequiredTypeDefaultComment
identifieryesstring
campaign_idsyesstring

Notes:

  • campaign_ids The 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

NameRequiredTypeDefaultComment
identifieryesstring
campaign_idyesinteger

Notes:

  • campaign_id The 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]
    }
}