カスタムOAuthプロファイル

以下のエンドポイントを使用して、カスタムOAuthプロファイルをプログラムで管理します。

クイックリファレンス

タイプリソース説明
GET/api/custom_oauth_profilesカスタムOAuthプロファイルの一覧を取得します。
GET/api/custom_oauth_profiles/:idIDでカスタムOAuthプロファイルを取得します。
POST/api/custom_oauth_profilesカスタムOAuthプロファイルを作成します。
PUT/api/custom_oauth_profiles/:idカスタムOAuthプロファイルを更新します。
DELETE/api/custom_oauth_profiles/:idカスタムOAuthプロファイルを削除します。

カスタムOAuthプロファイルの一覧取得

カスタムOAuthプロファイルの一覧を取得します。クライアントのシークレットとトークンはレスポンスに含まれません。

GET /api/custom_oauth_profiles

クエリパラメータ

名前タイプ説明
pageintegerページ番号。デフォルトは1です。
per_pageintegerページサイズ。デフォルトは100です(最大100)。

サンプルリクエスト

shell
curl  -X GET 'https://www.workato.com/api/custom_oauth_profiles' \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \

レスポンス

json
{
  "result": [
      {
        "id": 321,
        "user_id": 123,
        "name": "Acme HubSpot OAuthアプリ",
        "provider": "hubspot",
        "data": {
          "client_id": "example_client_id"
        },
        "shared_accounts_count": 1,
        "oem_customers_count": 5,
        "created_at": "2023-01-15T11:50:32.986-07:00",
        "updated_at": "2023-01-15T11:50:32.986-07:00"
      }
    ]
}

IDでカスタムOAuthプロファイルを取得

IDでカスタムOAuthプロファイルを取得します。クライアントのシークレットとトークンはレスポンスに含まれません。

GET /api/custom_oauth_profiles/:id

パスパラメータ

名前タイプ説明
idinteger
required
取得するカスタムOAuthプロファイルのID

サンプルリクエスト

shell
curl  -X GET 'https://www.workato.com/api/custom_oauth_profiles/321' \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \

レスポンス

json
{
  "result": {
    "id": 321,
    "user_id": 123,
    "name": "Acme HubSpot OAuthアプリ",
    "provider": "hubspot",
    "data": {
      "client_id": "example_client_id"
    },
    "shared_accounts_count": 1,
    "oem_customers_count": 5,
    "created_at": "2023-01-15T11:50:32.986-07:00",
    "updated_at": "2023-01-15T11:50:32.986-07:00"
  }
}

カスタムOAuthプロファイルの作成

カスタムOAuthプロファイルを作成します。

POST /api/custom_oauth_profiles

ペイロード

名前タイプ説明
namestring
required
OAuthプロファイルの名前。
providerstring
required
このカスタムOAuthプロファイルに関連付けられたアプリの名前。
data.client_idstring
required
カスタムOAuthアプリのクライアントID
data.client_secretstring
required
カスタムOAuthアプリのクライアントシークレット
data.tokenstring
optional
Slackアプリの場合にのみ必要です。カスタムOAuthアプリのトークン

サンプルリクエスト

shell
curl  -X POST https://www.workato.com/api/custom_oauth_profiles \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d '{ 
            "name": "My new OAuth profile",
            "provider": "hubspot"
            "data": { 
              "client_id": "new_client_id", 
              "client_secret": "new_client_secret"
            }
          }'

レスポンス

json
{
  "result": {
    "id": 322,
    "user_id": 123,
    "name": "My new OAuth profile",
    "provider": "hubspot",
    "data": {
      "client_id": "example_client_id"
    },
    "shared_accounts_count": 0,
    "oem_customers_count": 0,
    "created_at": "2023-01-15T11:50:32.986-07:00",
    "updated_at": "2023-01-15T11:50:32.986-07:00"
  }
}

カスタムOAuthプロファイルの更新

カスタムOAuthプロファイルを更新します。

PUT /api/custom_oauth_profiles/:id

パスパラメータ

名前タイプ説明
idinteger
required
更新するカスタムOAuthプロファイルのID

ペイロード

名前タイプ説明
namestring
required
OAuthプロファイルの名前。
providerstring
required
このカスタムOAuthプロファイルに関連付けられたアプリの名前。
data.client_idstring
required
カスタムOAuthアプリのクライアントID
data.client_secretstring
必須
カスタムOAuthアプリのクライアントシークレット
data.tokenstring
オプション
Slackアプリの場合のみ必要です。カスタムOAuthアプリのトークン

サンプルリクエスト

shell
curl  -X PUT https://www.workato.com/api/custom_oauth_profiles/322 \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d '{ 
            "name": "My updated OAuth profile",
            "provider": "hubspot"
            "data": { 
              "client_id": "updated_client_id", 
              "client_secret": "updated_client_secret"
            }
          }'

レスポンス

json
{
  "result": {
    "id": 322,
    "user_id": 123,
    "name": "My updated OAuth profile",
    "provider": "hubspot",
    "data": {
      "client_id": "updated_client_id"
    },
    "shared_accounts_count": 0,
    "oem_customers_count": 0,
    "created_at": "2023-01-15T11:50:32.986-07:00",
    "updated_at": "2023-01-15T11:50:32.986-07:00"
  }
}

カスタムOAuthプロファイルの削除

カスタムOAuthプロファイルを削除します。

DELETE /api/custom_oauth_profiles/:id

パスパラメータ

名前タイプ説明
idinteger削除するカスタムOAuthプロファイルのID

サンプルリクエスト

shell
curl  -X DELETE https://www.workato.com/api/custom_oauth_profiles/322 \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \

レスポンス

json
{
  "result": {
    "success": true
  }
}

Last updated: