POST
/otp/send
application/json
POST /otp/send HTTP/1.1Content-Type: application/jsonAuthorization: Basic VEVOQU5UX0NMSUVOVF9JRDpURU5BTlRfQ0xJRU5UX1NFQ1JFVA==Host: sample.portal.tencentciam.com{"usage" : "login","phone_number" : "13612345678","auth_source_id" : "MOCK_SMS_OTP_AUTH_SOURCE_ID"}
POST /otp/send HTTP/1.1Content-Type: application/jsonAuthorization: Basic Q0xJRU5UXzRfSUQ6Q0xJRU5UXzRfU0VDUkVUHost: sample.portal.tencentciam.com{"usage" : "login","email" : "MOCK_USERNAME@example.com","auth_source_id" : "MOCK_EMAIL_OTP_AUTH_SOURCE_ID"}
POST /otp/send HTTP/1.1Content-Type: application/jsonAuthorization: Basic Q0xJRU5UXzRfSUQ6Q0xJRU5UXzRfU0VDUkVUHost: sample.portal.tencentciam.com{"usage" : "signup","phone_number" : "13612345678"}
POST /otp/send HTTP/1.1Content-Type: application/jsonAuthorization: Basic Q0xJRU5UXzRfSUQ6Q0xJRU5UXzRfU0VDUkVUHost: sample.portal.tencentciam.com{"usage" : "signup","email" : "MOCK_USERNAME@example.com"}
POST /otp/send HTTP/1.1Content-Type: application/jsonAuthorization: Basic Q0xJRU5UXzRfSUQ6Q0xJRU5UXzRfU0VDUkVUHost: sample.portal.tencentciam.com{"usage" : "update_userinfo","phone_number" : "13612345678"}
POST /otp/send HTTP/1.1Content-Type: application/jsonAuthorization: Basic Q0xJRU5UXzRfSUQ6Q0xJRU5UXzRfU0VDUkVUHost: sample.portal.tencentciam.com{"usage" : "reset_password","email" : "MOCK_USERNAME@example.com"}
Term | Description |
Authorization | The HTTP Basic authentication request header has the format Basic <credentials>. Here, Basic is a fixed string, and <credentials> is calculated as base64(url_encode(client_id) + ":" + url_encode(client_secret)). A single space separates Basic and <credentials>. |
JSON Path | Data Type | Description |
usage | String | Scenarios for OTP verification code usage. In the SMS and email OTP login scenario, enter login.In the user registration scenario, enter signup.In the update user information scenario, enter update_userinfo.In the reset user password scenario, enter reset_password.If no input parameters are provided, the login scenario is represented by default. |
phone_number | String | The user's mobile phone number must be an 11-digit number from one of the three major domestic carriers. Pass this parameter when an SMS OTP verification code is sent. |
email | String | The user's email address. Pass this parameter when an email OTP verification code is sent. |
auth_source_id | String | The SMS OTP or email OTP authentication source ID. You can view it on the General Authentication Sources list page in the console. Pass this parameter in SMS and email OTP login scenarios, and the system will use the verification code length and validity period configured for the authentication source. In other scenarios, do not pass this parameter. The system then uses a 6-digit numeric verification code by default, with a validity period of 60 seconds. |
HTTP/1.1 200 OKContent-Type: application/json{"otp_token" : "MOCK_OTP_TOKEN"}
Field | Data Type | Description |
otp_token | String | The OTP token is used for subsequent OTP verification. Its validity period is 5 minutes. |
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "malformed_phone_number"}
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "malformed_email"}
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "insufficient_sms_quota"}
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "insufficient_email_quota"}
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "invalid_email"}
HTTP/1.1 503 Service UnavailableContent-Type: application/json;charset=UTF-8{"error" : "temporarily_unavailable","error_description" : "Failed to send OTP. Please try again later."}
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error": "email_is_used"}
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error": "phone_number_is_used"}
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "sms_rate_limit_exceeded","error_description" : "SMS rate limit exceeded for same phone number"}
피드백