Zarządzanie testerami

Przed uruchomieniem agent może komunikować się tylko z wyznaczonymi urządzeniami testowymi. Dodanie testerów pozwala wewnętrznie sprawdzić działanie agenta, aby zapobiec przypadkowemu wczesnemu dostępowi użytkowników.

Za pomocą interfejsu RBM Management API możesz dodawać testerów, wyświetlać listę urządzeń testowych, pobierać stan zaproszenia i usuwać testerów, gdy nie są już potrzebni.

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.