API - Documentation

Integrate now with the biggest communication platform in the world, WhatsApp Business API through Positus.

Positus Architecture - WhatsApp Business API

Production Environment: Your token will be generated and provided by Positus, it will give access to all your WhatsApp Business API numbers. MediaId will be provided after activation of each WhatsApp Business API number. Sandbox (Development environment): You can generate your token directly at http://studio.posit.us/.

Postman file

Postman is a tool that aims to test RESTful services (Web APIs) by sending HTTP requests and analyzing their feedback. Download Postman App

post
messages

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Utilize this route to send text messages via WhatsApp
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp number
Headers
Content-Type
required
string
application/json
Authentication
required
string
Authentication using Bearer Token
Body Parameters
required
object
{ "to": "+5511999999999", "type": "text", "text": { "body": "your-message-content" } }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

post
HSM

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Utilize this route to send notification messages via WhatsApp HSM - Are message templates that are pre-approved by Facebook, can be text messages, media, or files.
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp number
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Body Parameters
Full
optional
string
{ "to": "+551199999999", "type": "template", "template": { "namespace": "xxxxxxx", "language": { "policy": "deterministic", "code": "pt_BR" }, "name": "xxxxxx", "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://dealers.rewebmkt.com/images/20190417084518-actros-3-1280.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "Rafael" }, { "type": "text", "text": "Mercedes-Benz" }, { "type": "text", "text": "Actros" }, { "type": "text", "text": "Cardiesel - Belo Horizonte" }, { "type": "text", "text": "08/05/2020" } ] }, { "type": "button", "sub_type" : "url", "index": "0", "parameters": [ { "type": "text", "text": "fMYMyV8x" } ] } ] } }
Buttons
optional
string
{ "to": "+5511999999999", "type": "template", "template": { "namespace": "dc730af3_d5a86", "language": { "policy": "deterministic", "code": "pt_BR" }, "name": "carteiro_botoes", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Robbu" }, { "type": "text", "text": "Thiago Thamiel" } ] }, { "type": "button", "sub_type": "quick_reply", "index": "0" } ] } }
Text
optional
object
{ "to": "+55119999999999", "type": "hsm", "hsm": { "namespace": "52_2bca4fad4c4a", "element_name": "fgv_3", "language": { "policy": "deterministic", "code": "pt_BR" }, "localizable_params": [ { "default": "Thiago" } ] } }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

post
Contact

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Share contacts
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp number
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Body Parameters
required
object
{ "to": "+5511999999999", "type": "contacts", "contacts":[{ "addresses": [], "emails": [], "ims": [], "name": { "first_name": "Positus Provider", "formatted_name": "Positus Provider" }, "org": [], "phones": [{ "phone": "+55 11 2626-4234", "type": "CELL", "wa_id": "551126264234" }], "urls": [] }] }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

post
Location

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Share location
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp numbers
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Body Parameters
required
object
{ "to": "+5511999999999", "type": "location", "location": { "longitude": -46.662787, "latitude": -23.553610, "name": "Robbu Brazil", "address": "Av. Angélica, 2530 - Bela Vista, São Paulo - SP, 01228-200" } }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

post
Image

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Share images
Request
Response
Request
Path Parameters
MediaId
required
string
Unique code by WhatsApp number
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Body Parameters
required
object
{ "to": "+5511999999999", "type": "image", "image": { "link": "https://picsum.photos/200", "caption": "your-document-caption" }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

post
Document

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Share images
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp number
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Body Parameters
required
object
{ "to": "+5511941489395", "type": "document", "document": { "link": "http://www.pdf995.com/samples/pdf.pdf", "caption": "your-document-caption" }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

post
Video

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Share videos
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp number
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Body Parameters
required
object
{ "to": "+5511999999999", "type": "video", "video": { "link": "https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4", "caption": "your-document-caption" }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

post
Audio

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Share audio
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp number
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Body Parameters
required
object
{ "to": "+5511999999999", "type": "audio", "audio": { "link": "https://sample-videos.com/audio/mp3/crowd-cheering.mp3" }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

post
Sticker

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Share stickers. Sticker format must be exactly 512x512
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp number
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Body Parameters
required
object
{ "to": "+5511999999999", "type": "sticker", "sticker": { "link": "https://studio.posit.us/api/samples/sticker.webp" }
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}

get
Download Media

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/media/{{messages.type.id}}
Download media
Request
Response
Request
Path Parameters
chave
required
string
Unique code by WhatsApp number
Headers
Authentication
required
string
Authentication using Bearer Token
Content-Type
required
string
application/json
Response
200: OK
{
"messages": [
{
"id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
}
],
"message": "The message was successfully sent"
}
500: Internal Server Error
{
"errors": [
{
"code": ,
"title": "",
"details": ""
}
],
"message": ""
}