Overview
This article contains documentation for the Message web service, the related API call and error messages.
For more information about all available Web Services and corresponding methods, refer to the Introduction to Web Services article.
Information
sendMessage
(SvMessage message)
The sendMessage method provides the ability to send Field Force Manager messages to one or multiple recipients (workers).
Method Signature
Ordinal |
DataType |
Required |
Description |
---|---|---|---|
message |
SvMessage |
Yes |
The message to be sent. |
Return Result |
SvResult |
Yes |
Any errors in creating and sending the message are presented in the SvResult object. |
Field |
DataType |
Comments |
---|---|---|
subject |
String |
The subject of the message. This is a required field. |
body |
SvDate |
The message body. |
creatorUsername |
String |
The username of the Field Force Manager user who will be the sender of the message. If the creatorUsername field is empty, the message will be sent from the Field Force Manager system. |
recipientUsernames |
String[] |
Names of the intended recipients of the message. |
Error Messages (in the SvResult object)
“The input SvMessage object cannot be null.” – Returned if the input object is null.
“There must be a message subject on the SvMessage object.” – Returned if the message subject is empty.
“The creator with username <username> cannot be null.” – Returned if the username of the sender is not found.
“No recipients with the input usernames could be found.” – Returned if none of the usernames of recipients could be found.
“One or more message recipients could not be found. The message was sent to the other recipients. Missing recipients: <missing recipient list>” – Returned if one or more recipients could not be found by username.
Message Service Error Codes
Error Codes |
Description of Error |
---|---|
1 |
The SvMessage object is empty. |
2 |
The subject string was empty. |
3 |
The message creator does not exist. |
4 |
No recipients were input or none of the recipients that were input exist. |
5 |
One or more of the recipients do not exist. |
6 |
An error occurred when sending the message. The specific error message will be provided in the SvResult message string. |