Last active
February 12, 2024 14:29
-
-
Save mairh/bcc2d62dc440f7ce44bc7a3bdafea0c3 to your computer and use it in GitHub Desktop.
EM3. Example of API request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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