Add Poll
This API service provides the ability to securely create new Quick Poll.
Resource URL
POST /campusm/v1/addons/addPoll
URL Parameters
None
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
Parameter | Type | Required | Description |
apiKey | xsd:string | Required | Supplied by Ex Libris as part of the implementation |
Body Parameters
Parameter | Type | Required | Description |
orgCode | xsd:int | Required | Supplied by Ex Libris as part of the implementation |
roleDistribution | xsd:string | Required | Comma-separated list of profiles and roles in the structure of [profile name]::[role name] |
question | xsd:string | Required | Question of the poll |
pollAnswer | pollAnswer | Required | 1 – 5 repetitions of PollAnswer object (see below) |
startTime | xsd:dateTime | Required | Start time (in UTC) of the created Poll. The time must be in the future and in the format of “yyyy-MM-ddTHH:mm:ss” |
endTime | xsd:dateTime | Required | End time (in UTC) of the created poll. Must be later than the startTime value and in the format of “yyyy-MM-ddTHH:mm:ss” |
notification | xsd:int | Required | 0 or 1 value to decide if to send notifications. The default value is 0 |
notificationTitle | xsd:string | Optional | If the notification value is 1 this would be the notification title |
notificationBody | xsd:string | Optional | If the notification value is 1 this would be the notification body |
Poll Answer
Parameter | Type | Required | Description |
answer | xsd:string | Required | Answer option for the Poll question |
response | xsd:string | Optional | Response to be shown after choosing this answer. If this field is empty, the default response from App Manager would be shown. The value of this field can be only plain text in one single row – no break lines or HTML tags etc. |
role | xsd:string | Optional | A comma-separated list of profiles and roles that would be added to users who choose this answer in the structure of [profile name]::[role name] |
Enter the parameters as a raw text in the body of the request such as the following text and fill in the fields with actual data:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cam="http://campusm.gw.com/campusm"> <soapenv:Header/> <soapenv:Body> <cam:addPollRequest> <cam:orgCode>123456789</cam:orgCode> <cam:roleDistribution></cam:roleDistribution> <cam:question></cam:question> <!--1 to 5 repetitions:--> <cam:pollAnswer> <cam:answer></cam:answer> <!--Optional:--> <cam:response></cam:response> <!--Optional:--> <cam:role></cam:role> </cam:pollAnswer> <cam:startTime>2020-07-11T00:00:00</cam:startTime> <cam:endTime>2020-07-15T00:00:00</cam:endTime> <cam:Notification>0</cam:Notification> <!--Optional:--> <cam:NotificationTitle></cam:NotificationTitle> <!--Optional:--> <cam:NotificationBody>Notification Body</cam:NotificationBody> </cam:addPollRequest> </soapenv:Body> </soapenv:Envelope>
Example
URL –
https://api-eu.hosted.exlibrisgroup.com/campusm/v1/addons/addPoll?apiKey=<API KEY>
Output
This service returns a returnStatus object..
Description:
Field | Type | Description |
type | xsd:String | “S” for success, “Failure” for failure and “E” for unexpected error |
desc | xsd:string | “Success” for success, failure reason in case of failure and the error message in case of unexpected error |
timestamp | xsd:dateTime | Time stamp of the creation time |
Sample Response
XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:addPollResponse xmlns:ns1="http://campusm.gw.com/campusm"> <ns1:type>S</ns1:type> <ns1:desc>Success</ns1:desc> <ns1:timestamp>2020-10-19T14:43:58.632+00:00</ns1:timestamp> </ns1:addPollResponse> </soapenv:Body>