Skip to main content

Example user event notification flow

An example of a user event notification flow is shown below using user assignment

  1. Admin Alice assigns a seat to user Bob. This creates an event identified by URL https://www.acme-marketplace.com/api/integration/v1/events/12345.
  2. AppDirect calls http://example.com/assign?url=https%3A%2F%2Fwww.acme-marketplace.com%2Fapi%2Fintegration%2Fv1%2Fevents%2F12345.
  3. Example.com issues an event notification to: https://www.acme-marketplace.com/api/integration/v1/events/12345\. If Example.com wants to receive the response from AppDirect in JSON format, they must add Accept: application/json in their HTTP GET request. If they want to receive the response from AppDirect in XML format they must add Accept: application/xml in their HTTP GET request. If they do not specify the content type an XML payload will be returned.
  4. AppDirect returns a user assignment event.
  • JSON
{
"type": "USER_ASSIGNMENT",
"marketplace": {
"baseUrl": "https://www.acme.com",
"partner": "APPDIRECT"
},
"creator": {
"email": "387a2e29-1dec-4ed0-b945-c9b4cf52381c",
"firstName": "Another",
"language": "en",
"lastName": "User",
"locale": "en-US",
"openId": "https://www.acme.com/openid/id/b358dac2-da0c-40f2-a187-f7a34f183163",
"uuid": "b358dac2-da0c-40f2-a187-f7a34f183163"
},
"payload": {
"account": {
"accountIdentifier": "202827",
"status": "ACTIVE"
},
"user": {
"email": "387a2e29-1dec-4ed0-b945-c9b4cf52381c",
"firstName": "Another",
"language": "en",
"lastName": "User",
"locale": "en-US",
"openId": "https://www.acme.com/openid/id/b358dac2-da0c-40f2-a187-f7a34f183163",
"uuid": "b358dac2-da0c-40f2-a187-f7a34f183163"
}
}
}
  • XML
<?xml version="1.0" encoding="UTF-8" ?>
<event>
<type>USER_ASSIGNMENT</type>
<marketplace>
<baseUrl>https://www.acme.com</baseUrl>
<partner>APPDIRECT</partner>
</marketplace>
<creator>
<email>387a2e29-1dec-4ed0-b945-c9b4cf52381c</email>
<firstName>Another</firstName>
<language>en</language>
<lastName>User</lastName>
<locale>en-US</locale>
<openId>https://www.acme.com/openid/id/b358dac2-da0c-40f2-a187-f7a34f183163</openId>
<uuid>b358dac2-da0c-40f2-a187-f7a34f183163</uuid>
</creator>
<payload>
<account>
<accountIdentifier>202827</accountIdentifier>
<status>ACTIVE</status>
</account>
<user>
<email>387a2e29-1dec-4ed0-b945-c9b4cf52381c</email>
<firstName>Another</firstName>
<language>en</language>
<lastName>User</lastName>
<locale>en-US</locale>
<openId>https://www.acme.com/openid/id/b358dac2-da0c-40f2-a187-f7a34f183163</openId>
<uuid>b358dac2-da0c-40f2-a187-f7a34f183163</uuid>
</user>
</payload>
</event>

Example.com creates a new user for Bob in its account system.

Example.com returns an XML response to the original HTTP request.

  • JSON
Status Code: 200 OK
{
"success": "true"
}
  • XML
Status Code: 200 OK
<result>
<success>true</success>
</result>

In the event of an error, Example.com must return a valid error code, see Event error codes.

  • JSON
Status Code: 400 Bad Request
{
"success": "false"
"errorCode": "MAX_USERS_REACHED"
"message": "Optional message about the max users being reached"
}
  • XML
Status Code: 400 Bad Request
<result>
<success>false</success>
<errorCode>MAX_USERS_REACHED</errorCode>
<message>Optional message about the max users being reached</message>
</result>

Was this page helpful?