Skip to content

Reference Intercom

Maximilian Bienhüls edited this page Nov 21, 2017 · 8 revisions

Send intercom message

This method allows you to send intercom messages to users, UAC groups and chayns® sites. It is also possible to create a group chat. At least one of the recipient lists below has to be provided. Alternatively the tobitAccessToken of the current user can be provided, to send a message from the current user to the site. On success the http status 'created' will be returned.

POST https://api.chayns.net/v2.0/{LocationID}/Intercom

Snippet

Permissions
'PublicInfo', 'UserInfo', 'SeeUAC', 'Intercom'

Header
Authorization: Basic {TappId}:{Secret}

The part 'TappID:Secret' has to be Base64 encoded.

Body

  • Message : string - The message to be send.
  • UacIds (optional) : int[] - Recipient list containing UAC groupIds.
  • UserIds (otpional) : int[] - Recipient list containing userIds.
  • ReceiverLocationIds (optional) : int[] - Recipient list containing locationIds.
  • ThreadName (optional) : string - Creates a new chat named after this parameter or sends a message to an existing chat with this name.
  • UseGroupChat (optional) : boolean - If true, creates a group chat with all receivers of the message or if false, creates single chats for each receiver.
  • UserAccessToken (optional) : string - Sends a message from the current user to the site. Token: chayns.env.user.tobitAccessToken.
  • Images (optional) : Image[] - Images that will be added to the message (currently only the first image will be shown).
//Example Image
{
    "url": "https://tsimg.space/v1/Images/f16d3d26-9cdc-e611-837b-00155d00f416.jpg"
}

Parameter

  • LocationID : int - Can be found in chayns.env.site.
  • TappID : int - Can be found in chayns.env.site.tapp

Result

  • success : boolean - An indicator for whether the action was successful.