Back to Aws Sdk Js V3

@aws-sdk/client-chime

clients/client-chime/README.md

3.1043.036.4 KB
Original Source
<!-- generated file, do not edit directly -->

@aws-sdk/client-chime

Description

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

<p> <b>Most of these APIs are no longer supported and will not be updated.</b> We recommend using the latest versions in the <a href="https://docs.aws.amazon.com/chime-sdk/latest/APIReference/welcome.html">Amazon Chime SDK API reference</a>, in the Amazon Chime SDK.</p> <p>Using the latest versions requires migrating to dedicated namespaces. For more information, refer to <a href="https://docs.aws.amazon.com/chime-sdk/latest/dg/migrate-from-chm-namespace.html">Migrating from the Amazon Chime namespace</a> in the <i>Amazon Chime SDK Developer Guide</i>.</p> <p>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.</p> <p>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 <i>See Also</i> section that includes links to information about using the action with a language-specific AWS SDK or the AWS CLI.</p> <dl> <dt>Using an AWS SDK</dt> <dd> <p> 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 <a href="http://aws.amazon.com/developer/">AWS Developer Center</a>. </p> </dd> <dt>Using the AWS CLI</dt> <dd> <p>Use your access keys with the AWS CLI to make API calls. For information about setting up the AWS CLI, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/installing.html">Installing the AWS Command Line Interface</a> in the <i>AWS Command Line Interface User Guide</i>. For a list of available Amazon Chime commands, see the <a href="https://docs.aws.amazon.com/cli/latest/reference/chime/index.html">Amazon Chime commands</a> in the <i>AWS CLI Command Reference</i>. </p> </dd> <dt>Using REST APIs</dt> <dd> <p>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 <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Signature Version 4 Signing Process</a> in the <i>Amazon Web Services General Reference</i>.</p> <p>When making REST API calls, use the service name <code>chime</code> and REST endpoint <code>https://service.chime.aws.amazon.com</code>.</p> </dd> </dl> <p>Administrative permissions are controlled using AWS Identity and Access Management (IAM). For more information, see <a href="https://docs.aws.amazon.com/chime/latest/ag/security-iam.html">Identity and Access Management for Amazon Chime</a> in the <i>Amazon Chime Administration Guide</i>.</p>

Installing

To install this package, use the CLI of 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:

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

Usage

To send a request:

  • Instantiate a client with configuration (e.g. credentials, region).
  • Instantiate a command with input parameters.
  • Call the send operation on the client, providing the command object as input.
js
const client = new ChimeClient({ region: "REGION" });

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

Async/await

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

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

Promises

You can also use Promise chaining.

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

Aggregated client

The aggregated client class is exported from the same package, but without the "Client" suffix.

Chime extends ChimeClient and additionally supports all operations, waiters, and paginators as methods. This style may be familiar to you from the AWS SDK for JavaScript v2.

If you are bundling the AWS SDK, we recommend using only the bare-bones client (ChimeClient). More details are in the blog post on modular packages in AWS SDK for JavaScript.

ts
import { Chime } from "@aws-sdk/client-chime";

const client = new 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 (not recommended).
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).

js
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;
   * }
   */
}

See also docs/ERROR_HANDLING.

Getting Help

Please use these community resources for getting help. We use 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)

<details> <summary> AssociatePhoneNumberWithUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> AssociateSigninDelegateGroupsWithAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchCreateRoomMembership </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchDeletePhoneNumber </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchSuspendUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchUnsuspendUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchUpdatePhoneNumber </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchUpdateUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateBot </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateMeetingDialOut </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreatePhoneNumberOrder </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateRoom </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateRoomMembership </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteEventsConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeletePhoneNumber </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRoom </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRoomMembership </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociatePhoneNumberFromUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateSigninDelegateGroupsFromAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAccountSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetBot </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetEventsConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetGlobalSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetPhoneNumber </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetPhoneNumberOrder </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetPhoneNumberSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetRetentionSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetRoom </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetUserSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> InviteUsers </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAccounts </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListBots </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListPhoneNumberOrders </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListPhoneNumbers </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListRoomMemberships </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListRooms </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSupportedPhoneNumberCountries </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListUsers </summary>

Command API Reference / Input / Output

</details> <details> <summary> LogoutUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutEventsConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutRetentionSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> RedactConversationMessage </summary>

Command API Reference / Input / Output

</details> <details> <summary> RedactRoomMessage </summary>

Command API Reference / Input / Output

</details> <details> <summary> RegenerateSecurityToken </summary>

Command API Reference / Input / Output

</details> <details> <summary> ResetPersonalPIN </summary>

Command API Reference / Input / Output

</details> <details> <summary> RestorePhoneNumber </summary>

Command API Reference / Input / Output

</details> <details> <summary> SearchAvailablePhoneNumbers </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateAccountSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateBot </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateGlobalSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdatePhoneNumber </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdatePhoneNumberSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateRoom </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateRoomMembership </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateUserSettings </summary>

Command API Reference / Input / Output

</details>