Documentation

User Profile ('Allow to open external profile' toggle)

Users will be able to open each other's profiles from the dropdown menu on a message, or by tapping on an avatar.

If you have user profiles on your platform and prefer to link them to each other, please study the needed documentation. When everything is prepared, enable this toggle to provide users opportunity to open each others’ profiles on a chat. Then choose please what type of transmission you will use: GET parameters or post message.

Technical part for such an activation

There are two types of integration available:

1. PostMessage Integration

When a user clicks the "Open Profile" button or on an avatar, a postMessage will be sent containing the following data:

{
  "type": "social",
  "body": {
    "action": "open_profile",
    "data": {
      "user_id": "double_encrypted_userId"
    }
  }
}

Upon receiving this message, you need to decrypt the user_id twice to retrieve the original user ID (if necessary) and then open the user profile on your side.

2. GET Parameter Link Integration

When opening a WebView or Iframe, you should include a new GET parameter that specifies the profile URL to be opened. The parameter should be URL-encoded and designed to open with target=_blank.

ParameterDescription
profileurlURL-encoded URL that will be opened

Example

Here’s how to open the WebView or Iframe:

[https://chat.watchers.io?roomId=](https://chat.watchers.io/?roomId=){ROOM ID}&userID={ENCRYPTED USERID}&apike={APIKEY}&profileurl=https%3A%2F%2Fwww.watchers.io%2Fprofile_name_or_id

This setting enables you to directly link to external profiles within your chat interface, providing a seamless user experience.