Fetching Scan History

You can use GET /v0/passes/{passId} to fetch information about a pass.

If you supply a scanHistoryStartTime and/or scanHistoryEndTime to the request, the response will
also include a scanHistory object, which will list the timestamps and encoded message of each scan.

NOTE: The start and end times must be in unix timestamp format. This converter
makes it very easy to convert a date and time to unix timestamps.

const passId = "f664196b-035a-454d-90c4-ab0adc107981";
const scanHistoryStartTime = "1662680045"; // Thu Sep 08 2022 19:34:05 Eastern Daylight Time
const scanHistoryEndTime = "1663198445"; // Wed Sep 14 2022 23:34:05 Eastern Daylight Time

const response = await fetch(
  `https://api.ethpass.xyz/api/v0/passes/${passId}`,
  {
    method: "POST",
    body: JSON.stringify(payload),
    headers: new Headers({
      "content-type": "application/json",
      "X-API-KEY": "YOUR_SECRET_API_KEY",
    }),
  }
);