I’m trying to retrieve user email from Bitbucket cloud users API without success.
This is my code snippet:
const approverDetails = await api.asApp().requestBitbucket(
route `/2.0/users/${approver.uuid}`
).then(response => {
console.log(
`approverDetailsResponse: ${response.status} ${response.statusText}`
);
return response.text();
})
.then(text => JSON.parse(text))
.catch(err => console.error(err));
${approver.uuid}
is already surrounded by curly braces: {8968xxxx-xxxx-xxxx-xxxx-xxxxxxxxe2d7}
.
I’m getting the error below:
ERROR 12:52:31.558 98d59cf4-7b36-41b1-abae-aa9447a523bd PROXY_ERR: Forge platform failed to process runtime HTTP request - 400 - INVALID_TARGET_URL
at handleProxyResponseErrors (webpack://bitbucket-merge-check/node_modules/@forge/api/out/api/fetch.js:83:1)
at <anonymous> (webpack://bitbucket-merge-check/node_modules/@forge/api/out/api/fetch.js:28:1)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at Object.run (webpack://bitbucket-merge-check/src/index.js:42:1)
at async /tmp/forge-tunnel-59258-tGTsvok2wd42/index.cjs:2:583140
at async process.<anonymous> (/home/ggorge-etiqa/.nvm/versions/node/v18.17.1/lib/node_modules/@forge/cli/node_modules/@forge/tunnel/out/sandbox/sandbox-runner.js:7:20) {
status: 400,
errorCode: 'INVALID_TARGET_URL'
}