Configuração Rápida

Defina abaixo o Base URL e o token de autorização para que os exemplos de curl sejam preenchidos automaticamente.

GET Obtenha lista de contatos
/api/contacts

curl -X GET 
  {{base_url}}/api/contacts 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
POSTAdicionar contato
/api/contacts

curl -X POST 
  {{base_url}}/api/contacts 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
PUTEditar contato
/api/contacts/{uuid}

curl -X PUT 
  {{base_url}}/api/contacts/{uuid} 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
DELETEExcluir contato
/api/contacts/{uuid}

curl -X DELETE 
  {{base_url}}/api/contacts/{uuid} 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
GETObter lista de grupos de contatos
/api/contact-groups

curl -X GET 
  {{base_url}}/api/contact-groups 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
POSTAdicionar grupo de contatos
/api/contact-groups

curl -X POST 
  {{base_url}}/api/contact-groups 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
PUTEditar grupo de contatos
/api/contact-groups/{uuid}

curl -X PUT 
  {{base_url}}/api/contact-groups/{uuid} 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
DELETEExcluir grupo de contatos
/api/contact-groups/{uuid}

curl -X DELETE 
  {{base_url}}/api/contact-groups/{uuid} 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
GETObter lista de respostas automatizadas
/api/canned-replies

curl -X GET 
  {{base_url}}/api/canned-replies 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
POSTAdicionar resposta automática
/api/canned-replies

curl -X POST 
  {{base_url}}/api/canned-replies 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
PUTEditar resposta automática
/api/canned-replies/{uuid}

curl -X PUT 
  {{base_url}}/api/canned-replies/{uuid} 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
DELETEExcluir resposta automática
/api/canned-replies/{uuid}

curl -X DELETE 
  {{base_url}}/api/canned-replies/{uuid} 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200
POSTEnviar mensagem
/api/send

curl -X POST 
  {{base_url}}/api/send 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json" 
  -d '{
    "phone": "+1 (968) 082-5846",
    "message": "Hello John, how are you?",
    "header": "Test header",
    "footer": "Test footer",
    "buttons": [
      { "id": "id_1", "title": "Fine" },
      { "id": "id_2", "title": "Not well" }
    ]
  }'
            
Resposta esperada: 200
POSTEnviar mídia
/api/send/media

curl -X POST 
  {{base_url}}/api/send/media 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json" 
  -d '{
    "phone": "+1 (968) 082-5846",
    "media_type": "image",
    "media_url": "https://images.pexels.com/photos/276267/pexels-photo-276267.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
    "caption": "your caption for image or video media types",
    "file_name": "testFileName"
  }'
            
Resposta esperada: 200
POSTEnviar mensagem de template
/api/send/template

curl -X POST 
  {{base_url}}/api/send/template 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json" 
  -d '{
    "phone": "+1 (968) 082-5846",
    "template": {
      "name": "car_insurance",
      "language": { "code": "en" },
      "components": [
        {
          "type": "header",
          "parameters": [
            { "type": "image", "image": { "link": "http(s)://URL" } }
          ]
        },
        {
          "type": "body",
          "parameters": [
            { "type": "text", "text": "TEXT_STRING" },
            { "type": "date_time", "date_time": { "fallback_value": "MONTH DAY, YEAR" } }
          ]
        },
        {
          "type": "button",
          "sub_type": "quick_reply",
          "index": "0",
          "parameters": [ { "type": "payload", "payload": "PAYLOAD" } ]
        },
        {
          "type": "button",
          "sub_type": "quick_reply",
          "index": "2",
          "parameters": [ { "type": "payload", "payload": "PAYLOAD" } ]
        }
      ]
    }
  }'
            
Resposta esperada: 200
GETListar templates
/api/templates

curl -X GET 
  {{base_url}}/api/templates 
  -H "Authorization: Bearer {{token}}" 
  -H "Content-Type: application/json"
            
Resposta esperada: 200