Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

403 Forbidden Error When Accessing Assets API to Retrieve Object Schemas

Gestionnaire doublons April 8, 2025

 

 

I’m encountering a 403 Forbidden error when attempting to access the /rest/assetapi/objectschema endpoint of the Assets API on our Jira Service Management instance. This prevents me from retrieving the list of object schemas via a Python script or manual requests.

Details of the Issue:

  • Method: GET
  • Authentication: Using an API token with my email (your@email.com) via the Authorization: Basic header.

 

Error Received:

 

403 Client Error: Forbidden

 

2 answers

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2025

Hi @Gestionnaire doublons 

Welcome to the community.

What is the API you trying to make.

This is not and API endpoint: /rest/assetapi/objectschema

The endpoint to retrieve object schemas is: https://api.atlassian.comjsm/assets/workspace/<workspace_id>/v1/objectschema/list

See Assets Cloud API, https://developer.atlassian.com/cloud/assets/ 

 

Gestionnaire doublons April 8, 2025

i @Marc - Devoteam Thank you for your response  it's solve my problem

Like Marc - Devoteam likes this
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2025

Hi @Gestionnaire doublons 

Please accept my answer as a solution, if my answer helped to solve your request.

This will help other community member trying to solve the same.

0 votes
Nikola Perisic
Community Champion
April 8, 2025

Welcome @Gestionnaire doublons 

This could be due to lack of permissions for your object schema. The whole guide could be found here: https://confluence.atlassian.com/servicemanagementserver0503/configuring-roles-and-permissions-1167849898.html

You need to be a Jira admin to be able to assign users or groups to a specific role in Assets.

 

Gestionnaire doublons April 8, 2025

Thank you for your response and for pointing me to the guide on configuring roles and permissions in Jira Service Management: Configuring Roles and Permissions. I’ve reviewed the documentation, and it seems that the 403 Forbidden error I’m encountering is indeed due to a lack of permissions for the object schemas in Assets.

As confirmed earlier, my authentication is working correctly—I can successfully access the /rest/api/3/myself endpoint and retrieve my user details (your@email.com). However, when attempting to access /rest/assetapi/objectschema to list the object schemas, I still receive a 403 Forbidden error. This suggests that my account does not have the necessary roles assigned in Assets, such as Object Schema Managers or Users, which are required to interact with these endpoints.

The guide indicates that assigning users or groups to specific roles in Assets requires Jira admin privileges, which I don’t currently have. Could you please assist with the following:

  1. Verify whether my account (your@email.com) has any roles assigned in Assets (e.g., Object Schema Managers, Users, or Developers) for any schema.
  2. If not, please assign me to the Object Schema Managers role for at least one schema (or all schemas, if appropriate) so I can access the /rest/assetapi/objectschema endpoint and retrieve the schema IDs and associated assets.
  3. Let me know once this is done so I can retest and confirm resolution.

Here’s the PowerShell script I’m using for reference:

$jiraUrl = "https://idcam.atlassian.net"
$email = "your@email.com"
$apiToken = "your_api_token"
$auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${email}:${apiToken}"))

$headers = @{
"Authorization" = "Basic $auth"
"Accept" = "application/json"
}

try {
$response = Invoke-RestMethod -Uri "$jiraUrl/rest/assetapi/objectschema" -Headers $headers -Method Get
Write-Output $response
} catch {
Write-Output "Error: $($_.Exception.Response.StatusCode.Value__) - $($_.Exception.Message)"
}

I’d appreciate your help in resolving this, as I need access to the Assets data for [briefly state your purpose, e.g., "inventory management" or "script automation"]. If this requires further escalation or clarification, please let me know what additional details I can provide.

Looking forward to your assistance!

Best regards,

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2025

Hi @Gestionnaire doublons 

See my reply, you are using the wrong API endpoint.

This is the objectschema API endpoint for assets obecjeschemas in Cloud.

Gestionnaire doublons April 8, 2025

Very thank @Marc - Devoteam 

Suggest an answer

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

Atlassian Community Events