StatusEntry
Search…
How to use StatusEntry API key pairs to authenticate your request
When you generate your API key pair, you will see your Access Key and Secret Key. Using these keys, you need to generate an Authorization header so that we can understand who is making this request and perform authorization controls for that user for the relevant operation.
The generated "Authorization" header should be generated using the below format:
"StatusEntry ${Access_Key}:${Signed_Key}"
You know your access "Access_Key " after you generate the key pair.
Here is how you should generate your "Signed_Key" using your access and secret keys:
You need to generate a signed JWT token using your secret key to produce "Signed_Key" by setting the below fields:
1
{
2
"iss": "${access_key}",
3
"exp": 1641170086,
4
"aud": "www.statusentry.com"
5
}
Copied!
An example java code using this jwt library is as follows:
1
String accessKey = "AK123";
2
String secretKey = "SK456";
3
String relativeRequestUrl = "/v1/incidents";
4
String signedKey = Jwts.builder()
5
.setIssuer(accessKey)
6
.setIssuedAt(Date.from(Instant.now()))
7
.setExpiration(Date.from(Instant.now().plus(1, ChronoUnit.DAYS)))
8
.setAudience("www.statusentry.com")
9
.signWith(SignatureAlgorithm.HS256, secretKey.getBytes(StandardCharsets.UTF_8))
10
.compact();
Copied!
An example generated Authorization header is as follows:
StatusEntry AK5147f230-f237-461e-86b2-23b834c3a697:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBSzUxNDdmMjMwLWYyMzctNDYxZS04NmIyLTIzYjgzNGMzYTY5NyIsImlhdCI6MTYwOTYzMDk5NCwiZXhwIjoxNjQxMTcwMDg2LCJhdWQiOiJ3d3cuc3RhdHVzZW50cnkuY29tIiwic3ViIjoiL3YxL2luY2lkZW50cy81OTk2Nzc2ZC0yMWQxLTRkNzItOTJiZS03NTE3YTM1NWNhOTYifQ.MYK8VWWmV_pWikL1IB6V6W7KHkpEEYnQ5MikTcskwPg
You can find popular JWT libraries to use for your development language here.
Last modified 10mo ago
Copy link