クラウドBOT RESTful API リファレンス (5.0)

Download OpenAPI specification:Download

クラウドBOT RESTful APIのリファレンスです。
APIを利用するには、公開IDの設定とアクセストークンの発行が必要です。
クラウドBOTダッシュボード > 開発者向けページから設定してください。
https://console.c-bot.pro/development

リクエストペイロードおよびレスポンスにマルチバイト文字が含まれる場合はUTF-8として扱います。
リクエストペイロード容量が4MBを超えるリクエストは拒否されます。

契約一覧

get /services/contracts
https://api.c-bot.pro/services/contracts

API機能が有効な契約の一覧を参照します。
使用するアクセストークンに「参照」権限が付与されている必要があります。

query Parameters
properties
string
Example: properties=plan,owner

追加で取得するプロパティ名集合
以下のプロパティ名を,(カンマ)区切りで列記する
plan: プラン名
owner: 契約オーナー
timezone: タイムゾーン
location: ロケーション
name: 契約名
organization: 組織名(個人名)
postcode: 郵便番号
address: 住所
phone: 電話番号
department: 部署名
username: 担当者名
(public_id, public_pathプロパティは必ず取得します)

header Parameters
content-type
required
string
Value: "application/json"
content-language
required
string
Enum: "ja" "en"
access-token
string

アクセストークン
トークン・シークレット認証の場合に必要です。

secret-key
string

シークレットキー
トークン・シークレット認証の場合に必要です。

authorization
string
Value: "Bearer {トークン}"

OAuthアクセストークン
OAuth認証の場合に必要です。
値はBearerスキームで記述します。

Responses

200

[OK] 契約一覧がレスポンスされました。

401

[Unauthorized] アクセストークン・シークレットキーが正しくありません。

403

[Forbidden] アクセストークンに参照権限がありません。

413

[Payload Too Large] ペイロードが大きすぎます。

415

[Unsupported Media Type] content-typeが正しくありません。

422

[Unprocessable Entity] リクエスト内容が不正です。

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "contracts":
    [
    ]
}

BOT一覧

get /{public_id}/bots
https://api.c-bot.pro/{public_id}/bots

API公開されているBOTの一覧を参照します。
使用するアクセストークンに「参照」権限が付与されている必要があります。

path Parameters
public_id
required
string

APIの公開ID

query Parameters
properties
string
Example: properties=icon,created,last_modified,creator

追加で取得するプロパティ名集合
以下のプロパティ名を,(カンマ)区切りで列記する
icon: アイコン画像
created: 作成日
last_modified: 更新日
creator: 作成者
(id, name, descriptionプロパティは必ず取得します)

header Parameters
content-type
required
string
Value: "application/json"
content-language
required
string
Enum: "ja" "en"
access-token
string

アクセストークン
トークン・シークレット認証の場合に必要です。

secret-key
string

シークレットキー
トークン・シークレット認証の場合に必要です。

authorization
string
Value: "Bearer {トークン}"

OAuthアクセストークン
OAuth認証の場合に必要です。
値はBearerスキームで記述します。

Responses

200

[OK] BOT一覧がレスポンスされました。

401

[Unauthorized] アクセストークン・シークレットキーが正しくありません。

403

[Forbidden] アクセストークンに参照権限がありません。

413

[Payload Too Large] ペイロードが大きすぎます。

415

[Unsupported Media Type] content-typeが正しくありません。

422

[Unprocessable Entity] リクエスト内容が不正です。

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "bots":
    [
    ]
}

BOT詳細

get /{public_id}/bots/{bot_id}
https://api.c-bot.pro/{public_id}/bots/{bot_id}

BOTの詳細を参照します。
使用するアクセストークンに「参照」権限が付与されている必要があります。

path Parameters
public_id
required
string

APIの公開ID

bot_id
required
string

BOT ID

query Parameters
properties
string
Example: properties=icon,created,last_modified,creator,input,output

追加で取得するプロパティ名集合
以下のプロパティ名を,(カンマ)区切りで列記する
icon: アイコン画像
created: 作成日
last_modified: 更新日
creator: 作成者
input: 入力値定義
outout: 出力値定義
(id, name, descriptionプロパティは必ず取得します)

header Parameters
content-type
required
string
Value: "application/json"
content-language
required
string
Enum: "ja" "en"
access-token
string

アクセストークン
トークン・シークレット認証の場合に必要です。

secret-key
string

シークレットキー
トークン・シークレット認証の場合に必要です。

authorization
string
Value: "Bearer {トークン}"

OAuthアクセストークン
OAuth認証の場合に必要です。
値はBearerスキームで記述します。

Responses

200

[OK] BOT詳細がレスポンスされました。

401

[Unauthorized] アクセストークン・シークレットキーが正しくありません。

403

[Forbidden] アクセストークンに参照権限がありません。

404

[Not Found] BOTが存在しません。

413

[Payload Too Large] ペイロードが大きすぎます。

415

[Unsupported Media Type] content-typeが正しくありません。

422

