mitter.io
  • Welcome
  • Migrating from cloud to on-prem
  • Get mitter.io
    • Custom configuration
  • Getting started
    • Build Your First Android App
      • Setup
      • Authenticate a User
      • Start a Basic Chat
      • Selective Deliveries
      • Custom Payloads
    • Build Your First iOS App
      • Overview
      • Installation
      • Basic Setup
      • Receive Push Messages
      • Storyboard
      • Channel List
      • Channel Window
    • Build Your First Web App
      • Setting Up Your App
      • Start a Basic Chat
      • Selective Deliveries
    • Build Your First React Native app
  • Platform Reference
    • Introduction
    • Concepts
    • Authorization and Access
    • Calling the APIs
    • Users
    • Channels
      • Channel Streams and Typing Indicators
    • Messages
    • Delivery Endpoints (Push Notifications)
    • Federated Authentication
    • Basic Permissions and Privileges
    • ACLs and Advanced Permission Model
    • Metadata
  • SDKs
    • Android
      • Getting Started
      • Set up FCM
      • Presence and Timeline Events
      • Profiles, Pagination and Locators
      • Using the UI Framework
    • iOS
      • Installation
      • Basic Setup
      • Get the current user details
      • Create a Channel
      • Messaging
      • Push Messages
    • Javascript
      • Using the UI framework (web only)
      • For react-native
      • For node.js
      • TSDocs / JSDocs
      • For Typescript Users
    • Java (Backend)
Powered by GitBook
On this page
  • Introduction
  • Behaviour
  1. Platform Reference

Metadata

The Metadata reference

Introduction

mitter.io allows attaching metadata to certain entities. Currently, Channels and Users are supported.

The examples below demonstrate operations with Channels, but the same can be performed on Users as well (by replacing "channels" in the URLs with "users", and providing the userId instead of the channelId)

Here is a sample API call to POST metadata:

POST /v1/channels/my-awesome-channel/metadata
{
    "type": "awesome-channel",
    "maxParticipants": 256,
    "meetingLocation": {
        "latitude": 12,
        "longitude": 12
    }
}

You can query Channels by metadata like so:

GET /v1/channels?metadata={type:"awesome-channel"}

NOTE: The URL in the example is not encoded for readability's sake, but it must be when making actual calls.

Behaviour

Metadata can be any valid JSON and adheres to the following rules:

  1. The top level values of the JSON (in the above case, "awesome-channel", 256, and the location JSON) can only be string, numeric or JSON. It cannot be boolean.

  2. Only top level keys can be used to query objects. For instance, in the above example, you can query Channels by type, maxParticipants and meetingLocation, but NOT by meetingLocation.latitude.

  3. If you POST metadata with a key that already exists, it will be overridden. Keys with JSON values will not be merged.

  4. When querying entities, you can specify multiple JSON, and all entities that match ALL queries will be fetched, i.e., if you provide multiple queries, the system will do an AND operation. For instance, if you execute GET /v1/channels?metadata={type: "awesome-channel", "age": 2}, then you will NOT get the above channel. Similarly, if you have two channels:

{
    "channelId": "channel-one",
    ...
    "metadata": {
        "type": "business",
        "area": "IN"
    }
}

{
    "channelId": "channel-two",
    ...
    "metadata": {
        "type": "business",
        "area": "EU"
    }
}

and you try to execute GET /v1/channels?metadata={type: "business"}, then the response will be channel-one

PreviousACLs and Advanced Permission ModelNextAndroid

Last updated 6 years ago