I'm new to atlassian and learning its APIs to build apps.
Ever I developed a MVP app for JIRA used RESTful API like:
```node.js
const res = await api.asUser().requestJira(route`/rest/api/2/issue/${key}/comment`, {
headers: {
'Accept': 'application/json'
}
});
const data = await res.json();
```
It works without any error.
Then I was trying to make an example code to work from official `Build a Confluence keyword extractor with Forge and OpenAI`
It uses RESTful APIs for Confluence:
```node.js
const response = await asUser().requestConfluence(route`/wiki/api/v2/pages/${payload.contentId}?body-format=storage`, { headers: { 'Accept': 'application/json' } });
```
It does not work as before! I see the error throw in the console log:
```
Uncaught (in promise) Error: There was an error invoking the function - Error while getContent with contentId 12156995: 401 Unauthorized
```
After some searches from the community, seems like that if you want to use RESTful APIs you should put your AUTHENTATION headers in the APIs call.
But I'm confusing why JIRA's RESTful APIs don't need the `Authentation` header and Confluence RESTful APIs must have ?
If I'm wrong, so what's the best practice to make RESTful APIs call, and how to correct the `401` Unauthorized error.
Thanks in advance! 