# Authentication Management

# Check 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

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

# Response Example

{
  "meta": {
    "page": 1,
    "limit": 10,
    "count": 3
  },
  "data": [
    {
      "username": "api_user2"
    },
    {
      "username": "api_user1"
    },
    {
      "username": "test"
    }
  ],
  "code": 0
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# Check the Authentication Information for the specified username

# 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

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

# Response Example

```JSON
{
    "data": {
        "username": "user1"
    },
    "code": 0
}
1
2
3
4
5
6
7

# Create Username Authentication Information

# URI

POST /auth_username

# Request Message

NameTypeDescription
usernameStringAuthenticated username
passwordStringAuthenticated password

# Response Message

NameTypeDescription
codeInteger0

# Request Example

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

# Response Example

{
"code": 0
}
1
2
3

# 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

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

# Response Example

{
  "data": {
    "api_user1": "ok",
    "api_user2": "ok"
  },
  "code": 0
}
1
2
3
4
5
6
7

# Update the Username Authentication Password

# URI

PUT /auth_username/{username}

# Parameter

NameTypeDescription
usernameStringUpdated username

# Request Message

NameTypeDescription
passwordStringAuthentication password

# Response Message

NameTypeDescription
codeInteger0

# Request Example

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

# Response Example

{
  "code": 0
}
1
2
3

# Delete Username Authentication Information

# URI

DELETE /auth_username/{username}

# Parameter

NameTypeDescription
usernameStringDeleted username

# Request Message

None.

# Response Message

NameTypeDescription
codeInteger0

# Request Example

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

# Response Example

{
  "code": 0
}
1
2
3

# Check Client Authentication Information

# URI

GET /auth_clientid

# Request Message

None.

# Response Message

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

# Request Example

curl -u app_id:app_secret -X GET {api}/auth_clientid
1

# Response Example

{
  "meta": {
    "page": 1,
    "limit": 10,
    "count": 3
  },
  "data": [
    {
      "clientid": "api_user2"
    },
    {
      "clientid": "api_user1"
    },
    {
      "clientid": "test"
    }
  ],
  "code": 0
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# Check the Authentication Information for the specified username

# URI

GET /auth_clientid/{clientid}

# Parameter

NameTypeDescription
clientidStringclientid

# Request Message

None.

# Response Message

NameTypeDescription
codeInteger0
dataArray of ObjectsAll authentication data
data[].clientidStringclientid

# Request Example

curl -u app_id:app_secret -X GET {api}/auth_clientid/clientid_1
1

# Response Example

{
  "data": {
     "clientid": "clientid_1"
  },
  "code": 0
}
1
2
3
4
5
6

# Create Client Authentication Information

# URI

POST /auth_clientid

# Request Message

NameTypeDescription
clientidStringAuthenticated clientid
passwordStringAuthenticated password

# Response Message

NameTypeDescription
codeInteger0

# Request Example

curl -u app_id:app_secret -X POST -d '{"clientid": "test", "password": "password"}' {api}/auth_clientid
1

# Response Example

{
"code": 0
}
1
2
3

# Batch Create Client Authentication Information

# URI

POST /auth_clientid

# Request Message

NameTypeDescription
[].clientidStringAuthenticated clientid
[].passwordStringAuthenticated password

# Response Message

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

# Request Example

curl -u app_id:app_secret -X POST -d '[{"clientid": "test1", "password": "password"},{"clientid": "test2", "password": "password"}]' {api}/auth_clientid
1

# Response Example

{
  "data": {
    "test1": "ok",
    "test2": "ok"
  },
  "code": 0
}
1
2
3
4
5
6
7

# Update the Client Authentication Password

# URI

PUT /auth_clientid/{clientid}

# Parameter

NameTypeDescription
clientidStringUpdated clientid

# Request Message

NameTypeDescription
passwordStringAuthentication password

# Response Message

NameTypeDescription
codeInteger0

# Request Example

curl -u app_id:app_secret -X PUT -d '{"password": "new_password"}' {api}/auth_clientid/test1
1

# Response Example

{
  "code": 0
}
1
2
3

# Delete Client Authentication Information

# URI

DELETE /auth_clientid/{clientid}

# Parameter

NameTypeDescription
clientidStringDeleted clientid

# Request Message

None.

# Response Message

NameTypeDescription
codeInteger0

# Request Example

curl -u app_id:app_secret -X DELETE {api}/auth_clientid/test1
1

# Response Example

{
  "code": 0
}
1
2
3