Toggle menu

postMessage()

Posts a message to a configured notification provider.

Parameters

NameTypeDescription
notifyString, optionalThe name of a notifier, or comma separated list of notifiers, set in the Notification configuration. If not provided, all notifiers that have "default":true will be used. The notifiers used will be returned in the sendlist
messageString, requiredThe message you would like to post

Example Request

function(params, credentials) {
    let resp = this.callWorkerMethod("notification", "postMessage",{
        "notify": "MyFacebookPage",
        "message": "A message which will be posted as an update from my page"
    });
    return resp;
}

Returns

{
    "jsonrpc": "2.0",
    "id": 170,
    "result": {
        "success": true,
        "sendlist": "MyFacebookPage",
        "error": null
    }
}

Error Handling

Errors are returned as an array in the result.result.error property. For example

"error": [{
    "name": "tweet",
    "error": "Could not authenticate you."
}]

Last modified on 31 July 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon