Skip to content
Wire2AirWire2Air

REST API v1

Base URL, authentication, request format, pagination and errors for the Wire2Air REST API v1.

Last updated

The REST API v1 sends messages, lists received messages and manages campaigns. It authenticates with an API key and answers in JSON.

Base URL

Base URL
https://msgapi.wire2air.com/rest/v1

Every path in this section is relative to it: /message means https://msgapi.wire2air.com/rest/v1/message.

Endpoints

MethodPathDoes
POST/messageSend an SMS to one number or many
GET/messages/inboxList received messages
GET/campaignList campaigns
GET/campaign/{ID}Get one campaign
POST/campaignCreate a campaign
POST/campaign/{ID}Edit a campaign
DELETE/campaign/{ID}Delete a campaign

Authentication

Send your API key in the apikey header of every request. See Authentication.

Header
apikey: YOUR_API_KEY

Request format

Send parameters as application/x-www-form-urlencoded: in the body for POST, in the query string for GET. Every example in these docs does this.

Responses

Responses are JSON. A created resource carries its ID and a relative URI:

201 Created
{
  "Response": "Message Queued successfully",
  "URI": "v1/message/outbox/85582790",
  "ID": "85582790",
  "Type": "Out"
}

Pagination

List endpoints take PageNo (default 1) and PageSize (default 10) and wrap the results in a page envelope:

FieldMeaning
PageNoThe page returned.
PageSizeResults per page.
TotalPagesNumber of pages. Returned as a number with a decimal point (12.0); read it as a whole number.
TotalRecordsNumber of results across all pages.
RowStart, RowEndPosition of the first and last result on this page.
ListItemsThe results.

To read everything, request PageNo 1, 2, 3 … until PageNo equals TotalPages.

Errors

StatusMeaning
200Success
201Created (a message was queued)
400Bad request; the JSON body says what is wrong
401Missing or incorrect API key
429API calls quota exceeded (rate limits)
500Internal server error; contact support

A 400 body looks like {"StatusCode": 712, "StatusMessage": "Campaign Id required."}. See Errors.