Send Alerts / Push Notifications

campusM allows institutions to send alerts to their users. These are delivered as push notifications for the native iOS/Android apps and in app alerts on web app/ portal.

Pre-requisites

To utilise the API, you will require the following:

The hostname corresponds to the region where your campusM instance is hosted. For getting started using API keys, your org code and calling your campusM regional API hostname, please refer to this.

Query string Parameters

FieldTypeDescription
orgCodexsd:intMandatory – Supplied by Ex Libris as part of the implementation
apiKeyxsd:stringMandatory – Supplied by Ex Libris as part of the implementation

Body Parameters

FieldTypeDescription
orgCodexsd:intMandatory – Supplied by Ex Libris as part of the implementation

Sample Requests

Individual user

NOTE: The email address of the user is the identifier of that user within campusMThe email address within campusM is the one retrieved when the user logs in to the App. This is one of the user attributes retrieved from the institution’s authentication system.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cam="http://campusm.gw.com/campusm">
   <soapenv:Header/>
   <soapenv:Body>
      <cam:sendAlertsRequest>  
         <cam:orgCode>{{orgCode}}</cam:orgCode>
         <cam:notifications>
            <!-- One or more messages to send -->
            <cam:notification>
               <cam:notificationTargets>
                  <!-- One or more recipients per message -->
                  <cam:notificationTarget>
                     <cam:emailAddress>user1@mail.com</cam:emailAddress>
                  </cam:notificationTarget>
               </cam:notificationTargets>
               <cam:note>Individual test notification</cam:note>
               <cam:message>This is a individual test notification. Please ignore</cam:message>
            </cam:notification>
         </cam:notifications>
      </cam:sendAlertsRequest>
   </soapenv:Body>

 

More than one user

This example is similar to the one above, but is intended to visually demonstrate the XML structure if you were to send an alert to more than one user.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cam="http://campusm.gw.com/campusm">
   <soapenv:Header/>
   <soapenv:Body>
      <cam:sendAlertsRequest>  
         <cam:orgCode>{{orgCode}}</cam:orgCode>
         <cam:notifications>
            <!-- One or more messages to send -->
            <cam:notification>
               <cam:notificationTargets>
                  <!-- One or more recipients per message -->
                  <cam:notificationTarget>
                     <cam:emailAddress>user1@mail.com</cam:emailAddress>
                  </cam:notificationTarget>
                  <cam:notificationTarget>
                     <cam:emailAddress>user2@mail.com</cam:emailAddress>
                  </cam:notificationTarget>
               </cam:notificationTargets>
               <cam:note>Multiple user test notification</cam:note>
               <cam:message>This is a individual test notification. Please ignore</cam:message>
            </cam:notification>
         </cam:notifications>
      </cam:sendAlertsRequest>
   </soapenv:Body>

 

Alert group

This is used to send an alert to all members of an alert group. The group code is obtained as follows:

  1. Log in to App Manager (for more info on App manager, refer here)
  2. Go to Notifications → Alert Groups
  3. Click on an Alert group
  4. Once the alert group view loads, the group code is a number and will be within the browser page URL, where it says “group_code_here”, e.g. https://{region}.appmanager.campusm.com/notifications/CampusM/alertgroup/group_code_here/
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cam="http://campusm.gw.com/campusm">
   <soapenv:Header />
   <soapenv:Body>
      <cam:sendAlertsRequest>
         <cam:orgCode>{{orgCode}}</cam:orgCode>
         <cam:notifications>
            <!-- One or more messages to send -->
            <cam:notification>
               <cam:notificationTargets>
                  <cam:notificationTarget>
                     <!-- One or more group codes per message -->
                     <cam:groupCode>group_code_here</cam:groupCode>
                  </cam:notificationTarget>
               </cam:notificationTargets>
               <cam:note>Group test notification</cam:note>
               <cam:message>This is a group test notification. Please ignore</cam:message>
            </cam:notification>
         </cam:notifications>
      </cam:sendAlertsRequest>
   </soapenv:Body>
</soapenv:Envelope>

 

