WhatsApp Provisioning API

The WhatsApp Manager API enables customers to deploy a WhatsApp cluster, perform One Time Password (OTP) verification, and update profile information

Baixar a especificação OpenAPI

Deployment

Create and manage in-progress deployments

Provision WhatsApp deployment

This API request provisions a WhatsApp cluster. Once provisioned, the cluster progresses through the following deployment stages: INITIALIZING, CREATING_CLUSTER and CLUSTER_CREATED. When the CLUSTER_CREATED stage is reached an OTP voice call or SMS is sent to the specified number and the deployment status becomes CODE_SENT. When the OTP is received, call the Verify API to complete the process.

posthttps://api.nexmo.com/v0.1/whatsapp-manager/deployments

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Corpo da solicitação
Tipo de conteúdo
application/json

country_code
string
Obrigatório
exemplo44

The international dialing code of the number being provisioned

number
string
Obrigatório
exemplo8675309

The WhatsApp number being provisioned.

vname_certificate
string
Obrigatório
exemploAbCdEFGHiJK123456

The certificate, which you can retrieve from your WhatsApp Business dashboard.

Note this value is refreshed whenever you click the View button.

method
string
Obrigatório
exemplosms

The method for delivering the OTP

Deve ser uma das seguintes opções:smsvoice
waba_id
string
Obrigatório
exemplo123456789123

WABA ID of the WhatsApp Number

pin
string
exemplo123456

Required if you previously set a PIN when creating a WhatsApp number.

Exemplo Solicitação

{
   "country_code": "44",
   "number": "8675309",
   "vname_certificate": "AbCdEFGHiJK123456",
   "method": "sms",
   "waba_id": "123456789123",
   "pin": "123456"
}
{
   "country_code": "44",
   "number": "8675309",
   "vname_certificate": "AbCdEFGHiJK123456",
   "method": "sms",
   "waba_id": "123456789123"
}

Respostas
Tipo de conteúdo
application/json

Accepted.

deployment_id
string
exemploaaaaaaaa-bbbb-cccc-dddd-0123456789ab

The Deployment id

waba_id
string

The WhatsApp Business Account (WABA) ID of the WhatsApp number

country_code
string
exemplo44

The international dialing code of the deployment e.g. 44 for the United Kingdom.

number
string
exemplo7700900000

The phone number of the deployment (minus the international dialing code) e.g. 7700900000

api_key
string
exemploabcd1234

The API key associated with the deployment.

current_state
object

The current status of the deployment

title
string
exemploINITIALIZING

The current status of the deployment.

Deve ser uma das seguintes opções:INITIALIZINGCREATING_CLUSTERCLUSTER_CREATEDCODE_SENTWRONG_CODECODE_VERIFIEDFINALIZINGREADYERRORDELETINGDELETED
detail
string
exemploInitializing deployment

Description of the deployment status e.g. Invalid vname certificate

Exemplo Resposta

{
   "deployment_id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
   "waba_id": "string",
   "country_code": "44",
   "number": "7700900000",
   "api_key": "abcd1234",
   "current_state": {
      "title": "INITIALIZING",
      "detail": "Initializing deployment"
   }
}

Get Deployment Status

Retrieves information about the deployment at the given deployment id.

gethttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Respostas
Tipo de conteúdo
application/json

The deployment.

deployment_id
string
exemploaaaaaaaa-bbbb-cccc-dddd-0123456789ab

The Deployment id

waba_id
string

The WhatsApp Business Account (WABA) ID of the WhatsApp number

country_code
string
exemplo44

The international dialing code of the deployment e.g. 44 for the United Kingdom.

number
string
exemplo7700900000

The phone number of the deployment (minus the international dialing code) e.g. 7700900000

api_key
string
exemploabcd1234

The API key associated with the deployment.

current_state
object

The current status of the deployment

title
string
exemploINITIALIZING

The current status of the deployment.

Deve ser uma das seguintes opções:INITIALIZINGCREATING_CLUSTERCLUSTER_CREATEDCODE_SENTWRONG_CODECODE_VERIFIEDFINALIZINGREADYERRORDELETINGDELETED
detail
string
exemploInitializing deployment

Description of the deployment status e.g. Invalid vname certificate

Exemplo Resposta

{
   "deployment_id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
   "waba_id": "string",
   "country_code": "44",
   "number": "7700900000",
   "api_key": "abcd1234",
   "current_state": {
      "title": "INITIALIZING",
      "detail": "Initializing deployment"
   }
}

Delete Deployment

Delete a WhatsApp deployment

deletehttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Respostas

No Content

OTP

Verify or resend a One Time Password (OTP)

Operações disponíveis

Resend OTP

