Skip to content

Latest commit

 

History

History
274 lines (185 loc) · 10.8 KB

File metadata and controls

274 lines (185 loc) · 10.8 KB

Sendbird.MetadataApi

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

Method HTTP request Description
createAChannelMetadata POST /v3/{channel_type}/{channel_url}/metadata Create a channel metadata
deleteAChannelMetadataWhenDeletingAllItemsOfAChannelMetadata DELETE /v3/{channel_type}/{channel_url}/metadata Delete a channel metadata - When deleting all items of a channel metadata
updateAChannelMetadata PUT /v3/{channel_type}/{channel_url}/metadata Update a channel metadata - When updating existing items of a channel metadata by their keys or adding new items to the metadata
viewAChannelMetadataWhenRetrievingAllItemsOfAChannelMetadata GET /v3/{channel_type}/{channel_url}/metadata View a channel metadata - When retrieving all items of a channel metadata

createAChannelMetadata

CreateAChannelMetadataResponse createAChannelMetadata()

Create a channel metadata Creates a channel metadata's items to store in a channel. https://sendbird.com/docs/chat/platform-api/v3/channel/managing-metadata/channel-create-metadata#1-create-metadata ----------------------------

Example

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

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

let body:Sendbird.MetadataApiCreateAChannelMetadataRequest = {
  // 'open_channels' | 'group_channels' | (Required) 
  channelType: "open_channels",
  // string | (Required) 
  channelUrl: "channel_url_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // CreateAChannelMetadataRequest (optional)
  createAChannelMetadataRequest: {
    includeTs: true,
    metadata: {},
  },
};

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

Parameters

Name Type Description Notes
createAChannelMetadataRequest CreateAChannelMetadataRequest
channelType [**'open_channels' 'group_channels'**]Array<'open_channels' | 'group_channels'> (Required)
channelUrl [string] (Required) defaults to undefined
apiToken [string] (optional) defaults to undefined

Return type

CreateAChannelMetadataResponse

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]

deleteAChannelMetadataWhenDeletingAllItemsOfAChannelMetadata

any deleteAChannelMetadataWhenDeletingAllItemsOfAChannelMetadata()

Delete a channel metadata Deletes a channel metadata's one or all items that are stored in a channel. https://sendbird.com/docs/chat/platform-api/v3/channel/managing-metadata/channel-delete-metadata#1-delete-metadata ---------------------------- channel_type Type: string Description: Specifies the type of the channel. Either open_channels or group_channels. channel_url Type: string Description: Specifies the URL of the channel which has the metadata to delete.

Example

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

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

let body:Sendbird.MetadataApiDeleteAChannelMetadataWhenDeletingAllItemsOfAChannelMetadataRequest = {
  // 'open_channels' | 'group_channels' | (Required) 
  channelType: "open_channels",
  // string | (Required) 
  channelUrl: "channel_url_example",
  // string (optional)
  key: "key_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
};

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

Parameters

Name Type Description Notes
channelType [**'open_channels' 'group_channels'**]Array<'open_channels' | 'group_channels'> (Required)
channelUrl [string] (Required) defaults to undefined
key [string] (optional) defaults to undefined
apiToken [string] (optional) defaults to undefined

Return type

any

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]

updateAChannelMetadata

any updateAChannelMetadata()

Update a channel metadata Updates existing items of a channel metadata by their keys, or adds new items to the metadata. https://sendbird.com/docs/chat/platform-api/v3/channel/managing-metadata/channel-update-metadata#1-update-metadata ---------------------------- channel_type Type: string Description: Specifies the type of the channel. Either open_channels or group_channels. channel_url Type: string Description: Specifies the URL of the target channel.

Example

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

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

let body:Sendbird.MetadataApiUpdateAChannelMetadataRequest = {
  // 'open_channels' | 'group_channels' | (Required) 
  channelType: "open_channels",
  // string | (Required) 
  channelUrl: "channel_url_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
  // UpdateAChannelMetadataRequest (optional)
  updateAChannelMetadataRequest: {
    metadata: {},
    upsert: true,
  },
};

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

Parameters

Name Type Description Notes
updateAChannelMetadataRequest UpdateAChannelMetadataRequest
channelType [**'open_channels' 'group_channels'**]Array<'open_channels' | 'group_channels'> (Required)
channelUrl [string] (Required) defaults to undefined
apiToken [string] (optional) defaults to undefined

Return type

any

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]

viewAChannelMetadataWhenRetrievingAllItemsOfAChannelMetadata

any viewAChannelMetadataWhenRetrievingAllItemsOfAChannelMetadata()

View a channel metadata Retrieves a channel metadata's one or more items that are stored in a channel. https://sendbird.com/docs/chat/platform-api/v3/channel/managing-metadata/channel-get-metadata#1-get-metadata ---------------------------- channel_type Type: string Description: Specifies the type of the channel. Either open_channels or group_channels. channel_url Type: string Description: Specifies the URL of the target channel.

Example

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

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

let body:Sendbird.MetadataApiViewAChannelMetadataWhenRetrievingAllItemsOfAChannelMetadataRequest = {
  // 'open_channels' | 'group_channels' | (Required) 
  channelType: "open_channels",
  // string | (Required) 
  channelUrl: "channel_url_example",
  // string (optional)
  key: "key_example",
  // string | In a query string, specifies an array of one or more keys of the metadata items. If not specified, all items of the metadata are returned. If specified, only the items that match the parameter values are returned. URL encoding each key is recommended. (optional)
  keys: "keys_example",
  // string (optional)
  apiToken: "{{API_TOKEN}}",
};

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

Parameters

Name Type Description Notes
channelType [**'open_channels' 'group_channels'**]Array<'open_channels' | 'group_channels'> (Required)
channelUrl [string] (Required) defaults to undefined
key [string] (optional) defaults to undefined
keys [string] In a query string, specifies an array of one or more keys of the metadata items. If not specified, all items of the metadata are returned. If specified, only the items that match the parameter values are returned. URL encoding each key is recommended. (optional) defaults to undefined
apiToken [string] (optional) defaults to undefined

Return type

any

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]