Sendbird · Arazzo Workflow

Sendbird Create a Channel and Broadcast a Message

Version 1.0.0

Create a group channel with a member set and immediately broadcast a message.

1 workflow 1 source API 1 provider
View Spec View on GitHub ArazzoWorkflows

Provider

sendbird

Workflows

create-channel-and-broadcast
Create a group channel for a member set and post a message.
Creates a group channel containing the supplied user IDs and then sends a text message into it from the designated sender.
2 steps inputs: apiToken, channelName, message, senderId, userIds outputs: channelUrl, messageId
1
createChannel
createGroupChannel
Create a group channel containing the supplied user IDs.
2
broadcast
sendMessage
Send the broadcast text message into the new channel.

Source API Descriptions

Arazzo Workflow Specification

sendbird-create-channel-and-broadcast-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Sendbird Create a Channel and Broadcast a Message
  summary: Create a group channel with a member set and immediately broadcast a message.
  description: >-
    Spins up a group channel for a supplied list of users and broadcasts a
    single message into it from a sender. Useful for announcement channels,
    cohort rooms, and any flow where a channel exists only to deliver one
    message to a known audience. Every step spells out its request inline so the
    flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: sendbirdApi
  url: ../openapi/sendbird-platform-openapi.yml
  type: openapi
workflows:
- workflowId: create-channel-and-broadcast
  summary: Create a group channel for a member set and post a message.
  description: >-
    Creates a group channel containing the supplied user IDs and then sends a
    text message into it from the designated sender.
  inputs:
    type: object
    required:
    - apiToken
    - userIds
    - senderId
    - message
    properties:
      apiToken:
        type: string
        description: Sendbird Api-Token from the dashboard.
      userIds:
        type: array
        description: User IDs to add to the channel.
        items:
          type: string
      channelName:
        type: string
        description: Name for the group channel.
        default: Broadcast
      senderId:
        type: string
        description: User ID that authors the broadcast message.
      message:
        type: string
        description: Text content of the broadcast message.
  steps:
  - stepId: createChannel
    description: Create a group channel containing the supplied user IDs.
    operationId: createGroupChannel
    parameters:
    - name: Api-Token
      in: header
      value: $inputs.apiToken
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.channelName
        user_ids: $inputs.userIds
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      channelUrl: $response.body#/channel_url
      memberCount: $response.body#/member_count
  - stepId: broadcast
    description: Send the broadcast text message into the new channel.
    operationId: sendMessage
    parameters:
    - name: Api-Token
      in: header
      value: $inputs.apiToken
    - name: channel_url
      in: path
      value: $steps.createChannel.outputs.channelUrl
    requestBody:
      contentType: application/json
      payload:
        message_type: MESG
        user_id: $inputs.senderId
        message: $inputs.message
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      messageId: $response.body#/message_id
      createdAt: $response.body#/created_at
  outputs:
    channelUrl: $steps.createChannel.outputs.channelUrl
    messageId: $steps.broadcast.outputs.messageId