Adicionar operadoras ao agente

Use este endpoint para adicionar operadoras a um agente por meio da API do Channel Manager. Ele adiciona operadoras a um agente RCS já existente.

Exemplo

Veja a seguir a descrição de todas as variáveis utilizadas em cada trecho de código:

ChaveDescrição
CHANNEL_MANAGER_RCS_AGENT_ID

The ID of the RCS agent.

VONAGE_API_KEY

Your Vonage API key (see it on your dashboard).

VONAGE_API_SECRET

Your Vonage API secret (also available on your dashboard).

CHANNEL_MANAGER_RCS_AGENT_CARRIER_ID

The ID of the carrier to be added.

Pré-requisitos

Se você não tiver um aplicativo, acesse criar um. Certifique-se também de acessar configure seus webhooks.

Escreva o código

Adicione o seguinte ao arquivo ` add-carriers-to-agent.sh`:

curl -X POST https://api.nexmo.com/v1/channel-manager/rcs/agents/${CHANNEL_MANAGER_RCS_AGENT_ID}/carriers \
  -u "${VONAGE_API_KEY}:${VONAGE_API_SECRET}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d $'{
     "carriers": [
        "'${CHANNEL_MANAGER_RCS_AGENT_CARRIER_ID}'"
    ]
  }'

Ver código-fonte completo

Execute seu código

Salve este arquivo no seu computador e execute-o:

bash add-carriers-to-agent.sh