Ana içeriğe geç

List Consumer Roles

Endpoint​

GET /apiops/projects/{projectName}/consumer-roles

Authentication​

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request​

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name

Query Parameters​

ParameterTypeRequiredDescription
searchstringNoCase-insensitive contains-match on the name
pageintegerNoZero-based page index. Default 0
sizeintegerNoRows per page. Default 20, capped at 200
sortstringNoname,asc or name,desc. Default name,asc

Response​

200 OK with the paged envelope. Each item is a role:

FieldTypeDescription
namestringName of the role
oauthScopestringOAuth scope name that the role answers to. Absent when the role has none

cURL Example​

curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/consumer-roles?search=admin" \
-H "Authorization: Bearer YOUR_TOKEN"

Permissions​

  • User must have IDENTITY + VIEW permission in the project
  • A project outside the scope of the caller answers 404 resourceNotFound, never 403
  • The admin project is served: a call on /apiops/projects/admin/consumer-roles addresses the roles of the admin project