配置 SMS Gateway REST API 的鑑別
SMS Gateway REST API 控制 SMS 階段作業的建立及刪除。您可以使用瀏覽器或是透過應用程式連接,在下列 URL 存取 REST API 使用者介面:
- 非安全連線:
http://<host-address:unsecured-port>/publicURL/apis/explorer/ - 安全連線:
https://<host-address:secured-port>/publicURL/apis/explorer/
如需額外的安全,您可以為 REST API 配置 HTTP 基本鑑別。一旦配置鑑別,就必須接受鑑別,才能傳送任何 REST API 要求。
利用 HTTP 基本鑑別,您可以將使用者名稱與密碼放在 URL 中傳遞,或是在瀏覽器提示您時輸入。如果要放在 URL 中傳遞,請以下列格式將它們新增至 REST API URL:https://<user:password>@<host address:secure port>/publicURL/apis/explorer/
例如:
https://myRESTAPIuser:Pa55w0rd@123.4.5.67:9443/publicURL/apis/explorer/
-
單租戶環境:在 SMS Gateway 配置中,指定
CTRL_TENANT_USERNAME和CTRL_TENANT_PASSWORD環境變數。例如,在 Docker 上:
- CTRL_TENANT_USERNAME=myRESTAPIuser - CTRL_TENANT_PASSWORD=Pa55w0rd - 多租戶 JSON 配置:在您的租戶配置 JSON 檔中,配置一個具有
username和password內容的controlCredentials物件。"tenants": [ { "tenantPhoneNumber": "+12345556789", "description": "Number for accessing account information", ... "controlCredentials": { "username": "myRESTAPIuser", "password": "Pa55w0rd" } ... } ]