API Documentation Message
Actions
- GET https://thecampuswire.com/organization/org_name/messages.xml – retrieve a list of all messages
- GET https://thecampuswire.com/messages/1.xml – gets an individual message
- POST https://thecampuswire.com/organization/org_name/messages.xml – creates a new message
- PUT https://thecampuswire.com/messages/1.xml – updates a message
- DELETE https://thecampuswire.com/messages/1.xml – deletes a message
GET /organizations/org_name/messages.xml
Here is example of a message list
<messages type="array">
<message>
<call-code type="integer"></call-code>
<campaign-id type="integer"></campaign-id>
<content>All schools are in lockdown due to an emergency situation.</content>
<created-at type="datetime">2007-09-05T01:50:42-05:00</created-at>
<delivered-at type="datetime"></delivered-at>
<id type="integer">171</id>
<organization-id type="integer">129</organization-id>
<phone-picked-up-at type="datetime"></phone-picked-up-at>
<picked-up-at type="datetime"></picked-up-at>
<recorded type="boolean">false</recorded>
<send-call type="boolean">false</send-call>
<send-email type="boolean">true</send-email>
<send-sms type="boolean">false</send-sms>
<title>Lockdown</title>
<updated-at type="datetime">2007-09-05T01:50:42-05:00</updated-at>
<user-id type="integer">149</user-id>
<version type="integer">1</version>
</message>
<message>
<call-code type="integer">78238</call-code>
<campaign-id type="integer"></campaign-id>
<content>Due to snow, all classes are cancelled today.</content>
<created-at type="datetime">2007-09-05T01:49:47-05:00</created-at>
<delivered-at type="datetime"></delivered-at>
<id type="integer">170</id>
<organization-id type="integer">129</organization-id>
<phone-picked-up-at type="datetime"></phone-picked-up-at>
<picked-up-at type="datetime"></picked-up-at>
<recorded type="boolean">false</recorded>
<send-call type="boolean">true</send-call>
<send-email type="boolean">true</send-email>
<send-sms type="boolean">true</send-sms>
<title>Snow Day</title>
<updated-at type="datetime">2007-09-05T01:49:47-05:00</updated-at>
<user-id type="integer">149</user-id>
<version type="integer">1</version>
</message>
</messages>
Note: The message list, and individual messages may be retrieved without authentication. If the user is not authenticated or not an administrator they will not get all of the message detail.
GET /messages/171.xml
<?xml version="1.0" encoding="UTF-8"?> <message> <call-code type="integer"></call-code> <campaign-id type="integer"></campaign-id> <content>All schools are in lockdown due to an emergency situation.</content> <created-at type="datetime">2007-09-05T01:50:42-05:00</created-at> <delivered-at type="datetime"></delivered-at> <id type="integer">171</id> <organization-id type="integer">129</organization-id> <phone-picked-up-at type="datetime"></phone-picked-up-at> <picked-up-at type="datetime"></picked-up-at> <recorded type="boolean">false</recorded> <send-call type="boolean">false</send-call> <send-email type="boolean">true</send-email> <send-sms type="boolean">false</send-sms> <title>Lockdown</title> <updated-at type="datetime">2007-09-05T01:50:42-05:00</updated-at> <user-id type="integer">149</user-id> <version type="integer">1</version> </message>
POST /organizations/org_name/messages.xml (create a new message)
<message><title>test message</title><content>this is a test</content><send-email>true</send-email></message>
Valid attributes
- title (required)
- content (required)
- send-call
- send-email
- send-sms
PUT /messages/171.xml (update an existing message)
<message><title>test message</title><content>this is a test</content></message>
Valid attributes
- title
- content