15. User Rich info

Reference: {#RefRichInfo}

Author: Artyom Kazak


This page describes a part of the user profile called “Rich info”. The corresponding feature is called “Rich profiles”.

15.1. Summary {#RefRichInfoSummary}

For every team user we can store a list of key-value pairs that are displayed in the user profile. This is similar to “custom profile fields” in Slack and other enterprise messengers.

Different users can have different sets of fields; there is no team-wide schema for fields. All field values are strings. Fields are passed as an ordered list, and the order information is preserved when displaying fields in client apps.

Only team members and partners can see the user’s rich info.

15.2. API {#RefRichInfoApi}

15.2.1. Querying rich info {#RefRichInfoGet}

GET /users/:uid/rich-info. Sample output:

{
    "version": 0,
    "fields": [
        {
            "type": "Department",
            "value": "Sales & Marketing"
        },
        {
            "type": "Favorite color",
            "value": "Blue"
        }
    ]
}

If the requesting user is not allowed to see rich info, error code 403 is returned with the "insufficient-permissions" error label.

Otherwise, if the rich info is missing, an empty field list is returned:

{
    "version": 0,
    "fields": []
}

15.2.2. Setting rich info {#RefRichInfoPut}

Not implemented yet. Currently the only way to set rich info is via SCIM.

15.2.3. Events {#RefRichInfoEvents}

Not implemented yet.

When user’s rich info changes, the backend sends out an event to all team members:

{
    "type": "user.rich-info-update",
    "user": {
        "id": "<user ID>"
    }
}

Connected users who are not members of user’s team will not receive an event (nor can they query user’s rich info by other means).

15.3. SCIM support {#RefRichInfoScim}

Rich info can be pushed to Wire by setting JSON keys under the "urn:ietf:params:scim:schemas:extension:wire:1.0:User" extension. Both PUT /scim/v2/Users/:id , PATCH /scim/v2/Users/:id and POST /scim/v2/Users/:id can contain rich info. Here is an example for PUT:

PUT /scim/v2/Users/:id

{
    ...,
    "urn:ietf:params:scim:schemas:extension:wire:1.0:User": {
        "Department": "Sales & Marketing",
        "FavoriteColor": "Blue"
    }
}

Here is an example for PATCH:

PATCH /scim/v2/Users/:id

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "operations": [
    {
      "op": "add",
      "path": "urn:ietf:params:scim:schemas:extension:wire:1.0:User:Department",
      "value": "Development "
    },
    {
      "op": "replace",
      "path": "urn:ietf:params:scim:schemas:extension:wire:1.0:User:Country",
      "value": "Germany"
    },
    {
      "op": "remove",
      "path": "urn:ietf:params:scim:schemas:extension:wire:1.0:User:City"
    }
  ]
}

Rich info set via SCIM can be queried by doing a GET /scim/v2/Users or GET /scim/v2/Users/:id query.

15.3.1. Set up SCIM RichInfo mapping in Azure {#RefRichInfoScimAgents}

Go to your provisioning page

image

Click “Edit attribute mappings”

Then click “Mappings” And then click Synchronize Azure Active Directory Users to appname image

Click “Show Advanced options” and then Edit attribute list for appname image

Add a new attribute name. The type should be String and the name should be prefixed with urn:ietf:params:scim:schemas:extension:wire:1.0:User: e.g. urn:ietf:params:scim:schemas:extension:wire:1.0:User:Location

image

Hit Save and afterwards hit Add New Mapping

Select the Azure AD Source attribute you want to map, and map it to the custom Target Attribute that you just added. image

15.4. Limitations {#RefRichInfoLimitations}

  • The whole of user-submitted information (field names and values) cannot exceed 5000 characters in length. There are no limitations on the number of fields, or the maximum of individual field names or values.

  • Field values can not be empty (""). If they are empty, the corresponding field will be removed.