campaigntextmessages_

Campaign Text Messages

Text Messages are used for sending promotional messages. There are certain policies you must adhere to for sending such messages. Messages can be sent through SMS and email. Based on your Mojo Canvas subscription, you can create text messages (advertisements) and add these to a campaign.

JSON Table

Attribute Data Type Description Default/Sample value
success boolean true
message String Record(s) Found
data application/json
data/totalCount int 2
data/textMessages application/json
data/textMessages/message_id int 1
data/textMessages/name String WiFi
data/textMessages/content String Offer
data/textMessages/campaign_id int 6
data/textMessages/date_created int 2018-02-22 07:09:46.274116
data/textMessages/date_modified int null

Copy Sample JSON
Sample JSON
{
    "success": true,
    "message": "Record(s) Found",
    "data": {
        "totalCount": 2,
        "textMessages": [
            {
                "message_id": 1,
                "name": "offer",
                "content": "pizza",
                "campaign_id": 6,
                "date_created": "2017-09-11 12:47:27.942031",
                "date_modified": null
            },
            {
                "message_id": 4,
                "name": "WiFi",
                "content": "Offer",
                "campaign_id": 6,
                "date_created": "2018-02-22 07:09:46.274116",
                "date_modified": null
            }
        ]
    }
}
API Calls

v1.14/campaigns/{campaignId}/textmessages

v1.14/campaigns/{campaignId}/textmessages/{messageId}

v1.14/campaigns/{campaignId}/textmessages

v1.14/campaigns/{campaignId}/textmessages/{messageId}

v1.14/campaigns/{campaignId}/textmessages/{messageId}

Get List of all the Text Messages

Description This API provides a list of all the messages created in a campaign.
Syntax
GET <Base_URL>/campaigns/{campaignId}/textmessages

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

Sample code
GET https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/textmessages
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the list of all the messages and their details, for the specified campaign. The response is in the application/json format.

Get Message for a Campaign by ID

Description This API provides details of the specified message created in a campaign.
Syntax
GET <Base_URL>/campaigns/{campaignId}/textmessages/{messageId}

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • messageId

    It is the unique system-generated message ID. It takes an integer value.

Sample code
GET https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/textmessages/1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains details of the specifed message, for the specified campaign. The response is in the application/json format.

Add New Message in Campaign

Description This API adds the new message in a campaign.
Syntax
POST<Base_URL>/campaigns/{campaignId}/textmessages

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

Sample code
POST https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/textmessages
Request Body The request body requires the name of the messsage and the text to go along with the message.A sample request body is as follows:

{"name":"WiFi","content":"Offer"}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the newly added message. The response is in the application/json format.

Update Message in Campaign

Description This API is used to update the existing message in a campaign.
Syntax
PUT <Base_URL>/campaigns/{campaignId}/textmessages/{messageId}

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • messageId

    It is the unique system-generated message ID. It takes an integer value.

Sample code
PUT https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/textmessages/3
Request Body The request body requires the name of the messsage and the text to go along with the message.A sample request body is as follows:

{"name":"New Service","content":"Offer"}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the updated message. The
response is in the application/json format.

Delete Message

Description This API deletes the existing message.
Syntax
DELETE <Base_URL>/campaigns/{campaignId}/textmessages/{messageId}

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • messageId

    It is the unique system-generated message ID. It takes an integer value.

Sample code
DELETE https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/textmessages/3
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the deleted message. The response is in the application/json format.

Test APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.