Ana içeriğe geç

Match Consumer to an Identity Source User

Endpoint​

POST /apiops/projects/{projectName}/consumers/{consumerKey}/actions/sync-match

This is the same step as the match flow on the Consumer screen.

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

Request Body​

{
"sourceType": "ldap",
"sourceName": "corporate-ldap",
"username": "jdoe",
"email": "jdoe@example.com",
"fullName": "John Doe",
"ldapDn": "uid=jdoe,ou=people,dc=example,dc=com"
}
FieldTypeRequiredDescription
sourceTypestringYesldap, database or api
sourceNamestringYesName of the identity source in the project
usernamestringYesUsername of the user in the source. The next synchronization reconciles on this value
emailstringNoEmail address, copied from the matched user
fullNamestringNoDisplay name, copied from the matched user
ldapDnstringNoDistinguished name of the user. LDAP sources only

Response​

200 OK.

The response is a write response. runtimeDeployment.state is IN_SYNC when every environment acknowledged the change, or DEGRADED when the change is stored but at least one environment did not acknowledge it. Do not retry a DEGRADED write; redeploy instead. resourceVersion is not returned.

result is the consumer. From now on the identity source owns the identity fields of the consumer, and Update Consumer refuses the consumer with params.reason = ldapManaged.

Errors​

StatusError keyCause
400malformedRequestsourceType is not ldap, database or api (params.reason = unsupportedSourceType)
400malformedRequestThe synchronization of the source is disabled (params.reason = syncProviderDisabled)
400malformedRequestAnother consumer already holds the username (params.reason = credentialUsernameTaken)
400malformedRequestusername or sourceName is missing
404resourceNotFoundThe source is unknown in the project

cURL Example​

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/consumers/CONSUMER_KEY/actions/sync-match" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "sourceType": "ldap", "sourceName": "corporate-ldap", "username": "jdoe" }'

Permissions​

  • User must have IDENTITY + MANAGE 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)