> For the complete documentation index, see [llms.txt](https://docs.dashcomb.com/dashcomb-help-center/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dashcomb.com/dashcomb-help-center/tips-and-tricks/set-auth-in-api-request.md).

# APIの認証情報を設定する

Dashcombがサポートしている[UI Component](/dashcomb-help-center/ide/ui-component.md)とREST APIを利用して、認証情報を設定することができます。

## 準備

* このAPIの連携先になる管理画面を作成しておきます。

## 実現

* [REST APIへの接続設定](https://docs.dashcomb.com/dashcomb-help-center/tips-and-tricks/pages/urC7HTEGAqXWjHZCvmFx#rest-apiへの接続設定-rest-api)画面でAPI設定します。
* 「エンドポイント」に `https://httpbin.org` を入力します。
* 「保存」ボタンを押すと、API接続の作成ができました。
* Bearerトークン認証用に管理画面へ[Textarea](/dashcomb-help-center/ide/ui-component/textarea.md)をドラッグ＆ドロップします。
  * 例えば、オブジェクト名は `textarea1` とします。
* 管理画面の[クエリ領域](/dashcomb-help-center/ide/query-region.md)で「API」タブをクリックします。
* 「+」アイコンを押して、API名を作成します。
* データソースリストから先ほど作成したREST APIを選びます。
* 「実行前アクション」に「アクション無し」、「確認」、「承認」を選べることができます。
  * ここでは初期の「アクション無し」を選びます。
* 続いては「POST」を選びます。
* 「パラメーター」に `authorization` を入力します。
* 右の入力ボックスに `{{textarea1.value}}` を入力します。
* 「成功時」、「失敗時」の「アクション」や「通知」を設定します。
  * 設定方法の詳細は[アクションエディタ](/dashcomb-help-center/ide/property-region/action-editor.md)にご参考ください。
  * ここでは全て初期の「アクション無し」を選びます。
* 「保存」ボタンを押すと、APIの認証情報の設定ができました。

## 参照項目

* [API接続](/dashcomb-help-center/ide/others/dtassu/api.md)
* [API経由のCRUD操作](/dashcomb-help-center/tips-and-tricks/api-crud.md)
* [Textareaの使い方](/dashcomb-help-center/ide/ui-component/textarea.md)
* [アクションエディタ](/dashcomb-help-center/ide/property-region/action-editor.md)
