I am trying to implement the personal data reporting API
I am building a Connect app and using JWT for authentication
The code I am using is the following (node.js)
import * as ajwt from "atlassian-jwt"
const now = moment().utc();
const req = ajwt.fromMethodAndUrl('POST', '/rest/atlassian-connect/latest/report-accounts');
const tokenData = {
iss: MY_APP_KEY,
iat: now.unix(), // The time the token is generated
exp: now.add(3, 'minutes').unix(), // Token expiry time (recommend 3 minutes after issuing)
qsh: ajwt.createQueryStringHash(req), // [Query String Hash](https://developer.atlassian.com/cloud/jira/platform/understanding-jwt/#a-name-qsh-a-creating-a-query-string-hash)
};
const jwt = ajwt.encodeSymmetric(tokenData, sharedSecret);
const Authorization = `JWT ${jwt}`;
const res = await axios.post("https://mydomain.atlassian.net/rest/atlassian-connect/latest/report-accounts", body, { headers: { Authorization } });
This is returning 401 with no additional information. Am I doing something wrong ?