คู่มือ aWhere
พัฒนาAPIcore-services

บทบาท

บทบาทที่ให้สิทธิ์แก่ผู้ใช้

ค้นหาบทบาท

GET
/api/admin/role

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

พารามิเตอร์ใน Query

keyword?string

Words to look for.

query?string

A filter, as a JSON object.

select?string

The fields to return, as a JSON object of field names to 1 or 0.

skip?integer

How many to skip.

limit?integer

How many to return; 10 when absent.

ค่าเริ่มต้น10
sort?string

The order, as a JSON object of field names to 1 or -1.

Body ของคำตอบ

One page, and how many match.

application/json
  1. response
total?integer
data?array<>
curl -X GET "https://platform.example.com/api/admin/role" \  -H "Authorization: Bearer $TOKEN"
{  "total": 0,  "data": [    {      "_id": "string",      "name": "string",      "administration": null,      "permission": null,      "deletable": true,      "props": null,      "extendedProps": null,      "createdAt": null,      "createdBy": null,      "updatedAt": null,      "updatedBy": null    }  ]}

ค้นหาบทบาท โดยส่งเงื่อนไขใน body

POST
/api/admin/role

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Body ของคำขอ

application/json
  1. body
keyword?string

Words to look for.

query?

A filter, as a JSON object.

select?

The fields to return, as a JSON object of field names to 1 or 0.

skip?integer

How many to skip.

limit?integer

How many to return; 10 when absent.

ค่าเริ่มต้น10
sort?

The order, as a JSON object of field names to 1 or -1.

Body ของคำตอบ

One page, and how many match.

application/json
  1. response
total?integer
data?array<>
curl -X POST "https://platform.example.com/api/admin/role" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "keyword": "string",  "query": {},  "select": {}}'
{  "total": 0,  "data": [    {      "_id": "string",      "name": "string",      "administration": null,      "permission": null,      "deletable": true,      "props": null,      "extendedProps": null,      "createdAt": null,      "createdBy": null,      "updatedAt": null,      "updatedBy": null    }  ]}

สร้างบทบาท

PUT
/api/admin/role

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Body ของคำขอ

application/json
  1. body
name*string
administration?unknown
permission?unknown
deletable?boolean
ค่าเริ่มต้นtrue
props?
extendedProps?

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X PUT "https://platform.example.com/api/admin/role" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "name": "string"}'
"string"

อ่านบทบาทหนึ่งบทบาท

GET
/api/admin/role/{id}

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

พารามิเตอร์ใน Path

id*string

The id of the role.

พารามิเตอร์ใน Query

select?string

The fields to return, as a JSON object of field names to 1 or 0.

Body ของคำตอบ

The record.

application/json
  1. response
_id*string
name*string
administration?unknown
permission?unknown
deletable?boolean
ค่าเริ่มต้นtrue
props?unknown
extendedProps?unknown
createdAt?unknown
createdBy?unknown
updatedAt?unknown
updatedBy?unknown
curl -X GET "https://platform.example.com/api/admin/role/$ID" \  -H "Authorization: Bearer $TOKEN"
{  "_id": "string",  "name": "string",  "administration": null,  "permission": null,  "deletable": true,  "props": null,  "extendedProps": null,  "createdAt": null,  "createdBy": null,  "updatedAt": null,  "updatedBy": null}
POST
/api/admin/role/{id}

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

พารามิเตอร์ใน Path

id*string

The id of the role.

Body ของคำขอ

application/json
  1. body
select?

The fields to return, as a JSON object of field names to 1 or 0.

Body ของคำตอบ

The record.

application/json
  1. response
_id*string
name*string
administration?unknown
permission?unknown
deletable?boolean
ค่าเริ่มต้นtrue
props?unknown
extendedProps?unknown
createdAt?unknown
createdBy?unknown
updatedAt?unknown
updatedBy?unknown
curl -X POST "https://platform.example.com/api/admin/role/$ID" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "select": {}}'
{  "_id": "string",  "name": "string",  "administration": null,  "permission": null,  "deletable": true,  "props": null,  "extendedProps": null,  "createdAt": null,  "createdBy": null,  "updatedAt": null,  "updatedBy": null}

ลบบทบาท

DELETE
/api/admin/role/{id}

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

พารามิเตอร์ใน Path

id*string

The id of the role.

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X DELETE "https://platform.example.com/api/admin/role/$ID" \  -H "Authorization: Bearer $TOKEN"
"string"

แก้บทบาท

PUT
/api/admin/role/{id}

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

พารามิเตอร์ใน Path

id*string

The id of the role.

Body ของคำขอ

application/json
  1. body
name?string
administration?unknown
permission?unknown
deletable?boolean
ค่าเริ่มต้นtrue
props?
extendedProps?

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X PUT "https://platform.example.com/api/admin/role/$ID" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "name": "string",  "administration": "...",  "permission": "..."}'
"string"

กู้คืนบทบาทที่ลบไป

PUT
/api/admin/role/{id}/restore

การยืนยันตัวตน

headerการยืนยันตัวตนBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

พารามิเตอร์ใน Path

id*string

The id of the role.

Body ของคำตอบ

The answer.

response?stringapplication/json

The id.

curl -X PUT "https://platform.example.com/api/admin/role/$ID/restore" \  -H "Authorization: Bearer $TOKEN"
"string"