Zarządzanie testerami

Wszyscy agenci należą do marki (firmy, organizacji lub grupy). Zanim utworzysz agenta, musisz najpierw utworzyć markę. Marki mają charakter wyłącznie organizacyjny i pomagają grupować powiązanych agentów.

Dodawanie testera do agenta

cURL

curl -v -X POST "https://businesscommunications.googleapis.com/v1/testers" \
  -H "Content-Type: application/json" \
  -H "User-Agent: curl/business-messaging" \
  -H "`oauth2l header --json rbm-developer-service-account-credentials.json businesscommunications`" \
  -d "{
    'agentId': '$AGENT_ID',
    'phoneNumber': '$MSISDN'
  }"
Ten kod to fragment naszego przykładowego kodu interfejsu RBM Management API.

Python

endpoint_url = (BASE_ENDPOINT + 'testers')

body = {
  "agentId": agentId,
  "phoneNumber": msisdn
}

response = authed_session.post(endpoint_url, data=json.dumps(body))
Ten kod to fragment naszego przykładowego kodu interfejsu RBM Management API.

Wyświetlanie listy testerów agenta

cURL

curl -v -X GET "https://businesscommunications.googleapis.com/v1/testers?agentId=$AGENT_ID" \
  -H "User-Agent: curl/business-messaging" \
  -H "`oauth2l header --json rbm-developer-service-account-credentials.json businesscommunications`"
Ten kod to fragment naszego przykładowego kodu interfejsu RBM Management API.

Python

endpoint_url = (BASE_ENDPOINT +
  'testers?' +
  'agentId=' + agentId)

response = authed_session.get(endpoint_url)
Ten kod to fragment naszego przykładowego kodu interfejsu RBM Management API.

Pobieranie stanu testera

cURL

curl -v -X GET "https://businesscommunications.googleapis.com/v1/$TESTER_ID?agentId=$AGENT_ID" \
  -H "User-Agent: curl/business-messaging" \
  -H "`oauth2l header --json rbm-developer-service-account-credentials.json businesscommunications`"
Ten kod to fragment naszego przykładowego kodu interfejsu RBM Management API.

Python

endpoint_url = (BASE_ENDPOINT +
  testerId +
  '?agentId=' + agentId)

response = authed_session.get(endpoint_url)
Ten kod to fragment naszego przykładowego kodu interfejsu RBM Management API.

Usuwanie testera

cURL

curl -v -X DELETE "https://businesscommunications.googleapis.com/v1/$TESTER_ID?agentId=$AGENT_ID" \
  -H "User-Agent: curl/business-messaging" \
  -H "`oauth2l header --json rbm-developer-service-account-credentials.json businesscommunications`"
Ten kod to fragment naszego przykładowego kodu interfejsu RBM Management API.

Python

endpoint_url = (BASE_ENDPOINT +
  testerId +
  '?agentId=' + agentId)

response = authed_session.delete(endpoint_url)
Ten kod to fragment naszego przykładowego kodu interfejsu RBM Management API.