[Unprocessable Entity] リクエスト内容が不正です。

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "id": "add_item",
  • "name": "商品追加BOT",
  • "description": "商品を登録するBOTです。",
  • "icon": "data:image/png;base64,0000000000",
  • "created": "2020-04-07T06:29:41Z",
  • "last_modified": "2020-04-07T09:41:44Z",
  • "creator": "example@example.com",
  • "input":
    {
    },
  • "output":
    {
    }
}

BOT削除

delete /{public_id}/bots/{bot_id}
https://api.c-bot.pro/{public_id}/bots/{bot_id}

BOTを削除します。
使用するアクセストークンに「編集」権限が付与されている必要があります。

path Parameters
public_id
required
string

APIの公開ID

bot_id
required
string

BOT ID

header Parameters
content-type
required
string
Value: "application/json"
content-language
required
string
Enum: "ja" "en"
access-token
string

アクセストークン
トークン・シークレット認証の場合に必要です。

secret-key
string

シークレットキー
トークン・シークレット認証の場合に必要です。

authorization
string
Value: "Bearer {トークン}"

OAuthアクセストークン
OAuth認証の場合に必要です。
値はBearerスキームで記述します。

Responses

200

[OK] BOTが削除されました。

401

[Unauthorized] アクセストークン・シークレットキーが正しくありません。

403

[Forbidden] アクセストークンに編集権限がありません。

404

[Not Found] BOTが存在しません。

413

[Payload Too Large] ペイロードが大きすぎます。

415

[Unsupported Media Type] content-typeが正しくありません。

422

[Unprocessable Entity] リクエスト内容が不正です。

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 200
}

BOT実行

post /{public_id}/bots/{bot_id}/jobs
https://api.c-bot.pro/{public_id}/bots/{bot_id}/jobs

任意のBOTを実行します。
使用するアクセストークンに「実行」権限が付与されている必要があります。

path Parameters
public_id
required
string

APIの公開ID

bot_id
required
string

BOT ID

header Parameters
content-type
required
string
Value: "application/json"
content-language
required
string
Enum: "ja" "en"
access-token
string

アクセストークン
トークン・シークレット認証の場合に必要です。

secret-key
string

シークレットキー
トークン・シークレット認証の場合に必要です。

authorization
string
Value: "Bearer {トークン}"

OAuthアクセストークン
OAuth認証の場合に必要です。
値はBearerスキームで記述します。

Request Body schema: application/json
timeout
integer [ 0 .. 25000 ]

BOT実行の終了を待機するミリ秒数(未指定の場合は0)
リクエストによってBOTが実行を開始した後、このミリ秒数を経過すると実行が終了していなくてもレスポンスを返します(レスポンスコード202)

callback_endpoint
string <uri>

BOT実行完了時に、このエンドポイント宛に実行結果がPOSTされます。(未指定の場合はコールバック無し)
エンドポイントは、必ずhttps://から始まる必要があります。
エンドポイントの実装要件は「クラウドBOT RESTful API Callback Endpoint 実装要件」を参照してください。

callback_tries
integer [ 0 .. 5 ]

コールバックPOSTの試行回数です。callback_endpointが200系以外のステータスコードをレスポンスした場合またはレスポンスヘッダに正しいアクセストークンが設定されていなかった場合に、指定回数まで試行します。0を指定した場合はコールバックPOSTは行われません。

input
object (datalist_input)

入力値を表すオブジェクトです。(未指定の場合はBOTのデフォルト値が使用されます)
入力値を指定したいデータ名,グループ名を任意数設定します。

Responses

201

[Created] BOT実行が完了しました。

202

[Accepted] BOT実行は継続中です。

401

[Unauthorized] アクセストークン・シークレットキーが正しくありません。

403

[Forbidden] アクセストークンに実行権限がありません。

404

[Not Found] BOTが存在しません。

410

[Gone] BOT実行は中断されました。

413

[Payload Too Large] ペイロードが大きすぎます。

415

[Unsupported Media Type] content-typeが正しくありません。

422

[Unprocessable Entity] リクエスト内容が不正です。

423

[Locked] BOTの実行がロックされています。稼働時間または使用容量が超過しています。

429

[Too Many Requests] BOTの同時実行数の制限を超えたリクエストです。

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "timeout": 20000,
  • "input":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 201,
  • "job_id": "00000000-0000-0000-0000-000000000000",
  • "bot_id": "get_items",
  • "bot_name": "商品取得BOT",
  • "status": 0,
  • "start_time": "2019-12-02T05:30:13Z",
  • "elapsed_time": 6,
  • "output":
    {
    }
}

BOTジョブ一覧

get /{public_id}/bots/{bot_id}/jobs
https://api.c-bot.pro/{public_id}/bots/{bot_id}/jobs

BOTのジョブ一覧を参照します。
使用するアクセストークンに「実行」または「参照」権限が付与されている必要があります。

レスポンスサイズが4MBを超える場合は400エラーをレスポンスします。

path Parameters
public_id
required
string

APIの公開ID

bot_id
required
string

BOT ID

query Parameters
properties
string
Example: properties=output

追加で取得するプロパティ名集合
以下のプロパティ名を,(カンマ)区切りで列記する
output: 出力値オブジェクト
(job_id,bot_id,bot_name,status,start_time,elapsed_timeプロパティは必ず取得します)

limit
integer >= 0
Example: limit=10

アイテムの取得件数上限