If you do not receive the code in five minutes then you can request for it to be sent again.

posthttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/resend-otp

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Corpo da solicitação
Tipo de conteúdo
application/json

method
string
exemplosms
Deve ser uma das seguintes opções:smsvoice

Exemplo Solicitação

{
   "method": "sms"
}
{}

Respostas
Tipo de conteúdo
application/json

Code sent.

message
string
exemploCode sent
vname
string
exemployour vname
method
string
exemplosms

The method the OTP resend will use.

Exemplo Resposta

{
   "message": "Code sent",
   "vname": "your vname",
   "method": "sms"
}

Verify OTP

When a code is successfully verified, WhatsApp Manager will move the number from a CODE_VERIFIED state to a FINALIZING state where additional checks are made and it is assigned to your API Key. Once this is complete it will enter a READY state and the number is ready to use.

posthttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/verify

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Corpo da solicitação
Tipo de conteúdo
application/json

code
string
exemplo674639

OTP being submitted for verification

Exemplo Solicitação

{
   "code": "674639"
}
{}

Respostas
Tipo de conteúdo
application/json

OK

deployment_id
string
exemploaaaaaaaa-bbbb-cccc-dddd-0123456789ab

the id of your deployment

status
string
exemploDeployment was Created

Exemplo Resposta

{
   "deployment_id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
   "status": "Deployment was Created"
}

Profile

Update WhatsApp profile

Get Profile Info

Gets business profile information

gethttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/profile

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Respostas
Tipo de conteúdo
application/json

OK

about
string
Mín.1
Max139
exemploabout your business

Text to display in your profile's About section - max 139 characters.

address
string
Mín.1
Max256
exemplo123 main street

Your business address - max 256 characters.

description
string
Mín.1
Max256
exemployour business description

a description of your business - max 256 characters

email
string
Mín.1
Max128
exemployou@example.com

Your business' email - max 128 characters

vertical
string
exemploFood and Grocery

Your business' industry - must be recognized by WhatsApp.

Deve ser uma das seguintes opções:AutomotiveBeauty, Spa and SalonClothing and ApparelEducationEntertainmentEvent Planning and ServiceFinance and BankingFood and GroceryPublic ServiceHotel and LodgingMedical and HealthNon-profitProfessional ServicesShopping and RetailTravel and TransportationRestaurantOther
websites
array

Your business' websites maximum of 2 websites, max website length: 256

Exemplo Resposta

{
   "about": "about your business",
   "address": "123 main street",
   "description": "your business description",
   "email": "you@example.com",
   "vertical": "Food and Grocery",
   "websites": [
      "https://example.com"
   ]
}

Update WhatsApp Profile

Updates profile information for deployment.

patchhttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/profile

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Corpo da solicitação
Tipo de conteúdo
application/json

about
string
Mín.1
Max139
exemploabout your business

Text to display in your profile's About section - max 139 characters.

address
string
Mín.1
Max256
exemplo123 main street

Your business address - max 256 characters.

description
string
Mín.1
Max256
exemployour business description

a description of your business - max 256 characters

email
string
Mín.1
Max128
exemployou@example.com

Your business' email - max 128 characters

vertical
string
exemploFood and Grocery

Your business' industry - must be recognized by WhatsApp.

Deve ser uma das seguintes opções:AutomotiveBeauty, Spa and SalonClothing and ApparelEducationEntertainmentEvent Planning and ServiceFinance and BankingFood and GroceryPublic ServiceHotel and LodgingMedical and HealthNon-profitProfessional ServicesShopping and RetailTravel and TransportationRestaurantOther
websites
array

Your business' websites maximum of 2 websites, max website length: 256

Exemplo Solicitação

{
   "about": "about your business",
   "address": "123 main street",
   "description": "your business description",
   "email": "you@example.com",
   "vertical": "Food and Grocery",
   "websites": [
      "https://example.com"
   ]
}
{}

Respostas
Tipo de conteúdo
application/json

OK

about
string
Mín.1
Max139
exemploabout your business

Text to display in your profile's About section - max 139 characters.

address
string
Mín.1
Max256
exemplo123 main street

Your business address - max 256 characters.

description
string
Mín.1
Max256
exemployour business description

a description of your business - max 256 characters

email
string
Mín.1
Max128
exemployou@example.com

Your business' email - max 128 characters

vertical
string
exemploFood and Grocery

Your business' industry - must be recognized by WhatsApp.

Deve ser uma das seguintes opções:AutomotiveBeauty, Spa and SalonClothing and ApparelEducationEntertainmentEvent Planning and ServiceFinance and BankingFood and GroceryPublic ServiceHotel and LodgingMedical and HealthNon-profitProfessional ServicesShopping and RetailTravel and TransportationRestaurantOther
websites
array

