提供: Bright Pattern Documentation
• English
getVariables
指定された変数セットの値を、BPCCサーバーのシナリオから取得します。interactionIdの値が指定されていない場合、システムはアクティブなインタラクションの変数を取得します。
リクエスト
構文
| getVariables(keys: string[], interactionId?: string): Promise<OperationResult<Record<string, string>>> |
パラメータ
| パラメータ | パラメータ値 | データ型 | オプション/必須 | 説明 |
| keys | 文字列[] | 必須 | 対応する値を取得したいシナリオ変数名のリストです。 | |
| interactionId | 文字列 | オプション | 特定の変数の値を取得したいインタラクションの id です。id が指定されていない場合は、現在アクティブなインタラクションが使用されます。 |
リクエスト例
adApi.getVariables(["サービスの名前", "サービスのバージョン", "ewt"]).then(result => {
if (result.status === "成功") {
const serviceName = result.data["サービス.名前"]
const serviceVersion = result.data["サービス.バージョン"]
const serviceEWT = result.data["サービス.ewt"]
} else {
console.error("エラーが発生しました:", result.error.message)
}
})
戻り値
| オブジェクト | オブジェクトの値 | データ型 | オプション?
(はい/いいえ) |
値の説明 |
| 結果 | 変数名 | Record<string, string> | Y | 要求されたシナリオ変数のキーと値のペアを含むオブジェクトです。 |