Get Consumer
Endpoint
GET /apiops/projects/{projectName}/consumers/{consumerKey}
Authentication
Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| consumerKey | string | Yes | Consumer key, assigned by the installation. Returned as consumerKey by every consumer response |
Response
200 OK with the consumer. An unknown consumerKey answers 404 resourceNotFound.
| Field | Type | Description |
|---|---|---|
| consumerKey | string | Immutable key of the consumer, assigned by the installation |
| username | string | Username of the consumer. Immutable |
| fullName | string | Display name |
| string | Email address | |
| description | string | Description |
| enabled | boolean | Whether the consumer is enabled |
| organizationCode | string | Code of the organization of the consumer. Absent when the consumer belongs to none |
| expireDate | timestamp | Expiry of the consumer. Absent when the consumer does not expire |
| trafficLogDisabled | boolean | true when the traffic of the consumer is not written to the traffic-log connectors. Absent when never set |
| ipList | array of string | Allowed IP addresses, as PUT /consumers/{consumerKey} writes them |
| roleNames | array of string | Names of the roles of the consumer. These are the names roleNameList accepts |
| metadata | array | Metadata entries. A secret entry carries its key and flags but no value |
No password, secret or token setting is ever returned. Read the token settings with Get Consumer Token Settings and the secret material references with Get Consumer Secret References.
Warning
A secret metadata entry comes without its value. If you send the list back on Update Consumer, the server stores that entry empty. Send the value again to keep it.
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/consumers/CONSUMER_KEY" \
-H "Authorization: Bearer YOUR_TOKEN"
Permissions
- User must have
IDENTITY+VIEWpermission in the project - A project outside the scope of the caller answers
404 resourceNotFound, never403 - The admin project has no consumers: a call on it answers
400 malformedRequest(params.reason=platformScopeNotSupported)