Skip to Content

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; };

詳細なインターフェース

引数

引数名型必須 ・ 任意説明例
inputobject必須絞り込みの条件。
input.screeningIDstring必須審査のID。'c3hc2ii23akg0sokf9j0'
input.fromStatusIDsstring[]必須変更前のステータスのID。1件以上100件以下で、screeningIDの審査のステータスを指定してください。いずれかのステータスから変更された履歴を取得します。['c3hc2ii23akg0sokf9k0']
input.toStatusIDsstring[]必須変更後のステータスのID。1件以上100件以下で、screeningIDの審査のステータスを指定してください。いずれかのステータスへ変更された履歴を取得します。['c3hc2ii23akg0sokf9kg']
input.createdAtFromstring必須変更日時の始まり。この日時ちょうどの履歴を含みます。RFC 3339形式の日時を指定してください。'2026-10-01T00:00:00+09:00'
input.createdAtTostring必須変更日時の終わり。この日時ちょうどの履歴は含みません。RFC 3339形式で、createdAtFromより後の日時を指定してください。'2026-11-01T00:00:00+09:00'
paginationobject必須取得する範囲。{ first: 1000 }
pagination.firstnumber必須取得する件数。1以上1000以下の整数を指定してください。1000
pagination.afterstring任意前回の呼び出しで返されたpageInfo.endCursor。指定すると、その続きから取得します。'1790000000_c3hc2ii23akg'

createdAtFromとcreatedAtToには、1970年1月1日から2106年2月7日までの日時を指定できます。

戻り値

プロパティ名型説明例
historiesobject[]審査ステータスの変更履歴。変更日時の古い順に並びます。
histories[].idstring変更履歴のID。'c3hc2ii23akg0sokf9l0'
histories[].userNamestringステータスを変更したユーザーの名前。自動判定による変更では'システム'、削除されたユーザーによる変更では'削除済みのユーザー'になります。'山田太郎'
histories[].fromStatus.idstring変更前のステータスのID。'c3hc2ii23akg0sokf9k0'
histories[].toStatus.idstring変更後のステータスのID。'c3hc2ii23akg0sokf9kg'
histories[].createdAtstringステータスを変更した日時。RFC 3339形式の文字列です。'2026-10-15T10:30:00+09:00'
histories[].customEntity.idstring審査対象のエンティティのID。'c3hc2ii23akg0sokf9m0'
histories[].customEntity.keyValuesobject[]審査対象のエンティティのキーと値。
histories[].customEntity.keyValues[].keyobjectキーのID(id)と識別子(displayID)。{ id: '…', displayID: '…' }
histories[].customEntity.keyValues[].valuestringキーの値。'12345'
pageInfo.hasNextPageboolean続きの履歴があるかどうか。true
pageInfo.endCursorstring | null続きを取得するときにpagination.afterへ渡す値。

エラー

次の場合はエラーをthrowします。

  • screeningIDの審査が見つからない
  • fromStatusIDs・toStatusIDsにscreeningIDの審査のステータスでないIDが含まれている
  • fromStatusIDs・toStatusIDsの件数、createdAtFrom・createdAtToの日時、firstの値が上記の範囲外である
  • afterの形式が正しくない