Description

Subscribe to an Event Type.

  • More on Event Messages
URL Structure
{Base URL}/subscriptions
HTTP Method POST  
Authentication Required  
Request Headers none
Parameters none  
Request Body
<subscription xmlns="http://ws.byu.edu/namespace/event-hub/v1">
   <eca_identity_id/>         --leave blank
                              -- unless acting as administrator
   <eca_identity_name/>       --leave blank
   <domain/>                  --required
   <entity/>                  --required
   <event_type/>              --required
 </subscription>
<subscription xmlns="http://ws.byu.edu/namespace/event-hub/v1">
   <eca_identity_id/>
   <eca_identity_name/>
   <domain>edu.byu</domain>
   <entity>AIM WaitLising</entity>
   <event_type>Add Class</event_type>
 </subscription>
{
  "subscription": {
    "domain": "edu.byu",
    "entity": "AIM WaitListing",
    "event_type": "Add Class"
  }
}
Returns
<subscription xmlns="http://ws.byu.edu/namespace/event-hub/v1">
   <identity_id/>            --from request or authentication
   <identity_name/>          --retrieved from PRO
   <domain/>                 --from request
   <entity/>                 --from request
   <event_type/>              --from request
</subscription>
<subscription xmlns="http://ws.byu.edu/namespace/event-hub/v1">
   <identity_id>388211692</identity_id>
   <identity_name>HR Benefits System</identity_name>
   <domain>edu.byu</domain>
   <entity>AIM WaitListing</entity>
   <event_type>Add Class</event_type>
</subscription>
{
  "subscription": {
    "identity_id": "388211692",
    "identity_name": "HR Benefits System",
    "domain": "edu.byu",
    "entity": "AIM WaitLising",
    "event_type": "Add Class"
  }
}

Errors

Return Code Additional Explanation
403 Only Event Hub Administrators add Subscriptions for other Entities.
404 Domain is not valid
404 Entity is not valid
409 Domain-Entity-Event Type combination is a duplicate
<fault_message xmlns="http://ws.byu.edu/namespace/event-hub/v1">
  <return_code/>   -- http return code
  <explanation/>   -- see the table above
  <error_data/>    -- from request
</fault_message>
<fault_message xmlns="http://ws.byu.edu/namespace/event-hub/v1">
   <return_code>409</return_code>
   <explanation>
      Domain-Entity-Event Type combination is not valid
   </explanation>
   <error_data>byu.edu-HR-Hire</error_data>
</fault_message>
{
  "fault_message": {
    "return_code": "409",
    "explanation": "Domain-Entity-Event Type combination is a duplicate",
    "error_data": "byu.edu-HR-Hire"
  }
} 
Notes

In order to add a subscription, you must authenticate as:

  • An Event Hub administrator (supply the ECA Identity ID),
  • The ECA itself, or
  • An administrator of the ECA (supply the ECA Identity ID) (future feature).