Your business' websites maximum of 2 websites, max website length: 256

Exemplo Resposta

{
   "about": "about your business",
   "address": "123 main street",
   "description": "your business description",
   "email": "you@example.com",
   "vertical": "Food and Grocery",
   "websites": [
      "https://example.com"
   ]
}

Get Profile Photo

Gets business profile photo

gethttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/profile/photo

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Respostas
Tipo de conteúdo
application/json

OK.

image_url
string
exemplohttps://www.example.com/img.png

Url where the profile photo was pulled from

Exemplo Resposta

{
   "image_url": "https://www.example.com/img.png"
}

Update Profile Photo

Replaces profile photo with photo at the given URL for the deployment.

posthttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/profile/photo

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Corpo da solicitação
Tipo de conteúdo
application/json

image_url
string
Obrigatório
exemplohttps://www.example.com/img.png

URL pointing to a .png or .jpg. Image must be minimum 192px. max 640px x 640px. max 5MB.

Exemplo Solicitação

{
   "image_url": "https://www.example.com/img.png"
}
{
   "image_url": "https://www.example.com/img.png"
}

Respostas
Tipo de conteúdo
application/json

OK.

image_url
string
exemplohttps://www.example.com/img.png

Url where the profile photo was pulled from

Exemplo Resposta

{
   "image_url": "https://www.example.com/img.png"
}

Stickerpacks

Stickerpack Management

Gets Third-Party Stickerpacks

Gets Third-Party Stickerpacks

gethttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/stickerpacks

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Respostas
Tipo de conteúdo
application/json

Return list of available stickerpacks

stickerpacks
array
id
string
exemplosticker-pack-id1

Exemplo Resposta

{
   "stickerpacks": [
      {
         "id": "sticker-pack-id1"
      }
   ]
}

Creates Third-party Stickerpacks

Creates a Third-Party Sticketpack

posthttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/stickerpacks

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Corpo da solicitação
Tipo de conteúdo
application/json

publisher
string
Obrigatório
exemployour-publisher-name

The name of the publisher of the third-party stickerpack.

name
string
Obrigatório
exemployour-sticker-pack-name

The name of the stickerpack.

ios_app_store_link
string
exemplohttps://itunes.apple.com/app/id3133333

The link to the stickerpack in the Apple iOS App Store. The link follows the format https://itunes.apple.com/app/idXXXXXXXXX. To get your App Store link, refer to the instructions at https://stackoverflow.com/questions/4137426/get-itunes-link-for-app-before-submitting

android_app_store_link
string
exemplohttps://play.google.com/store/apps/details?id=com.example

The link to the stickerpack in the Google Play store. The link follows the format https://play.google.com/store/apps/details?id=com.example where com.example is your app's package name.

Exemplo Solicitação

{
   "publisher": "your-publisher-name",
   "name": "your-sticker-pack-name",
   "ios_app_store_link": "https://itunes.apple.com/app/id3133333",
   "android_app_store_link": "https://play.google.com/store/apps/details?id=com.example"
}
{
   "publisher": "your-publisher-name",
   "name": "your-sticker-pack-name"
}

Respostas
Tipo de conteúdo
application/json

A successful response

stickerpacks
array
id
string
exemplosticker-pack-id1

Exemplo Resposta

{
   "stickerpacks": [
      {
         "id": "sticker-pack-id1"
      }
   ]
}

Gets First-Party Stickerpacks

Gets First-Party (WhatsApp) Stickerpacks

gethttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/stickerpacks?namespace=whatsapp

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

Respostas
Tipo de conteúdo
application/json

Return list of available stickerpacks

stickerpacks
array
id
string
exemplosticker-pack-id1

Exemplo Resposta

{
   "stickerpacks": [
      {
         "id": "sticker-pack-id1"
      }
   ]
}

Gets a specific stickerpack

Gets a specific stickerpack

gethttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/stickerpacks/:stickerpack_id

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

stickerpack_id
string
Obrigatório

The stickerpack ID

Respostas
Tipo de conteúdo
application/json

Return list of available stickerpacks

stickerpacks
array
name
string
exemplosticker-pack-name
publisher
string
exemplosticker-pack-publisher
android_app_store_link
string
exemplohttps://play.google.com/store/apps/details?id=com.example
ios_app_store_link
string
exemplohttps://itunes.apple.com/app/id3133333

Exemplo Resposta

{
   "stickerpacks": [
      {
         "name": "sticker-pack-name",
         "publisher": "sticker-pack-publisher",
         "android_app_store_link": "https://play.google.com/store/apps/details?id=com.example",
         "ios_app_store_link": "https://itunes.apple.com/app/id3133333"
      }
   ]
}

