Communicating to Live Servers from External Tools

The Messaging Service API is the Open Cloud equivalent to Lua MessagingService, which supports live servers to send and subscribe to customized message channels called topics. While the Lua API only allows you to write a script in Studio for publishing messages that requires manual updates, you can use the Open Cloud Messaging Service API to communicate to live servers from external tools to automate and simplify your experience operations.

Usage

There are several helpful tools that you can build by supporting cross-server communication with Messaging Service API, including announcement portals, moderation systems, and LiveOps dashboards.

Announcement Portal

Messaging Service API enables you to build a web portal that sends announcements to all users across servers in your experience, such as announcing an upcoming event, an update, and the winner for a competition. You can use the portal to edit a message and click a button that calls the API to send the message out to a predefined topic that all users can see.

Moderation System

Messaging Service API is helpful for building a moderation system that keeps your experience safe and secure. After determining a user with inappropriate behavior, publish a message using Messaging Service API to trigger the experience server to warn or ban the specific user. You can also support DataStore API in the moderation system to add user accounts to a blocklist that prevents them from rejoining.

LiveOps Dashboard

You might want to launch live events such as a Halloween Party to attract more users. You can use Messaging Service API on a LiveOps dashboard to update event messages, trigger the event when it’s ready, and reward selected users with special items like a virtual crown without updating any of the experience’s code.

Publishing Messages to Live Servers

To publish a message to all of your experience's live servers, you need to include your experience's UniverseID, an API key, and the message channel topic in the API request with the following steps:

  1. Create an API key on the Creator Dashboard. Make sure you perform the following settings:

    1. Add Messaging Service API to Access Permissions.
    2. Add Publish operation to your selected experience.
  2. Get the *Universe ID**, the identifier of the experience in which you want to send your messages to.

    1. Navigate to the Creations page on the Creator Dashboard.
    2. Find the experience that you want to publish your messages to.
    3. Click the ... button on the target experience's thumbnail to display a list of options, then select Copy Universe ID from the list.
  3. Add the API Key in the x-api-key header of a POST request to the API like the following example:


1curl \
2--location --request POST 'https://apis.roblox.com/messaging-service/v1/universes/{universeId}/topics/{topic}' \
3--header 'x-api-key: abc...' \
4--header 'Content-Type: application/json' \
5--data-raw '{"message":"message to publish"}'
6
  1. Update your experience scripts with a predefined topic for receiving messages.

  2. Call Messaging Service API in a web portal to send the message out.