Hi,
we are aggregating and analysing server logs with graylog. Now we like to create jira issues for certain events.
We like to solve this using oAuth2 access via the developer console following this instructions: https://support.atlassian.com/jira/kb/how-to-use-oauth20-in-postman-client-for-jira-cloud-apis/
Authorisation already works
But i have trouble putting the request URL together. In step 3 the documentation tells me to use a site id for the xxx in the request URL. I don't know what the site id is. I tried than using the app id from the oauth app i created in the developer console. This didn't work.
My Request Example:
I substituted the xxx with the app id, as i dont know yet what a site id is.
curl --location 'https://api.atlassian.com/ex/jira/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/rest/api/2/project' \
--header 'Accept: application/json' \
--header 'Authorization: ••••••'
The response
{
"timestamp": "2025-05-13T08:41:24.618827397Z",
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/ex/jira/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/rest/api/2/project"
}
Permissions
classic scope
- read:jira-work
- manage:jira-project
- write:jira-work
granular scope
- read:issue:jira
- write:issue:jira
- read:project:jira
- write:project:jira
- read:issue:jira-software
- write:issue:jira-software
Hello @Jens, It's important to mention that the site ID (also known as cloud ID or Tenant ID) is a unique identifier for your Jira cloud instance. It is not the same as the app ID you created in the developer console. You can find your cloud ID from the admin console following the steps on this page here.
Hi Abdallah,
thx for the explanation. I got the site id with https://###########.atlassian.net/_edge/tenant_info
But, even with the correct site id in my request, i still get a 404 while asking for project or issue:
curl --location 'https://api.atlassian.com/ex/jira/#######-#####-####-####-##########/rest/api/2/project' \
--header 'Accept: application/json' \
--header 'Authorization: ••••••'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I beleive you're using the incorrect API endpoint; you can rely on this page here for Jira APIs, for example, to get the Projects on your site:
https://xxxx.atlassian.net/rest/api/3/project, using your site name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using https://xxxx.atlassian.net/rest/api/3/project with oauth2 Authentification gets me an 401 Unauthorized
The documentation i used https://support.atlassian.com/jira/kb/how-to-use-oauth20-in-postman-client-for-jira-cloud-apis/ states in step 3 this structure for the REST URL: https://api.atlassian.com/ex/jira/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/rest/api/2/project
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Aha, I tested as well with OAuth 2.0 token following the same steps and I was able to get the projects:
Make sure that you add the Authorization header as Bearer <token>
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When i am accessing the API with https://api.atlassian.com/ex/jira/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/rest/api/2/project the authentification is successful.
The Problem is that i can't access any ressources. Maybe i did something wrong with the permissions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, i now tried using REST Access with an API Key. First a used the same scopes as with the oauth 2 approach. That gets me an 404. Then i tried the deprecated API Key without scopes. And that gets me data. So there is something wrong with my scopes.
This works with API-Key without scopes:
POST https://#######.atlassian.net/rest/api/3/issue/
Authorization: Basic ##########
Content-Type: application/json
{
"fields": {
"project":{
"id":"#####"
},
"summary": "Main order flow broken",
"issuetype": {
"id": "10001"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.