rawListScreeningHistories
この関数は特定の企業アカウント向けに提供しています。それ以外の企業アカウントでは利用できません。
rawListScreeningHistories は、審査ステータスの変更履歴を、審査・変更前後のステータス・変更日時で絞り込んで取得する関数です。
基本的な使い方
以下は、指定した期間に特定のステータスから別のステータスへ変更された履歴をすべて取得する例です。
1回の呼び出しで取得できる件数はfirstで指定した件数までのため、pageInfo.hasNextPageがfalseになるまでpageInfo.endCursorをafterに渡して続きを取得します。
import { rawListScreeningHistories } from "@basemachina/action";
/** @type { import("@basemachina/action").Handler } */
export default async ({ screeningID, fromStatusIDs, toStatusIDs }) => {
const histories = [];
let after = undefined;
while (true) {
const result = await rawListScreeningHistories(
{
screeningID,
fromStatusIDs,
toStatusIDs,
createdAtFrom: "2026-10-01T00:00:00+09:00",
createdAtTo: "2026-11-01T00:00:00+09:00",
},
{ first: 1000, after },
);
histories.push(...result.histories);
if (!result.pageInfo.hasNextPage) {
break;
}
after = result.pageInfo.endCursor;
}
return histories;
};詳細なインターフェース
引数
| 引数名 | 型 | 必須 ・ 任意 | 説明 | 例 |
|---|---|---|---|---|
input | object | 必須 | 絞り込みの条件。 | |
input.screeningID | string | 必須 | 審査のID。 | 'c3hc2ii23akg0sokf9j0' |
input.fromStatusIDs | string[] | 必須 | 変更前のステータスのID。1件以上100件以下で、screeningIDの審査のステータスを指定してください。いずれかのステータスから変更された履歴を取得します。 | ['c3hc2ii23akg0sokf9k0'] |
input.toStatusIDs | string[] | 必須 | 変更後のステータスのID。1件以上100件以下で、screeningIDの審査のステータスを指定してください。いずれかのステータスへ変更された履歴を取得します。 | ['c3hc2ii23akg0sokf9kg'] |
input.createdAtFrom | string | 必須 | 変更日時の始まり。この日時ちょうどの履歴を含みます。RFC 3339形式の日時を指定してください。 | '2026-10-01T00:00:00+09:00' |
input.createdAtTo | string | 必須 | 変更日時の終わり。この日時ちょうどの履歴は含みません。RFC 3339形式で、createdAtFromより後の日時を指定してください。 | '2026-11-01T00:00:00+09:00' |
pagination | object | 必須 | 取得する範囲。 | { first: 1000 } |
pagination.first | number | 必須 | 取得する件数。1以上1000以下の整数を指定してください。 | 1000 |
pagination.after | string | 任意 | 前回の呼び出しで返されたpageInfo.endCursor。指定すると、その続きから取得します。 | '1790000000_c3hc2ii23akg' |
createdAtFromとcreatedAtToには、1970年1月1日から2106年2月7日までの日時を指定できます。
戻り値
| プロパティ名 | 型 | 説明 | 例 |
|---|---|---|---|
histories | object[] | 審査ステータスの変更履歴。変更日時の古い順に並びます。 | |
histories[].id | string | 変更履歴のID。 | 'c3hc2ii23akg0sokf9l0' |
histories[].userName | string | ステータスを変更したユーザーの名前。自動判定による変更では'システム'、削除されたユーザーによる変更では'削除済みのユーザー'になります。 | '山田太郎' |
histories[].fromStatus.id | string | 変更前のステータスのID。 | 'c3hc2ii23akg0sokf9k0' |
histories[].toStatus.id | string | 変更後のステータスのID。 | 'c3hc2ii23akg0sokf9kg' |
histories[].createdAt | string | ステータスを変更した日時。RFC 3339形式の文字列です。 | '2026-10-15T10:30:00+09:00' |
histories[].customEntity.id | string | 審査対象のエンティティのID。 | 'c3hc2ii23akg0sokf9m0' |
histories[].customEntity.keyValues | object[] | 審査対象のエンティティのキーと値。 | |
histories[].customEntity.keyValues[].key | object | キーのID(id)と識別子(displayID)。 | { id: '…', displayID: '…' } |
histories[].customEntity.keyValues[].value | string | キーの値。 | '12345' |
pageInfo.hasNextPage | boolean | 続きの履歴があるかどうか。 | true |
pageInfo.endCursor | string | null | 続きを取得するときにpagination.afterへ渡す値。 |
エラー
次の場合はエラーをthrowします。
screeningIDの審査が見つからないfromStatusIDs・toStatusIDsにscreeningIDの審査のステータスでないIDが含まれているfromStatusIDs・toStatusIDsの件数、createdAtFrom・createdAtToの日時、firstの値が上記の範囲外であるafterの形式が正しくない