Skip to main content
Version: SDK-5.11.4

SendMessage

public BackendReturnObject SendMessage(string gamerIndate, string contents);

Parameters

ValueTypeDescription
gamerIndateStringindate of the gamer to receive the message
contentsstringMessage content

Description

Sends a message to the user of the corresponding gamerIndate.
There is a limit to the character length of the message content(set in the Console).

There is a limit to the number of sent and received messages kept in the list(set in BACKND Console > Social Management > Settings > Messages).
The message function does not work without a gamer nickname.

Example

Synchronous

Backend.Message.SendMessage("2020-02-11T01:08:12.603Z", "Have a good day today");

Asynchronous

Backend.Message.SendMessage("2020-02-11T01:08:12.603Z", "Have a good day today", (callback) => {
// Post-process
});

SendQueue

SendQueue.Enqueue(Backend.Message.SendMessage, "2020-02-11T01:08:12.603Z", 
"Have a good day today", (callback) => {
// Post-process
});

Return cases

Success cases

When sent successfully
statusCode : 204
message : Success

Error cases

When the sender and recipient are the same
statusCode : 400
errorCode : BadParameterException
message : bad Sender and recipient can not be the same., The sender and recipient cannot be the same

When the sender does not have a nickname
statusCode : 401
errorCode : BadUnauthorizedException
message : bad senderNickname, Invalid senderNickname

When the maximum number of owned messages is 0
statusCode : 403
errorCode : ForbiddenException
message : Forbidden send message 0, Cannot send message

When the recipient's messages are full
statusCode : 405
errorCode : MethodNotAllowedParameterException
message : MethodNotAllowed The recipients message is full., The recipient's message is full and cannot be used.

When the number of characters in the content is greater than the number set in the console
statusCode : 412
errorCode : PreconditionFailed
message : content length prerequisites are not met.