Actualizar la información sobre la asistencia para darse de baja

Utiliza este punto final para actualizar la información de exclusión voluntaria de RCS mediante la API de Channel Manager.

Ejemplo

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

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

A unique sender identifier for the RCS Agent on the Vonage platform.

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 update-opt-out-information.sh:

curl -X POST https://api.nexmo.com/v1/channel-manager/rcs/opt-out/${CHANNEL_MANAGER_RCS_AGENT_SENDER_ID} \
  -u "${VONAGE_API_KEY}:${VONAGE_API_SECRET}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d $'{
   "actions": [
      {
         "keywords": [
            "STOP"
         ],
         "auto-reply": "You have opted out.",
         "action": "STOP"
      }
   ]
}'

Ver fuente completa

Ejecute su código

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

bash update-opt-out-information.sh