Stickers

Sticker Management

Gets Third-Party Stickers

Retrieve stickers from a stickerpack

gethttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/stickerpacks/:stickerpack_id/stickers

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

stickerpack_id
string
Obrigatório

The stickerpack ID

Respostas
Tipo de conteúdo
application/json

Return list of available stickers

stickers
array
index
string
exemplosticker-index1

Exemplo Resposta

{
   "stickers": [
      {
         "index": "sticker-index1"
      }
   ]
}

Create Third-Party Stickers

Create Third-Party Stickers

posthttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/stickerpacks/:stickerpack_id/stickers

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

stickerpack_id
string
Obrigatório

The stickerpack ID

Corpo da solicitação
Tipo de conteúdo
application/json

image_data_id
string
Obrigatório
exemploid

The ID for the sticker media.

emojis
array
exemplo[ "🐥", "😃" ]

An array of the emojis included in the stickerpack.

Exemplo Solicitação

{
   "image_data_id": "id",
   "emojis": [
      "🐥",
      "😃"
   ]
}
{
   "image_data_id": "id"
}

Respostas
Tipo de conteúdo
application/json

Return an index of the sitcker

stickers
array
index
string
exemplosticker-index1

Exemplo Resposta

{
   "stickers": [
      {
         "index": "sticker-index1"
      }
   ]
}

Gets Third-Party Sticker

Gets Third-Party Sticker

gethttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/stickerpacks/:stickerpack_id/stickers/:sticker_index

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

stickerpack_id
string
Obrigatório

The stickerpack ID

sticker_index
string
Obrigatório

The sticker index

Respostas
Tipo de conteúdo
application/json

Returns a sticker

stickers
array
id
string
exemplosticker-media-id
image_data_id
string
exemplosticker-image-media-id
emojis
array

Exemplo Resposta

{
   "stickers": [
      {
         "id": "sticker-media-id",
         "image_data_id": "sticker-image-media-id",
         "emojis": [
            [
               "🐥",
               "😃"
            ]
         ]
      }
   ]
}

Delete Third-Party Sticker

Delete Third-Party Sticker

deletehttps://api.nexmo.com/v0.1/whatsapp-manager/deployments/:deployment_id/stickerpacks/:stickerpack_id/stickers/:sticker_index

Autenticação

ChaveDescriçãoOndeExemplo
Authorization

Seu token JSON da Web.
Saiba mais sobre os JWTs

Headers

Bearer <JWT>

Caminho Parâmetros

deployment_id
string
Obrigatório

The deployment ID

stickerpack_id
string
Obrigatório

The stickerpack ID

sticker_index
string
Obrigatório

The sticker index

Respostas
Tipo de conteúdo
application/json

Creates a sticker

stickers
array
id
string
exemplosticker-media-id
image_data_id
string
exemplosticker-image-media-id
emojis
array

Exemplo Resposta

{
   "stickers": [
      {
         "id": "sticker-media-id",
         "image_data_id": "sticker-image-media-id",
         "emojis": [
            [
               "🐥",
               "😃"
            ]
         ]
      }
   ]
}

Erros

A seguir, apresentamos uma lista não exaustiva de códigos de erro que podem ocorrer durante o uso desta API.

Esses códigos são adicionais aos que constam em nosso site códigos de erro genéricos.

CódigoInformações
number-in-use

Descrição

Cannot use number because it's already in use by another deployment.

Resolução

Use the existing deployment.

invalid-json

Descrição

The request body did not contain valid JSON

Resolução

Send a JSON request body, including a Content-Type header of application/json

unprocessable

Descrição

Parameters were valid JSON but something was missing or wrongly formatted

Resolução

Fix the incorrect request parameters and try again

unprocessable-profile-update

Descrição

Parameters were valid JSON but something was missing or wrongly formatted

Resolução

Fix the incorrect request parameters and try again

throttled

Descrição

Too many requests have been made on this endpoint

Resolução

Wait a moment and try again

verification-failed

Descrição

Verification step failed. Either because the provided code was incorrect or because too many attempts have been made

Resolução

Try again with the correct OTP, or call resend-otp

conflict-deployment-state

Descrição

Deployment could not be modified because it is currently in a transitional state.

Resolução

If the deployment is transitioning into the state you want it in no action is required. If the state is DELETING, no action is required as the deployment will be deleted. Otherwise, wait for the transition to complete and try again.

conflict-resend-otp

Descrição

Could not resend OTP because the current state of the deployment did not allow it

Resolução

The deployment has either already finished, or is in an error state (in which case you should delete it and run it again).