With HTML Body (CDATA Tags)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cam="http://campusm.gw.com/campusm">
   <soapenv:Header/>
   <soapenv:Body>
      <cam:sendAlertsRequest>  
         <cam:orgCode>{{orgCode}}</cam:orgCode>
         <cam:notifications>
            <!-- One or more messages to send -->
            <cam:notification>
               <cam:notificationTargets>
                  <!-- One or more recipients per message -->
                  <cam:notificationTarget>
                     <cam:emailAddress>user1@mail.com</cam:emailAddress>
                  </cam:notificationTarget>
               </cam:notificationTargets>
               <cam:note>Individual test notification</cam:note>
               <cam:message><![CDATA[
<!DOCTYPE html>
<html>
<body>
<h1>campusM notification</h1>
<p>This is a test notification with a HTML body. Please ignore</p>
</body>
</html>
    ]]>
        </cam:message>
            </cam:notification>
         </cam:notifications>
      </cam:sendAlertsRequest>
   </soapenv:Body>

 

Personalised Alerts

The following three parameters in the body of the message provide the ability to substitute personalised text into the notifications:

 

Parameter
Description
Anonymous User Text
{FIRSTNAME}Users First NameUser
{LASTNAME}Users Last NameName
{EMAIL}Users Email Address

NOTE: If you send a message to ALL users of the app, which includes a profile that has anonymous users, then they will receive the substitutions shown in the 3rd column in the table above.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cam="http://campusm.gw.com/campusm">
  <soapenv:Header/>
  <soapenv:Body>
     <cam:sendAlertsRequest>  
        <cam:orgCode>{{orgCode}}</cam:orgCode>
        <cam:notifications>
           <!-- One or more messages to send -->
           <cam:notification>
              <cam:notificationTargets>
                 <!-- One or more recipients per message -->
                 <cam:notificationTarget>
                    <cam:emailAddress>user1@mail.com</cam:emailAddress>
                 </cam:notificationTarget>
              </cam:notificationTargets>
              <cam:note>Individual test notification</cam:note>
              <cam:message>Hi {FIRSTNAME} {LASTNAME} @ {EMAIL}, This is a individual test notification. Please ignore</cam:message>
           </cam:notification>
        </cam:notifications>
     </cam:sendAlertsRequest>
  </soapenv:Body>

 

Pre-scheduled Alerts

Adding the optional sendAt parameter enables an institution to set up queued/ timed alerts.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cam="http://campusm.gw.com/campusm">
   <soapenv:Header/>
   <soapenv:Body>
      <cam:sendAlertsRequest>  
         <cam:orgCode>{{orgCode}}</cam:orgCode>
         <cam:notifications>
            <!-- One or more messages to send -->
            <cam:notification>
               <cam:notificationTargets>
                  <!-- One or more recipients per message -->
                  <cam:notificationTarget>
                     <cam:emailAddress>user1@mail.com</cam:emailAddress>
                  </cam:notificationTarget>
               </cam:notificationTargets>
               <cam:note>Timed test notification</cam:note>
               <cam:message>This is a test notification. Please ignore</cam:message>
               <cam:sendAt>2019-01-21T15:55:00+00:00</cam:sendAt>
            </cam:notification>
         </cam:notifications>
      </cam:sendAlertsRequest>
   </soapenv:Body>

 

After a successful roles Send Alerts / Push Notifications request via API, it is possible for app administrators (May 2019 release) to track the communications via the app manager available campusM Notification Center.

Sample Response

Success

Successful response, 200 OK

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <ns1:returnStatus xmlns:ns1="http://campusm.gw.com/campusm">
            <ns1:type>S</ns1:type>
            <ns1:desc>Successful</ns1:desc>
        </ns1:returnStatus>
    </soapenv:Body>
</soapenv:Envelop

 

Failure

Invalid credentials supplied – 500 Internal Server Error

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Server</faultcode>
            <faultstring>ReturnStatusMsg</faultstring>
            <detail>
                <ns1:returnStatus xmlns:ns1="http://campusm.gw.com/campusm">
                    <ns1:type>E</ns1:type>
                    <ns1:desc>Invalid organisation/password</ns1:desc>
                </ns1:returnStatus>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>