Refresh User Roles

This API/ web services is specific to campusM Role Sync functionality.

The primary reason to use this API is to trigger a roles update for any user who is already logged in to the App. Once invoked, the next time a user launches the App, or refreshes the web portal in the browser, the App will retrieve their roles in the background, and then sync all role-specific content/ functionality.

Pre-requisites

To utilize the API the following is required:

The hostname corresponds to the region where your campusM instance is hosted. Please refer to this.

Sample Requests

Please note the presence of the legacy “password” field in the sample requests. The value supplied in this field is not validated when making requests with an API Key. This field will be deprecated in a future release.

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:setRolesUpdatedRequest>
         <cam:orgCode>{{orgCode}}</cam:orgCode>
         <cam:password>campusM</cam:password>
         <cam:emails>
            <cam:email>user@mail.com</cam:email>
         </cam:emails>
      </cam:setRolesUpdatedRequest>
   </soapenv:Body>
</soapenv:Envelope>

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:setRolesUpdatedRequest>
         <cam:orgCode>{{orgCode}}</cam:orgCode>
         <cam:password>campusM</cam:password>
         <cam:emails>
            <cam:email>user1@mail.com</cam:email>
            <cam:email>user2@mail.com</cam:email>
         </cam:emails>
      </cam:setRolesUpdatedRequest>
   </soapenv:Body>
</soapenv:Envelope>

ALL users

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cam="http://campusm.gw.com/campusm">
   <soapenv:Header/>
   <soapenv:Body>
      <cam:setRolesUpdatedRequest>
         <cam:orgCode>{{orgCode}}</cam:orgCode>
         <cam:password>campusM</cam:password>
  	 <cam:updateAllUsers>true</cam:updateAllUsers>
      </cam:setRolesUpdatedRequest>
   </soapenv:Body>
</soapenv:Envelope>

Sample Responses

Success

<?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:Envelope>

Failure

<?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>Not authorised.</ns1:desc>
                </ns1:returnStatus>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>