Skip to content

Authentication Management API

This API documentation provides various operation information related to managing authentication information on username and client ID, including viewing and creating authentication information, updating authentication passwords, and deleting authentication information.

View Username Authentication Information

URI

GET /auth_username

Request Message

None.

Response Message

NameTypeDescription
codeInteger0
dataArray of ObjectsAll authentication data
data[].usernameStringLogin Username
metaObjectPaging information
meta.pageIntegerPage number
meta.limitIntegerNumber of data items displayed per page
meta.countIntegerTotal number of data

Request Example

bash
curl -u app_id:app_secret -X GET {api}/auth_username

Response Example

JSON
{
  "meta": {
    "page": 1,
    "limit": 10,
    "count": 3
  },
  "data": [
    {
      "username": "api_user2"
    },
    {
      "username": "api_user1"
    },
    {
      "username": "test"
    }
  ],
  "code": 0
}

View Specified User Name Authentication Information

URI

GET /auth_username/{username}

Parameter

NameTypeDescription
usernameStringusername

Request Message

None.

Response Message

NameTypeDescription
codeInteger0
dataArray of ObjectsAll authentication data
data[].usernameStringLogin Username
data[].passwordStringUse sha256 encrypted password

Request Example

bash
curl -u app_id:app_secret -X GET {api}/auth_username/user1

Response Example

JSON
{
    "data": {
        "username": "user1"
    },
    "code": 0
}

Create Username Authentication Information

URI

POST /auth_username

Request Message

NameTypeDescription
usernameStringAuthenticated username
passwordStringAuthenticated password

Response Message

NameTypeDescription
codeInteger0

Request Example

bash
curl -u app_id:app_secret -X POST -d '{"username": "user_test", "password": "password"}' {api}/auth_username
JSON
{
  "code": 0
}

Response Example

JSON
{
"code": 0
}

Batch Create Username Authentication Information

URI

POST /auth_username

Request Message

NameTypeDescription
[].usernameStringAuthenticated username
[].passwordStringAuthenticated password

Response Message

NameTypeDescription
codeInteger0
dataArray of ObjectsCreate result, key means username, value means request result, ok means create successfully

Request Example

bash
curl -u app_id:app_secret -X POST -d '[{"username": "api_user1", "password": "password"},{"username": "api_user2", "password": "password"}]' {api}/auth_username

Response Example

JSON
{
  "data": {
    "api_user1": "ok",
    "api_user2": "ok"
  },
  "code": 0
}

Update Username Authentication Password

URI

PUT /auth_username/{username}

Parameter

NameTypeDescription
usernameStringUpdated username

Request Message

NameTypeDescription
passwordStringAuthentication password

Response Message

NameTypeDescription
codeInteger0

Request Example

bash
curl -u app_id:app_secret -X PUT  -d '{"password": "new_password"}' {api}/auth_username/api_user1

Response Example

JSON
{
  "code": 0
}

Delete Username Authentication Information

URI

DELETE /auth_username/{username}

Parameter

NameTypeDescription
usernameStringDeleted username

Request Message

None.

Response Message

NameTypeDescription
codeInteger0

Request Example

bash
curl -u app_id:app_secret -X DELETE {api}/auth_username/api_user1

Response Example

JSON
{
  "code": 0
}