# 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

{
  "data": {
    "password": "7\\�ce8268d18e3ba8f5ffba3786b95f3f323e6d7f499ce9cb92f0fc9f54eb8e0316",
    "clientid": "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 {api}/auth_username
1
{
  "username": "user_test",
  "password": "password"
}
1
2
3
4

# 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 {api}/auth_username
1
[
  {
    "username": "api_user1",
    "password": "password"
  },
  {
    "username": "api_user2",
    "password": "password"
  }
]
1
2
3
4
5
6
7
8
9
10

# 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 {api}/auth_username/api_user1
1
{
  "password": "password"
}
1
2
3

# 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