Skip to content

oauth.authorize ​

This interface is implemented on the platform application (APP) server side and called by the SUD OpenPaaS server.

Obtain the authorization code. Valid for 5 minutes, single use only; once invalid, authorization must be re-initiated.

Call method:

  • HTTPS call

HTTPS Call ​

http
GET {authorize_webhook}

Request Parameters - Query ​

FieldTypeDefaultRequiredDescription
client_idstringYesApplication ID assigned by the platform to SUD
redirect_uristringYesCallback SUD address after successful authorization; domain/path/port must match exactly (case-sensitive), no query parameters allowed
response_typestringYesFixed value: code
statestringNoAnti-replay, random string

Return Value ​

Object ​

The returned JSON data packet

Note: The code and state of this interface are located directly at the top level of the response, not wrapped in data, which differs from the response structure of other interfaces.

FieldTypeDescription
ret_codeintegerError code: 0 means success, non-0 means failure
ret_msgstringError message: returns "success" on success, returns the specific error reason on failure
codestringAuthorization code (returned only on success)
statestringReturns the state from the request as-is

Valid Values of ret_code ​

ValueDescriptionMinimum Version
0Request succeeded
40001invalid client_id, check whether client_id is correct
40002invalid redirect_uri, check whether the callback address matches the backend configuration
40003invalid response_type, confirm this field has the fixed value code

cURL Request ​

bash
curl -X GET \
  '{authorize_webhook}?client_id=YOUR_CLIENT_ID&redirect_uri=https://your.domain.com/callback&response_type=code&state=RANDOM_STATE_STRING'

Success Response ​

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "code": "AUTHORIZATION_CODE",
  "state": "RANDOM_STATE_STRING"
}

Error Response ​

json
{
  "ret_code": 40001,
  "ret_msg": "invalid client_id"
}