REST Campaign management
With Campaign APIs, you can manage campaigns, contacts, survey responses, and Invites.
Endpoint
To retrieve all campaigns using Wire2Air Rest API, send a GET request to the campaign URL:
GET https://msgapi.wire2air.com/rest/v1/campaign
Request Parameters
Name | Required? | Examples | Description |
---|---|---|---|
PageNo | Optional | Example: 3 | Fetch the specified results page. The default is 1. |
PageSize | Optional | For example 100 | The number of results per page. The default is 10. |
Response format
Name | Required? | Examples | Description |
---|---|---|---|
ID | 234553234 | Campaign unique identifier | |
CampaignType | Text2Join | Possible values: Text2Join, Email2Text, Text2Email, AutoResponder, TextSurvey, TextVoting | |
CampaignName | Weekly Coupon Club | Campaign internal identifier | |
Shortcode | 27126 | Campaign Inbound Text Number | |
Keyword | Campaign Keyword | ||
AutoResponse | Text2Join AutoResponse Message. Parameter is only available for Text2Join type campaigns | ||
ProcessorURL | Incoming messages call-back URL. Parameter is only availble for Developers API type campaign | ||
SubscribersCount | Number of Subscribers/Contacts in the list |
Successful Response Sample
{ "PageNo": 1, "PageSize": 10, "TotalPages": 12.0, "TotalRecords": 118, "RowStart": 1, "RowEnd": 10, "ListItems": [ { "CampaignId": 9999999, "CampaignType": "Email2Text", "CampaignName": "demo@wire2air.com", "Shortcode": "", "Keyword": "", "AutoResponse": "", "ProcessorURL": "", "HelpResponse": "mZone Text Service. std msg charges apply.", "OptOutResponse": "You have successfully opted out from Text service and will not receive any messages. std msg charges apply.", "StickySession": null, "Action": "", "ForwardEmail": "", "ForwardMobile": "", "Description": "", "SubscribersCount": 0, "URI": "v1/campaign/9999999", "ID": "9999999" } ] }
Endpoint
To retrieve all campaigns using Wire2Air Rest API, send a GET request to the campaign URL:
GET https://msgapi.wire2air.com/rest/v1/campaign/{ID}
Request Parameters
No Parameters
Response format
Name | Required? | Examples | Description |
---|---|---|---|
ID | 234553234 | Campaign unique identifier | |
CampaignType | Text2Join | Possible values: Text2Join, Email2Text, Text2Email, AutoResponder, TextSurvey, TextVoting | |
CampaignName | Weekly Coupon Club | Campaign internal identifier | |
Shortcode | 27126 | Campaign Inbound Text Number | |
Keyword | Campaign Keyword | ||
AutoResponse | Text2Join AutoResponse Message. Parameter is only available for Text2Join type campaigns | ||
ProcessorURL | Incoming messages call-back URL. Parameter is only availble for Developers API type campaign | ||
SubscribersCount | Number of Subscribers/Contacts in the list |
Successful Campaign Response Sample
{ "CampaignId": 9999999, "CampaignType": "Email2Text", "CampaignName": "demo@wire2air.com", "Shortcode": "", "Keyword": "", "AutoResponse": "", "ProcessorURL": "", "HelpResponse": "mZone Text Service. std msg charges apply.", "OptOutResponse": "You have successfully opted out from Text service and will not receive any messages. std msg charges apply.", "StickySession": null, "Action": "", "ForwardEmail": "", "ForwardMobile": "", "Description": "", "SubscribersCount": 0, "URI": "v1/campaign/9999999", "ID": "9999999" }
Create Campaign
Endpoint
To create a new campaign or list using Wire2Air Rest API, send a POST request to the campaign URL:
POST https://msgapi.wire2air.com/rest/v1/campaign
*Only Text2Join and Developer API type of campaigns supported
Edit Campaign
Endpoint
To Edit a campaign or list using Wire2Air Rest API, send a POST request to the campaign URL along with campaignID:
POST https://msgapi.wire2air.com/rest/v1/campaign/{ID}
*Only Text2Join and Developer API type of campaigns supported
Parameters
Name | Required? | Examples | Description |
---|---|---|---|
CampaignType | Yes | Text2Join | Text2Join or DeveloperAPI |
Shortcode | Yes | Eg:27126 | SHORT CODE NUMBER; PROVIDED BY WIRE2AIR |
Keyword | No (Text2Join), Yes (Developer APIs) | Coupons | Keyword is required |
CampaignName | Yes | Weekly Coupons | Campaign Name |
HelpResponse | Optional | A auto reply message for “Help” command | The message text. Just like the other parameters, this should be urlencoded. It may contain any UTF-8 characters (Note: not all cell phone operators support UTF-8 characters). Check the encoding section for details. |
OptOutResponse | Optional | A auto reply message for “STOP” command | The message text. Just like the other parameters, this should be urlencoded. It may contain any UTF-8 characters (Note: not all cell phone operators support UTF-8 characters). Check the encoding section for details. |
ForwardEmail | Optional | New Lead Email notification. *Application to Text-2-Join Campaign only. | |
ForwardMobile | Optional | New Lead SMS notification: Enter mobile number in international format (Country Code + Mobile Number) e.g. 12123005984 for USA and Canada. *Application to Text-2-Join Campaign only. | |
ProcessorURL | YES | Incoming messages callback URL. *Application to Developer API campaign. | |
StickySession | No | Possible Values: 1, 0 | StickySession:1; After texting a keyword, subsequent messages doesn’t require a keyword. InActive Sessions are valid for 72 hours. *Application to Developer API campaign. |
Request Format
{
“CampaignType”: “Text2Join”,
“keyword”: “coupon”,
“Shortcode”: “27126”,
“CampaignName”: “weekly coupon deal”,
“ForwardEmail”:”weekly@gmail.com”,
“ForwardMobile”:”12123005984″,
“HelpResponse”: “Weekly Coupon Deal. 8mg/month. Call 1-800-xxxxx for support. Reply STOP to cancel. Msg&Data rates may apply.”,
“OptOutResponse”: “You have been removed from weekly coupon deal list and wouldn’t receive any more messages. Msg&Data rates may apply.”
}
Delete Campaign
Endpoint
To Delete a campaign or list using Wire2Air Rest API, send a DELETE request to the campaign URL along with campaignID:
DELETE https://msgapi.wire2air.com/rest/v1/campaign/{ID}
*Only Text2Join and Developer API type of campaigns supported
cURL Request Format
curl -X DELETE -H "apikey:Your-API-Key" "https://msgapi.wire2air.com/rest/v1/campaign/{ID}"