@aws-sdk/client-chime
TypeScript icon, indicating that this package has built-in type declarations

3.777.0 • Public • Published

@aws-sdk/client-chime

Description

AWS SDK for JavaScript Chime Client for Node.js, Browser and React Native.

Most of these APIs are no longer supported and will not be updated. We recommend using the latest versions in the Amazon Chime SDK API reference, in the Amazon Chime SDK.

Using the latest versions requires migrating to dedicated namespaces. For more information, refer to Migrating from the Amazon Chime namespace in the Amazon Chime SDK Developer Guide.

The Amazon Chime application programming interface (API) is designed so administrators can perform key tasks, such as creating and managing Amazon Chime accounts, users, and Voice Connectors. This guide provides detailed information about the Amazon Chime API, including operations, types, inputs and outputs, and error codes.

You can use an AWS SDK, the AWS Command Line Interface (AWS CLI), or the REST API to make API calls for Amazon Chime. We recommend using an AWS SDK or the AWS CLI. The page for each API action contains a See Also section that includes links to information about using the action with a language-specific AWS SDK or the AWS CLI.

Using an AWS SDK

You don't need to write code to calculate a signature for request authentication. The SDK clients authenticate your requests by using access keys that you provide. For more information about AWS SDKs, see the AWS Developer Center.

Using the AWS CLI

Use your access keys with the AWS CLI to make API calls. For information about setting up the AWS CLI, see Installing the AWS Command Line Interface in the AWS Command Line Interface User Guide. For a list of available Amazon Chime commands, see the Amazon Chime commands in the AWS CLI Command Reference.

Using REST APIs

If you use REST to make API calls, you must authenticate your request by providing a signature. Amazon Chime supports Signature Version 4. For more information, see Signature Version 4 Signing Process in the Amazon Web Services General Reference.

When making REST API calls, use the service name chime and REST endpoint https://service.chime.aws.amazon.com.

Administrative permissions are controlled using AWS Identity and Access Management (IAM). For more information, see Identity and Access Management for Amazon Chime in the Amazon Chime Administration Guide.

Installing

To install this package, simply type add or install @aws-sdk/client-chime using your favorite package manager:

  • npm install @aws-sdk/client-chime
  • yarn add @aws-sdk/client-chime
  • pnpm add @aws-sdk/client-chime

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the ChimeClient and the commands you need, for example ListAccountsCommand:

// ES5 example
const { ChimeClient, ListAccountsCommand } = require("@aws-sdk/client-chime");
// ES6+ example
import { ChimeClient, ListAccountsCommand } from "@aws-sdk/client-chime";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region).
  • Initiate command with input parameters.
  • Call send operation on client with command object as input.
  • If you are using a custom http handler, you may call destroy() to close open connections.
// a client can be shared by different commands.
const client = new ChimeClient({ region: "REGION" });

const params = {
  /** input parameters */
};
const command = new ListAccountsCommand(params);

Async/await

We recommend using await operator to wait for the promise returned by send operation as follows:

// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.

Promises

You can also use Promise chaining to execute send operation.

client.send(command).then(
  (data) => {
    // process data.
  },
  (error) => {
    // error handling.
  }
);

Promises can also be called using .catch() and .finally() as follows:

client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Callbacks

We do not recommend using callbacks because of callback hell, but they are supported by the send operation.

// callbacks.
client.send(command, (err, data) => {
  // process err and data.
});

v2 compatible style

The client can also send requests using v2 compatible style. However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post on modular packages in AWS SDK for JavaScript

import * as AWS from "@aws-sdk/client-chime";
const client = new AWS.Chime({ region: "REGION" });

