Skip to content

Instantly share code, notes, and snippets.

@mairh
Last active February 12, 2024 14:29
Show Gist options
  • Save mairh/bcc2d62dc440f7ce44bc7a3bdafea0c3 to your computer and use it in GitHub Desktop.
Save mairh/bcc2d62dc440f7ce44bc7a3bdafea0c3 to your computer and use it in GitHub Desktop.
EM3. Example of API request
// We received HMAC and timestamp earlier, see example https://gist.github.com/mairh/14e260082abc13d7e20fff0587a622ab
// Route: GET /orders
const searchParams = new URLSearchParams({
page: "1", // page number for fetch
signature: cryptoHmac,
});
const headers = new Headers({ "fetch-time": String(timestamp) });
const response = await fetch(
`${apiUrl}/${kela}/orders${searchParams.toString()}`,
{
headers,
method: "GET",
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment