API - Documentação

Integre agora mesmo com a maior plataforma de comunicação do mundo, WhatsApp Business API por Positus.

Arquitetura Positus - WhatsApp Business API

Token de Produção: O seu token será gerado e fornecido pela Positus, ele dará acesso a todos os seus números de WhatsApp Business API. A chave será fornecido após ativação de cada número de WhatsApp Business API. Sandbox - Token desenvolvimento: Você poderá gerar o seu token diretamente pelo http://studio.posit.us/.

Postman file

O Postman é uma ferramenta que tem como objetivo testar serviços RESTful (Web APIs) por meio do envio de requisições HTTP e da análise do seu retorno. Download Postman App

post
messages

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages
Utilize esta rota para enviar mensagens de texto via WhatsApp
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Content-Type
required
string
application/json
Authentication
required
string
Autenticação usando 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 esta rota para enviar mensagens de notificação via WhatsApp HSM - São templates de mensagens pré-aprovadas pelo Facebook, podem mensagens de texto, midia ou arquivos.
Request
Response
Request
Path Parameters
Chave
required
string
Headers
Authentication
required
string
Autenticação usando Bearer Token
Content-Type
required
string
application/json
Body Parameters
Completo
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" } ] } ] } }
Botões
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" } ] } }
Texto
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
Compartilhe contatos
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Authentication
required
string
Autenticação usando 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
Compartilhe localizações
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Authentication
required
string
Autenticação usando 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
Compartilhe imagens
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Authentication
required
string
Autenticação usando 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
Compartilhe imagens
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Authentication
required
string
Autenticação usando 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
Compartilhe videos
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Authentication
required
string
Autenticação usando 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
Compartilhe audios
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Authentication
required
string
Autenticação usando 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
Compartilhe adesivos. O Formato do adesivo tem que ser exatamente 512x512
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Authentication
required
string
Autenticação usando 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

get
Download Midia

https://api.positus.global/v2/whatsapp/numbers/{{chave}}/media/{{messages.type.id}}
Faça o download das midias
Request
Response
Request
Path Parameters
Chave
required
string
Código único por número de WhatsApp
Headers
Authentication
required
string
Autenticação usando 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": ""
}