Ana içeriğe geç

Get Consumer

Endpoint​

GET /apiops/projects/{projectName}/consumers/{consumerKey}

Authentication​

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request​

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name
consumerKeystringYesConsumer key, assigned by the installation. Returned as consumerKey by every consumer response

Response​

200 OK with the consumer. An unknown consumerKey answers 404 resourceNotFound.

FieldTypeDescription
consumerKeystringImmutable key of the consumer, assigned by the installation
usernamestringUsername of the consumer. Immutable
fullNamestringDisplay name
emailstringEmail address
descriptionstringDescription
enabledbooleanWhether the consumer is enabled
organizationCodestringCode of the organization of the consumer. Absent when the consumer belongs to none
expireDatetimestampExpiry of the consumer. Absent when the consumer does not expire
trafficLogDisabledbooleantrue when the traffic of the consumer is not written to the traffic-log connectors. Absent when never set
ipListarray of stringAllowed IP addresses, as PUT /consumers/{consumerKey} writes them
roleNamesarray of stringNames of the roles of the consumer. These are the names roleNameList accepts
metadataarrayMetadata 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 + VIEW permission in the project
  • A project outside the scope of the caller answers 404 resourceNotFound, never 403
  • The admin project has no consumers: a call on it answers 400 malformedRequest (params.reason = platformScopeNotSupported)