Secure API authentication guide
orgId
.expiresIn
).orgId
, representing the organization ID.expiresIn
option specifies that the token will expire in 1 hour.generateJWT
function (a placeholder for the actual JWT generation method) creates the token using the provided payload, key, and options.Content-Type
and Authorization
headers in your request. The Authorization
header should include the generated JWT token prefixed with Bearer
.Content-Type
is set to application/json
, and the Authorization
header includes the generated JWT token.fetchData
function makes an asynchronous GET request to the specified API endpoint and logs the response.ORG_ID
and PRIVATE_KEY
) are correctly set up before running the code.