Forums

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

Can't use post method for Tempo Accounts REST API 3.0.0

alpo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 18, 2018

Hey guys, I was trying to use a POST method for account creation as it was suggested in documentation, but instead of actual creation I always GET the same as I just send the get method.

Here the code snippet written on Python of what I'm trying to do:

username = '...'
password = '...'
jiraURL = 'http://{my jira base url}'

searchAPI = jiraURL + '/rest/tempo-accounts/1/account/'
text = {
"rateTable": None,
"links": None,
"global": False,
"category":
{
"id": {id},
"key": {key}
"name": "Customer Paid Billable",
"isNew": False,
"accountCount": None,
"new": False,
"categoryType": None
},
"customer":
{
"id": {id},
"key": {key},
"name": {name},
"isNew": False,
"accountCount": None,
"new": False
},
"monthlyBudget": None,
"status": "CLOSED",
"contactAvatar": None,
"contact": None,
"leadAvatar": None,
"name": "string",
"key": "string",
"id": {id},
"lead":
{
"key": {key},
"username": {username},
"name": {name},
"active": True,
"emailAddress": {email},
"displayName": {name},
"avatarUrls": None
}
}
response = requests.post(searchAPI, auth=(username, password), data=text)
data = response.json()

 

And doing print(data) I get the same if I do just:

response = requests.get(searchAPI, auth=(username, password))
data = response.json()

i.e. all accounts I have in tempo

 

What I'm doing wrong? Thanks.

 

1 answer

0 votes
Bao Bui
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 24, 2018

I'm also needed help on Tempo Accounts Rest API.

The guide is not very intuitive. 

Suggest an answer

Log in or Sign up to answer