atlassian-python-api
atlassian-python-api copied to clipboard
[JIRA] 403 error when creating JIRA organization using python REST API
Hello Expert, I am new to Atlassian products (currently using Trial version) and trying to create a JIRA organization using REST API (in Python) as defined in the below document in step 2).
- As the first step, I had used this https://support.siteimprove.com/hc/en-gb/articles/360004317332-How-to-create-an-API-token-from-your-Atlassian-account to create API token and used it for doing step 2)
2)Trying to create JIRA organization using :
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-post
while testing this, I am getting: Response [403] = Returned if the user does not have permission to complete this request i.e as per my understanding; the API token created in step 1) do not have right permission
Can someone advise me if there is any other kind of API token that needs to be created for this ? and if so, can someone navigate me to the right documentation of that API token creation process.
Code to create JIRA Org :
def create(self, name):
url = f"{self.instanceUrl}/rest/servicedeskapi/organization"
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
input_name = json.dumps( {
"name": "test-organisation"
} )
response = self.session.post(
url,
data=input_name,
timeout=int(self.timeout)
)
return response