User unassignment
Admin users can remove (unassign) users from existing application subscriptions. User unassignments can take place through the AppDirect user interface or by calling the AppDirect account API.
The user unassignment event notification allows vendors to receive notice (USER_UNASSIGNMENT) when a user is unassigned (removed) from an existing subscription. In order to allow users to be unassigned from existing subscriptions, Developers must define a user unassignment notification URL, such as http://example.com/unassign?url= eventUrl, on the product's Edit integration page. AppDirect will call this URL when users are unassigned from existing subscriptions. This URL must contain the eventUrl parameter which will be replaced by the URL of the order event at runtime.
The general flow for a user unassignment event notification is as follows:
- An admin user unassigns a user to an application from AppDirect.
- AppDirect creates a uniquely identified USER_UNASSIGNMENT event, which is persisted in the AppDirect-powered marketplace. This event is uniquely identified by an eventUrl, such as https://www.acme-marketplace.com/api/integration/v1/events/d15bb36e-5fb5-11e0-8c3c-00262d2cda03.
- AppDirect calls the configured User Unassignment notification URL, passing the eventUrl as a parameter.
- The vendor must first validate the OAuth-signature in the authorization header.
- The vendor can then get the eventUrl from the URL parameters and issue an OAuth-signed fetch to read information regarding the USER_UNASSIGNMENT event that was triggered.
Vendors can specify the format of the response they receive from AppDirect. They can addAccept: application/json
in their HTTP GET request to receive the response from AppDirect in JSON format. They can addAccept: application/xml
in their HTTP GET request to receive the response from AppDirect in XML format. If vendors do not specify the content type, an XML payload will be returned.
This event contains the following elements:- type: The type of the event (USER_UNASSIGNMENT in this case).
- marketplace: Information about the AppDirect-powered marketplace on which the event took place.
- creator: The identity of the user who triggered the event.
- payload: The event payload, containing the following elements:
- user: The user who is being assigned.
- attributes: An optional list of key/value pairs representing user attributes.
- accountIdentifier: The account identifier provided by the application in the initial Subscription Order.
- The vendor removes the retrieved user from their account system.
- The vendor responds to the original call from AppDirect with the following attributes:
- success: Which should be "true" or "false."
- errorCode: If "success" is false, the response must contain a valid error code, see Event error codes.
- message: An optional message containing information about the result of the operation.
Example USER_UNASSIGNMENT event notification
- JSON
{
"type": "USER_UNASSIGNMENT",
"marketplace": {
"baseUrl": "https://www.acme.com",
"partner": "APPDIRECT"
},
"creator": {
"email": "738a5bd7-7472-3ebb-9754-14520f89eac7",
"firstName": "Another",
"language": "en",
"lastName": "User",
"locale": "en-US",
"openId": "https://www.acme.com/openid/id/a9501ec3-d028-4ad0-a939-607d10c24fe3",
"uuid": "a9501ec3-d028-4ad0-a939-607d10c24fe3"
},
"payload": {
"account": {
"accountIdentifier": "199722",
"status": "ACTIVE"
},
"user": {
"address": {
"city": "San Jose",
"country": "US",
"firstName": "Another",
"fullName": "Another User",
"lastName": "User",
"state": "CA",
"street1": "1 Main St",
"zip": "95131"
},
"email": "738a5bd7-7472-3ebb-9754-14520f89eac7",
"firstName": "Another",
"language": "en",
"lastName": "User",
"locale": "en-US",
"openId": "https://test.appdirect.com/openid/id/a9501ec3-d028-4ad0-a939-607d10c24fe3",
"uuid": "a9501ec3-d028-4ad0-a939-607d10c24fe3"
}
}
}
- XML
<?xml version="1.0" encoding="UTF-8" ?>
<event>
<type>USER_UNASSIGNMENT</type>
<marketplace>
<baseUrl>https://www.acme.com</baseUrl>
<partner>APPDIRECT</partner>
</marketplace>
<creator>
<email>738a5bd7-7472-3ebb-9754-14520f89eac7</email>
<firstName>Another</firstName>
<language>en</language>
<lastName>User</lastName>
<locale>en-US</locale>
<openId>https://www.acme.com/openid/id/a9501ec3-d028-4ad0-a939-607d10c24fe3</openId>
<uuid>a9501ec3-d028-4ad0-a939-607d10c24fe3</uuid>
</creator>
<payload>
<account>
<accountIdentifier>199722</accountIdentifier>
<status>ACTIVE</status>
</account>
<user>
<address>
<city>San Jose</city>
<country>US</country>
<firstName>Another</firstName>
<fullName>Another User</fullName>
<lastName>User</lastName>
<state>CA</state>
<street1>1 Main St</street1>
<zip>95131</zip>
</address>
<email>738a5bd7-7472-3ebb-9754-14520f89eac7</email>
<firstName>Another</firstName>
<language>en</language>
<lastName>User</lastName>
<locale>en-US</locale>
<openId>https://test.appdirect.com/openid/id/a9501ec3-d028-4ad0-a939-607d10c24fe3</openId>
<uuid>a9501ec3-d028-4ad0-a939-607d10c24fe3</uuid>
</user>
</payload>
</event>
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!