Skip to main content

Presence

RallyHere Presence API

This API is intended to generally store presence information and be used in order to track the concurrent users for the game as a whole.

Basic Usage

On login, a client should go through the following steps.

  1. Get any existing current presence data and store that locally using GET /v1/player/me/presence.
  2. Mark online by patching their own presence with an empty update using PATCH /v1/player/presence.
  3. Request the client visible settings using GET /v1/settings and store them.
  4. Every self_ping_interval_seconds the client should mark online again by patching their own presence with an empty update using PATCH /v1/player/presence

Setting Presence

When updating your presence the display_name and platform are not set directly. They are instead derived from the JWT provided by the users-api.

The presence you set is considered public, so do not set any values that should be considered private data in either the status_message or the custom_data.

Fetching Presence

You may fetch the presence of another user by either their player_id or player_uuid. You should prefer the player_uuid whenever it is available as the player_id is deprecated.

Private Presence Data

last_seen is only available when requesting presence for yourself or as an admin.

Concurrent Users Updates

It's expected that users of this API will regularly patch their own presence with an empty update. This will signal that they are still online without changing any of their presence information. This should be done on a cycle based on the self_ping_interval_setting settings provided by the API on the /v1/settings endpoint conforming to the ClientVisibleSettings schema.

If a client takes longer than the last_seen_age_considered_offline_seconds setting to perform this update they will be considered offline by other clients. This setting is provided by the API on the /v1/settings endpoint conforming to the ClientVisibleSettings schema.