Skip to main content
Table of Contents

Conversations

Fetch conversations (both channels and public/private conversations), send messages to a conversation, and unfurl messages for previews within conversations using Unified APIs for Collaboration Tools.

Get conversations

Returns a list of conversations (eg:channels, direct public) messages, private messages etc.) within the specified team/workspace.

GET /api/collaboration-tools/v1/conversations

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://integrate.browserstack.com/api/collaboration-tools/v1/conversations?unique_user_id=steve@acme.com&tool=slack&team_id=X00XXXXXXX0"

  • unique_user_id* String

    Unique identifier for user e.g. email ID

  • tool* String

    Name of the tool. Allowed values are slack, msteams

  • team_id* String

    Unique identifier for team/workspace e.g. X00XXX!XXX0

  • as_bot boolean

    Indicator that allows you to identify the source/sender of a message as a bot. By using this field, you can attribute messages to a bot entity, distinguishing them from messages originating from user accounts.

Response attributes 200 application/json

Response

{
    "success": true,
    "data": {
        "channels": [
            {
                "key": "A00AA0A000A",
                "label": "random",
                "is_private": false,
                "icon": "https://static-assets.browserstack.com/integrate/icons/slack/public_channel.svg"
            },
            {
                "key": "B00AA0A000B",
                "label": "confidential-channel",
                "is_private": true,
                "icon": "https://static-assets.browserstack.com/integrate/icons/slack/private_channel.svg"
            }
        ],
        "users": [
            {
                "key": "U00UU0U000U",
                "label": "demouser1",
                "icon": "https://secure.gravatar.com/avatar/07asdkndjbhfu83asdfd8f677f5.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2DSguysadS7g%2Favatars%2Fava_0026-32.png",
                "email": "user1@exampleemail.com",
                "display_name": "User 1"
            },
            {
                "key": "Z00UU0U000Z",
                "label": "demouser1",
                "icon": "https://secure.gravatar.com/avatar/07asdkndjbhfu83asdfd8f677f5.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2DSasdkasadS7g%2Favatars%2Fava_0026-32.png",
                "email": "user1@exampleemail.com",
                "display_name": "User 2"
            }
        ]
    }
}
  • success Boolean

    Operation was a success or failure.

  • data Object

    List of all conversations within the team (/workspace)

Send message

Post a message to a conversation as a user/bot.

To get the details of the send message /message API itself, refer to the send-message-meta endpoint. It helps you understand how to interact with the send message (/message) endpoint and guides you on how to post messages (with a format, if required) as per your preference.

POST /api/collaboration-tools/v1/message

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://integrate.browserstack.com/api/collaboration-tools/v1/message?unique_user_id=steve@acme.co&tool=slack"
  • unique_user_id* String

    Unique identifier for user e.g. email ID

  • tool* String

    Name of the tool. Allowed values are slack, msteams

  • as_bot boolean

    Indicator that allows you to identify the source/sender of a message as a bot. By using this field, you can attribute messages to a bot entity, distinguishing them from messages originating from user accounts.

Response attributes 200 application/json

Response


  • success Boolean

    Operation was a success or failure.

  • data Object

    Details of the message posted

Meta for send message

Get the meta-data of the send message (/message) endpoint. This API returns information about the supported fields and their schema details.

POST /api/collaboration-tools/v1/message

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "/api/collaboration-tools/v1/meta-send-message?unique_user_id=steve@acme.com&tool=slack"
  • unique_user_id* String

    Unique identifier for user e.g. email ID

  • tool* String

    Name of the tool. Allowed values are slack, msteams

  • team_id String

    Unique identifier for the team (/worskpace) e.g. email ID

Response attributes 200 application/json

Response

{
    "success": true,
    "data": {
        "fields": [
            {
                "required": true,
                "label": "Channel or Username",
                "key": "conversation_id",
                "options_path": "/api/collaboration-tools/v1/conversations?tool=slack&format=single-value-select&team_id=T00TTTTTTT0",
                "schema": {
                    "field": "single-value-select",
                    "system_field": true,
                    "data_format": {
                        "$type": "string"
                    }
                }
            },
            {
                "required": true,
                "label": "Message",
                "key": "message",
                "schema": {
                    "field": "paragraph",
                    "system_field": true,
                    "data_format": {
                        "$type": "string"
                    }
                }
            },
            {
                "required": false,
                "label": "Attachment",
                "key": "attachment",
                "schema": {
                    "field": "file_url",
                    "system_field": true,
                    "data_format": {
                        "$type": "array",
                        "$items": {
                            "$type": "string"
                        }
                    }
                }
            }
        ]
    }
}
  • success Boolean

    Operation was a success or failure.

  • data Object

    Fields to be passed (required and option) for sending a message

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback