Skip to content

Latest commit

 

History

History
611 lines (417 loc) · 18.7 KB

OpenChannelApi.md

File metadata and controls

611 lines (417 loc) · 18.7 KB

Sendbird.OpenChannelApi

All URIs are relative to https://api-APP_ID.sendbird.com

Method HTTP request Description
ocCancelTheRegistrationOfOperators DELETE /v3/open_channels/{channel_url}/operators Cancel the registration of operators
ocCreateChannel POST /v3/open_channels Create a channel
ocDeleteChannelByUrl DELETE /v3/open_channels/{channel_url} Delete a channel
ocListChannels GET /v3/open_channels List channels
ocListOperators GET /v3/open_channels/{channel_url}/operators List operators
ocListParticipants GET /v3/open_channels/{channel_url}/participants List participants
ocRegisterOperators POST /v3/open_channels/{channel_url}/operators Register operators
ocUpdateChannelByUrl PUT /v3/open_channels/{channel_url} Update a channel
ocViewChannelByUrl GET /v3/open_channels/{channel_url} View a channel

ocCancelTheRegistrationOfOperators

void ocCancelTheRegistrationOfOperators()

Cancel the registration of operators Cancels the registration of operators from an open channel but leave them as participants. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-cancel-the-registration-of-operators ---------------------------- channel_url Type: string Description: Specifies the URL of the channel to cancel the registration of operators.

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcCancelTheRegistrationOfOperatorsRequest = {
  // string
  channelUrl: "channel_url_example",
  // Array<string>
  operatorIds: [
    "operator_ids_example",
  ],
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // boolean (optional)
  deleteAll: true,
};

