createMessage

Creates a new message from the authenticated token's user to another user - or in direct reply to an existing message.

createMessage Input

createMessage is a secure API method with the following URL and HTTP header requirements:

Submit to URL: https://api.bonanza.com/api_requests/secure_request
Required in HTTP header: X-BONANZLE-API-DEV-NAME set to your dev_id
  X-BONANZLE-API-CERT-NAME set to your cert_id

Note that all secure methods except for fetchToken and getBoothItems require you to submit a user token so that we know what user account you are acting on behalf of.  For details about setting up and submitting user tokens, see our intro to user tokens.

The name for your request should be createMessageRequest.

Here are the available input parameters that can be serialized into JSON:

Argument Type Occurrence Meaning
Call-specific Input Fields
replyTo integer Optional*

If given, the message will be created as a reply to the message id given. Note that the to field is not required if this field is given. If both fields are given, they must agree - the user given must be the user that sent the message being replied to.

to string Optional* Required if replyTo is not given. The user name of the user to send a message to. If replyTo was not given, this message will form a new set of messages (as returned by getMessagesList).
subject string Optional* The subject that will be used for the message. Not required if the message is a reply.
body string Required The body of the message. 

createMessage Output

The name for the output returned from this request is createMessageResponse. So, after parsing the serialized response into JSON, you can access the data with something like:

my_json_hash['createMessageResponse']

Here are all the possible output parameters:

Argument Type Occurrence Meaning
Standard Output Fields
errorMessage Container Conditionally Description of an error or warning that occurred when Bonanza processed the request. Not returned if the ack value is Success.
errorMessage.error Container Conditionally,
repeatable: [0..*]
errorMessage.error.category ErrorCategory Conditionally Currently unused.
errorMessage.error.message string Conditionally A description of the error
errorMessage.error.type ErrorType Conditionally A unique descriptive name for the error.
timestamp dateTime Always This value represents the date and time when Bonanza processed the request. The time zone of this value is GMT and the format is the ISO 8601 date and time format (YYYY-MM-DDTHH:MM:SS.SSSZ). See the "dateTime" type for information about this time format and converting to and from the GMT time zone.
Call-specific Output Fields
message Container Always Contains the newly created message.
message.id integer Always The id of the message. This can be used as an input to getMessages to get all messages in the set of messages that this message belongs to.
message.from string Always The user name of the user that sent the message.
message.to string Always The user name of the user that the message was sent to.
message.senderPictureURL string Always The URL of the sender's profile picture
message.receiverPictureURL string Always The URL of the receiver's profile picture
message.sentAt dateTime Always The date and time at which the message was sent.
message.subject string Always The subject line of the message.
message.body string Always The body of the message. Note that the body may contain HTML.
message.read boolean Always

Whether the message has been read by the receiving user.

message.saved boolean Always Whether the message has been saved by the receiving user.

 

Spinner

You may adjust your notification preferences at any time

Minimum 6 characters; at least one number and one capital letter

If you become a seller on Bonanza, this information will become part of your public profile

New to Bonanza? Sign up to save items, follow sellers and get exclusive coupons.

Don't worry - Bonanza respects your inbox. We send less email and make it easy to opt out. Read our privacy policy »