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.
I'm also needed help on Tempo Accounts Rest API.
The guide is not very intuitive.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.