apiInstance.ocCancelTheRegistrationOfOperators(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
channelUrl [string] defaults to undefined
operatorIds Array<string> defaults to undefined
apiToken [string] (optional) defaults to undefined
deleteAll [boolean] (optional) defaults to undefined

Return type

void

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ocCreateChannel

SendBirdOpenChannel ocCreateChannel()

Create a channel Creates an open channel. >Note: Classic open channels created before the deprecation date of March 2021 will maintain their original form and functions. However, new applications created after December 15, 2020, will be able to create dynamic partitioning open channels only. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-create-a-channel

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcCreateChannelRequest = {
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // OcCreateChannelData (optional)
  ocCreateChannelData: {
    name: "name_example",
    channelUrl: "channelUrl_example",
    coverUrl: "coverUrl_example",
    coverFile: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
    customType: "customType_example",
    data: "data_example",
    isEphemeral: true,
    isDynamicPartitioned2HowDynamicPartitioningWorks: true,
    operatorIds: [
      "operatorIds_example",
    ],
    operators: [
      "operators_example",
    ],
  },
};

apiInstance.ocCreateChannel(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
ocCreateChannelData OcCreateChannelData
apiToken [string] (optional) defaults to undefined

Return type

SendBirdOpenChannel

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ocDeleteChannelByUrl

OcDeleteChannelByUrl200Response ocDeleteChannelByUrl()

Delete a channel Deletes an open channel. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-delete-a-channel ----------------------------

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcDeleteChannelByUrlRequest = {
  // string
  channelUrl: "channel_url_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
};

apiInstance.ocDeleteChannelByUrl(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
channelUrl [string] defaults to undefined
apiToken [string] (optional) defaults to undefined

Return type

OcDeleteChannelByUrl200Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ocListChannels

OcListChannelsResponse ocListChannels()

List channels Retrieves a list of open channels. You can query the list using various parameters. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-list-channels ----------------------------

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcListChannelsRequest = {
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // string (optional)
  token: "token_example",
  // number (optional)
  limit: 1,
  // string (optional)
  customTypes: "custom_types_example",
  // string (optional)
  nameContains: "name_contains_example",
  // string (optional)
  urlContains: "url_contains_example",
  // boolean (optional)
  showFrozen: true,
  // boolean (optional)
  showMetadata: true,
  // string (optional)
  customType: "custom_type_example",
};

apiInstance.ocListChannels(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
apiToken [string] (optional) defaults to undefined
token [string] (optional) defaults to undefined
limit [number] (optional) defaults to undefined
customTypes [string] (optional) defaults to undefined
nameContains [string] (optional) defaults to undefined
urlContains [string] (optional) defaults to undefined
showFrozen [boolean] (optional) defaults to undefined
showMetadata [boolean] (optional) defaults to undefined
customType [string] (optional) defaults to undefined

Return type

OcListChannelsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ocListOperators

OcListOperatorsResponse ocListOperators()

List operators Retrieves a list of operators of an open channel. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-list-operators ---------------------------- channel_url Type: string Description: Specifies the URL of the channel to retrieve a list of operators.

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcListOperatorsRequest = {
  // string
  channelUrl: "channel_url_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // string (optional)
  token: "token_example",
  // number (optional)
  limit: 1,
};

apiInstance.ocListOperators(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
channelUrl [string] defaults to undefined
apiToken [string] (optional) defaults to undefined
token [string] (optional) defaults to undefined
limit [number] (optional) defaults to undefined

Return type

OcListOperatorsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ocListParticipants

OcListParticipantsResponse ocListParticipants()

List participants Retrieves a list of the participants of an open channel. A participant refers to a user who has entered the open channel and is currently online. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-list-participants ---------------------------- channel_url Type: string Description: Specifies the URL of the channel to retrieve a list of participants in.

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcListParticipantsRequest = {
  // string
  channelUrl: "channel_url_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // string (optional)
  token: "token_example",
  // number (optional)
  limit: 1,
};

apiInstance.ocListParticipants(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
channelUrl [string] defaults to undefined
apiToken [string] (optional) defaults to undefined
token [string] (optional) defaults to undefined
limit [number] (optional) defaults to undefined

Return type

OcListParticipantsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ocRegisterOperators

OcDeleteChannelByUrl200Response ocRegisterOperators()

Register operators Registers one or more operators to an open channel. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-register-operators ----------------------------

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcRegisterOperatorsRequest = {
  // string
  channelUrl: "channel_url_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // OcRegisterOperatorsData (optional)
  ocRegisterOperatorsData: {
    channelUrl: "channelUrl_example",
    operatorIds: [
      "operatorIds_example",
    ],
  },
};

apiInstance.ocRegisterOperators(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
ocRegisterOperatorsData OcRegisterOperatorsData
channelUrl [string] defaults to undefined
apiToken [string] (optional) defaults to undefined

Return type

OcDeleteChannelByUrl200Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ocUpdateChannelByUrl

SendBirdOpenChannel ocUpdateChannelByUrl()

Update a channel Updates information on an open channel. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-update-a-channel ----------------------------

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcUpdateChannelByUrlRequest = {
  // string
  channelUrl: "channel_url_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // OcUpdateChannelByUrlData (optional)
  ocUpdateChannelByUrlData: {
    channelUrl: "channelUrl_example",
    name: "name_example",
    coverUrl: "coverUrl_example",
    coverFile: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
    customType: "customType_example",
    data: "data_example",
    operatorIds: [
      "operatorIds_example",
    ],
    operators: [
      "operators_example",
    ],
  },
};

apiInstance.ocUpdateChannelByUrl(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
ocUpdateChannelByUrlData OcUpdateChannelByUrlData
channelUrl [string] defaults to undefined
apiToken [string] (optional) defaults to undefined

Return type

SendBirdOpenChannel

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ocViewChannelByUrl

SendBirdOpenChannel ocViewChannelByUrl()

View a channel Retrieves information on a specific open channel. https://sendbird.com/docs/chat/v3/platform-api/guides/open-channel#2-view-a-channel ----------------------------

Example

import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';

const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.OpenChannelApi(configuration);

let body:Sendbird.OpenChannelApiOcViewChannelByUrlRequest = {
  // string
  channelUrl: "channel_url_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
};

apiInstance.ocViewChannelByUrl(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
channelUrl [string] defaults to undefined
apiToken [string] (optional) defaults to undefined

Return type

SendBirdOpenChannel

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]