Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Download all assets by aql

Roman Kern March 1, 2024

OK, it seems that community will/can not help. Guess the main problem ist the check of the request token validity, since the request was not created by the url I've put into the dev portal

 

Hello, 

it is possible to download all assets by AQL without OAuth 2? I know that the basic API is deprecated. The OAuth process is not made for automations (external access to jira). Currently I'm just facing the problem with athentication/authorization. I can create a bearer token, but API returns 401

 

Do someone have any clues?

POST https://api.atlassian.com/jsm/assets/workspace/{{WorkspaceId}}/v1/object/navlist/aql

body

{
  "objectTypeId": "296",
  "page": 1,
  "asc": 1,
  "resultsPerPage": 25,
  "includeAttributes": false,
  "objectSchemaId": "7",
  "qlQuery": "some query bla bla"
}

Response:

{"code":401,"message":"Unauthorized"}

 

{
"kid": "auth.atlassian.com-ACCESS-*",
"alg": "RS256"
}.{
"jti": "d*",
"sub": "*",
"nbf": 1709305554,
"iss": "https://auth.atlassian.com",
"iat": 1709305554,
"exp": 1709309154,
"aud": "*",
"https://atlassian.com/systemAccountEmail": "*@connect.atlassian.com",
"client_id": "*",
"https://id.atlassian.com/atl_token_type": "ACCESS",
"https://atlassian.com/firstParty": false,
"https://id.atlassian.com/ujt": "*",
"https://atlassian.com/verified": true,
"https://id.atlassian.com/processRegion": "us-east-1",
"https://id.atlassian.com/session_id": "*",
"https://atlassian.com/orgId": "*",
"https://atlassian.com/3lo": true,
"https://id.atlassian.com/verified": true,
"https://atlassian.com/emailDomain": "*",
"scope": "read:cmdb-object:jira read:cmdb-schema:jira read:cmdb-type:jira read:cmdb-attribute:jira",
"https://atlassian.com/systemAccountId": "*",
"https://atlassian.com/oauthClientId": "*",
"https://atlassian.com/systemAccountEmailDomain": "connect.atlassian.com"
}.[Signature]

 

 

the accessible resource should be fine

https://api.atlassian.com/oauth/token/accessible-resources

[
    {
        "id": "***-37d6-4931-a7b9-***",
        "url": "https://*.atlassian.net",
        "name": "*",
        "scopes": [
            "read:cmdb-object:jira",
            "read:cmdb-schema:jira",
            "read:cmdb-type:jira",
            "read:cmdb-attribute:jira"
        ],
    }
]

2 answers

1 accepted

0 votes
Answer accepted
Roman Kern March 5, 2024

can someone help? Do anyone use the API at all?

0 votes
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2024

@Roman Kern -

Welcome to the community, please see this reference on how to use Token for REST APIs auth -

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

the token needs to be passed as a header value -H "Authorization: Bearer <Token>"

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

Roman Kern April 3, 2024

sorry, the basic token api is deprecated, won't work

Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2024

@Roman Kern -

If you use my suggestion on the syntax using the Bearer token, then it will work.

Best, Joseph

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events