Method Calls

Prev Next

Rocket.Chat 9.0.0 removed most Realtime API methods. Use the REST API instead. See Deprecated Endpoints for the REST endpoint that replaces each removed method.

Method calls are used to send data to the server to perform actions. The response to these calls is asynchronous, meaning they don't occur in a specific order. To track the outcome of a call, it's essential to use a unique ID. This ID will be used in the response, allowing the client to identify and retrieve the result of the corresponding call.

Here is an example of a method call and response for getting the public settings:

Example call

{
    "msg": "method",
    "method": "public-settings/get",
    "id": "2",
    "params": []
}

Example response

{
    "msg": "result",
    "id": "2",
    "result": [
        { "_id": "FileUpload_Enabled", "value": true, "enterprise": false, "requiredOnWizard": false }
    ]
}

The id is the only way to recognize which method call a response belongs to.

You can also make a method call through the REST API using Execute a Meteor method call.