Messages are sent from worker to dispatcher and vice versa. You can add, edit or delete messages using this API. Messages exist within a message thread.
Here are the fields you can use when making a message request:
| Name | Type | Description |
|---|---|---|
| body | String | Message content |
| from_user_id | Boolean | User ID that posts this message |
| from_user_name | Boolean | User name of message creator. If from_user_id is blank then this can be any value you like, but will be mandatory. |
When retrieving a message from vWork, you may also see these additional fields in the response:
| Name | Type | Description |
|---|---|---|
| message | Object | Message record |
| id | Integer | Unique ID of message |
| thread_id | String | Messages Thread ID |
| read_by_user_ids | String | Comma-separated list of ids of users that have read this message. |
| received_by_user_ids | String | Comma-separated list of ids of users that have received this message. |
| created_at | DateTime | Time thread was created. |
| updated_at | DateTime | Time thread was last updated. |
Creates a new message for an existing thread in vWork.
Security
apiKey
POST
curl -i -X POST \
'https://api.vworkapp.com/v5/messaging/{thread_id}/messages.xml?api_key=string&api_key=YOUR_API_KEY_HERE' \
-H 'Accept-Encoding: gzip' \
-H 'Content-Type: application/xml; charset=utf-8' \
-d '<?xml version="1.0" encoding="utf-8"?>
<message>
<body>This is a new message</body>
<from_user_id>3</from_user_id>
</message>'Created
Headers
Example:"frame-ancestors *.vworkapp.com *.vwork.io *.visfleet.com *.salesforce.com *.zoho.com, default-src: google.com google-analytics.com googleapis.com gst
Example:"https://api.vworkapp.com/api/v4/messaging/acfe5d7a-1188-11e6-9d29-595cf99ba95b/messages/3c27e588-31d3-11e6-927a-37a1480f7e3a.xml"
string
Raw XML payload — see the example.
Response
<?xml version="1.0" encoding="utf-8"?>
<message>
<id>23275dfc-086d-11e4-a5ac-174e8ef2ef84</id>
<thread_id>23268152-086d-11e4-a5ac-174e8ef2ef84</thread_id>
<from_user_id>3</from_user_id>
<from_user_name>Joe Bloggs</from_user_name>
<read_by_user_ids>3</read_by_user_ids>
<received_by_user_ids/>
<body>This is a new message</body>
<created_at>2014-07-10 20:02:36 UTC</created_at>
<updated_at>2014-07-11 08:02:36 +1200</updated_at>
</message>