// async/await.
try {
  const data = await client.listAccounts(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listAccounts(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks.
client.listAccounts(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by specifying exception names:
   * if (error.name === 'SomeServiceException') {
   *     const value = error.specialKeyInException;
   * }
   */
}

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-chime package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

AssociatePhoneNumberWithUser

Command API Reference / Input / Output

AssociateSigninDelegateGroupsWithAccount

Command API Reference / Input / Output

BatchCreateRoomMembership

Command API Reference / Input / Output

BatchDeletePhoneNumber

Command API Reference / Input / Output

BatchSuspendUser

Command API Reference / Input / Output

BatchUnsuspendUser

Command API Reference / Input / Output

BatchUpdatePhoneNumber

Command API Reference / Input / Output

BatchUpdateUser

Command API Reference / Input / Output

CreateAccount

Command API Reference / Input / Output

CreateBot

Command API Reference / Input / Output

CreateMeetingDialOut

Command API Reference / Input / Output

CreatePhoneNumberOrder

Command API Reference / Input / Output

CreateRoom

Command API Reference / Input / Output

CreateRoomMembership

Command API Reference / Input / Output

CreateUser

Command API Reference / Input / Output

DeleteAccount

Command API Reference / Input / Output

DeleteEventsConfiguration

Command API Reference / Input / Output

DeletePhoneNumber

Command API Reference / Input / Output

DeleteRoom

Command API Reference / Input / Output

DeleteRoomMembership

Command API Reference / Input / Output

DisassociatePhoneNumberFromUser

Command API Reference / Input / Output

DisassociateSigninDelegateGroupsFromAccount

Command API Reference / Input / Output

GetAccount

Command API Reference / Input / Output

GetAccountSettings

Command API Reference / Input / Output

GetBot

Command API Reference / Input / Output

GetEventsConfiguration

Command API Reference / Input / Output

GetGlobalSettings

Command API Reference / Input / Output

GetPhoneNumber

Command API Reference / Input / Output

GetPhoneNumberOrder

Command API Reference / Input / Output

GetPhoneNumberSettings

Command API Reference / Input / Output

GetRetentionSettings

Command API Reference / Input / Output

GetRoom

Command API Reference / Input / Output

GetUser

Command API Reference / Input / Output

GetUserSettings

Command API Reference / Input / Output

InviteUsers

Command API Reference / Input / Output

ListAccounts

Command API Reference / Input / Output

ListBots

Command API Reference / Input / Output

ListPhoneNumberOrders

Command API Reference / Input / Output

ListPhoneNumbers

Command API Reference / Input / Output

ListRoomMemberships

Command API Reference / Input / Output

ListRooms

Command API Reference / Input / Output

ListSupportedPhoneNumberCountries

Command API Reference / Input / Output

ListUsers

Command API Reference / Input / Output

LogoutUser

Command API Reference / Input / Output

PutEventsConfiguration

Command API Reference / Input / Output

PutRetentionSettings

Command API Reference / Input / Output

RedactConversationMessage

Command API Reference / Input / Output

RedactRoomMessage

Command API Reference / Input / Output

RegenerateSecurityToken

Command API Reference / Input / Output

ResetPersonalPIN

Command API Reference / Input / Output

RestorePhoneNumber

Command API Reference / Input / Output

SearchAvailablePhoneNumbers

Command API Reference / Input / Output

UpdateAccount

Command API Reference / Input / Output

UpdateAccountSettings

Command API Reference / Input / Output

UpdateBot

Command API Reference / Input / Output

UpdateGlobalSettings

Command API Reference / Input / Output

UpdatePhoneNumber

Command API Reference / Input / Output

UpdatePhoneNumberSettings

Command API Reference / Input / Output

UpdateRoom

Command API Reference / Input / Output

UpdateRoomMembership

Command API Reference / Input / Output

UpdateUser

Command API Reference / Input / Output

UpdateUserSettings

Command API Reference / Input / Output

Readme

Keywords

none

Package Sidebar

Install

npm i @aws-sdk/client-chime

Weekly Downloads

35,845

Version

3.777.0

License

Apache-2.0

Unpacked Size

1.15 MB

Total Files

284

Last publish

Collaborators

  • amzn-oss
  • aws-sdk-bot