WhatsApp API

Expand your messaging horizons

Introduction

WhatsApp Business API is a communication solution that provides media-rich white-label messaging via one of the world’s most prominent OTT messaging channels. Our clients now have the opportunity to reach WhatsApp’s 2 billion monthly active users through a sophisticated, easy-to-use integration.

SMSGlobal’s WhatsApp Business API provides a robust gateway for our clients to utilize enterprise messaging on WhatsApp. With the opportunity to reach WhatsApp’s notable 2 billion monthly active users, this API allows trusted businesses to connect with customers directly.

Integrate SMSGlobal’s WhatsApp Business API to established backend systems and enable all the possibilities of rich, contextual, business-grade communication on WhatsApp.


REST API Scroll to Top ▲

The REST API allows programmatic access to SMSGlobal features in MXT. To use the REST API, you will need an MXT account and an API key and secret. You can generate these inside your MXT account. The REST API can be accessed at api.smsglobal.com. Use of SSL is supported and strongly encouraged. The REST API takes full advantage of all HTTP headers. Each part of a request and response is meaningful, including the request method (GET/POST, etc.), the individual headers (Location, Content-Type, Accept, etc.), and the response status code (200, 400, 404, etc.). Use of this API assumes a working knowledge of these HTTP components, and general use of RESTful web APIs.


Authentication Scroll to Top ▲

The REST API uses an authentication scheme based on this OAuth 2 specification . All requests to resources (excluding the schema pages) must be accompanied by a correct Authorization header as per this specification. The header looks like this:

 Authorization: MAC id="your API key", ts="1325376000", nonce="random-string", mac="base64-encoded-hash" 

Response Codes Scroll to Top ▲

The following response codes apply to all requests. Check each request type in the list below for more response codes specific to that request.

Status CodeMeaningScenario

200

OK

The request was processed successfully

400

Bad Request

Your request contained invalid or missing data

401

Unauthorized

Authentication failed or the Authenticate header was not provided

404

Not Found

The URI does not match any of the recognised resources, or, if you are asking for a specific resource with an ID, that resource does not exist

405

Method Not Allowed

The HTTP request method you are trying to use is not allowed. Make an OPTIONS request to see the allowed methods

406

Not Acceptable

The Accept content type you are asking for is not supported by the REST API

415

Unsupported Media Type

The Content-Type header is not supported by the REST API

Message Object Types Scroll to Top ▲

The types of messages that can be sent include the following:

Template message

JSON object parameters:

NameDescriptionJSON TypeDefaultConstraintsRequired
typeConstant value template.StringN/AN/AYes
template_nameName of the template.StringN/AN/AYes
paramsParameters to inject into the template.String arrayN/AThis parameter can only be used for template messages with only a body of text.No
Text message

JSON object parameters:

NameDescriptionJSON TypeDefaultConstraintsRequired
typeConstant value textStringN/AN/AYes
preview_urlMessage objectBooleanfalsetrue or falseNo
TextThe text message contentStringN/AValid URLYes
Image message

Accepted content types can be found in the table below

JSON object parameters:

NameDescriptionJSON TypeDefaultConstraintsRequired
typeConstant value imageStringN/AN/AYes
urlPublic url of the image file. Should be either HTTP or HTTPS link.StringN/AAccepted Content-Type headerYes
captionOptional caption that will be displayed underneath the image.StringNoneN/ANo
Video message

Accepted content types can be found in the table below

JSON object parameters:

NameDescriptionJSON TypeDefaultConstraintsRequired
typeConstant value videoStringN/AN/AYes
urlPublic url of the video file (mp4). Should be either HTTP or HTTPS link.StringN/AAccepted Content-Type headerYes
captionOptional caption that will be displayed underneath the video.StringNoneN/ANo
Document message

Accepted content types can be found in the table below

JSON object parameters:

NameDescriptionJSON TypeDefaultConstraintsRequired
typeConstant value documentStringN/AN/AYes
urlPublic url of the document file. Should be either HTTP or HTTPS link.StringN/AAccepted Content-Type headerYes
filenameOptional parameter that describes the filename of the document.StringNoneN/ANo
captionOptional caption that will be displayed as the document title.StringNoneN/ANo
Audio message

Accepted content types can be found in the table below

JSON object parameters:

NameDescriptionJSON TypeDefaultConstraintsRequired
typeConstant value audioStringN/AN/AYes
urlPublic url of the audio file. Should be either HTTP or HTTPS link.StringN/AAccepted Content-Type headerYes
Location message

JSON object parameters:

NameDescriptionJSON TypeDefaultConstraintsRequired
typeConstant value locationStringN/AN/AYes
latThe latitude position as a float number.NumberN/A[-90, 90]Yes
lngThe longitude position as a float number.NumberN/A[-180, 180]Yes
nameThe name for the location. Will be displayed in the message.StringN/AN/ANo
addressThe address for the location. Will be displayed in the message.StringN/AN/ANo
Accepted media types
Message TypeSupported content typesPost-processing size limit
documentAny content type listed for other message types,




text/plain, text/csv, application/pdf, application/msword, application/x-tar, application/rtf.0, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation,
application/vnd.openxmlformats-officedocument.wordprocessingml.document,
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
application/vnd.oasis.opendocument.presentation,
application/vnd.oasis.opendocument.spreadsheet,
application/vnd.ms-excel,
application/vnd.oasis.opendocument.text
100 MB
imageimage/jpeg, image/png5 MB
audioaudio/aac, audio/mp4, audio/amr, audio/mpeg, audio/ogg, audio/opus16 MB
videovideo/mp4, video/3gpp16 MB
stickerimage/webp100 KB

API Endpoints Scroll to Top ▲

  • whatsapp
    /v2/whatsapp/blacklist
    /v2/whatsapp/capabilities
    /v2/whatsapp/incoming
    /v2/whatsapp/incoming/read
    /v2/whatsapp/incoming/{id}
    /v2/whatsapp/message
    /v2/whatsapp/message/{id}
    /v2/whatsapp/opt-in
    /v2/whatsapp/opt-out
Early Access

WhatsApp Business API

Loading Form