As of April 2023 the Rooms API is deprecated and is no longer included in the list of available Platform APIs for integration. For more information click here.
Third-party solutions, such as Photon, can be used as an alternative to implement Rooms in your app. For an example of how Photon, and other third-party solutions integrate with the Platform API, check here.
Moderated rooms are created through S2S REST calls. A client app should not create or maintain moderated rooms. Only your trusted servers can create or make changes to moderated rooms.
Note: The server APIs in this topic are for creating system-moderated rooms. For user-created rooms, see User-Owned Private Rooms in the Rooms topic.
Message Basics
Server-to-Server API requirements
Calls to these APIs must meet the following requirements:
Endpoint
Make all server-to-server requests to this endpoint:
https://graph.oculus.com
Access token
Include an access token with every request to authenticate it either as a valid server request or on behalf of a specific user. The access token can be one of the following:
App credentials authenticate your server’s back-end as a trusted resource. Never share these credentials with any client-side application.
The access token with app credentials includes the App ID and App Secret from the API page on the Meta Horizon Developer Dashboard. It follows this format: OC|$APPID|$APPSECRET.
If your credentials are compromised or you need new API credentials, generate a new app secret. Changing the app secret will revoke the permissions of the previous one. Accessing the app secret requires an administrator account.
User access token
A user access token authenticates requests on behalf of a user. Use this token type when actions relate to a specific user. An example case is updating a client-authoritative leaderboard with the results of a server-hosted multiplayer match. For each user, you would use the user access token to authenticate your server as you make requests to update their leaderboards.
Retrieve the user token with the ovr_User_GetAccessToken() method.
Alternatively, use the following blueprint function:
The token will be returned as a response and can be passed from the client to your server.A user access token contains FRL or OC and a long alpha numeric string similar to the following: FRL12342GhFccWvUBxPMR4KXzM5s2ZCMp0mlWGq0ZBrOMXyjh4EmuAPvaXiMCAMV9okNm9DXdUA2EWNplrQ.
Additionally, you can retrieve your user token for testing purposes at the ‘User Token’ section of the API page of the Meta Horizon Developer Dashboard, which is at the left navigation bar.
App ID
Some server calls require an app ID, which you can find on the API page of the Meta Horizon Developer Dashboard.
Create a Moderated Room
Calling this endpoint will create a new moderated room.
You’ll need to include the max_users parameter which identifies the max simultaneous users for the room. The maximum number of users supported per room is 1,024.
Example response:
{"id": 963119010431337}
In response the API will return the moderated_room_id as the id value. Call this id when adding users to the room.
Update a Moderated Room’s Metadata
Calling this endpoint sets up to 2,000 key/value pairs in the room datastore. Key and value data can only be accepted as string values, any other value type will return an error. The ROOM_ID is the value returned from the API when you created the room.
Calling this endpoint will retrieve information about a specified moderated room. The ROOM_ID is the value returned from the API when you created the room. The parameters in the example below are all optional, information will only be returned for the parameters identified in the request.
Once system-moderated rooms are created, you use client APIs so that users can find, join and leave rooms.
For a list of these APIs, see Get, Join and Leave Rooms in the Rooms topic.