Añadir dispositivos de prueba al Agente

Utilice este endpoint para añadir dispositivos de prueba al Agente utilizando la API de Channel Manager. Añade un dispositivo de prueba a un Agente RCS existente.

Ejemplo

A continuación encontrará la descripción de todas las variables utilizadas en cada fragmento de código:

ClaveDescripción
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_TEST_DEVICE_NUMBER

The phone number to add to the RCS Agent in E.164 format.

Requisitos previos

Si no tiene una solicitud, puede crear uno. Asegúrese también de configure sus webhooks.

Escriba el código

Añada lo siguiente a add-test-devices-to-agent.sh:

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

Ver fuente completa

Ejecute su código

Guarde este archivo en su máquina y ejecútelo:

bash add-test-devices-to-agent.sh