I am doing a lot of page updates with Confluence REST API. Sometimes I get an HTTP 409, but I don't understand what is the cause and how to avoid it.
V6.2.1
My python code is:
def getPageByID (id):
r = requests.get(BASE_URL + 'content',
{'id': id,
'expand': 'version',
},
verify = False, auth = AUTH,
)
try:
version = r.json()['results'][0]['version']['number']
except IndexError:
print ('ERROR: page not found ({}, {})'.format (id))
return r
return (version)
def updatePage(pageID, newtitle, newtext):
version = int(getPageByID(pageID)) + 1
return requests.put(BASE_URL + 'content/' + pageID,
verify = False, auth = AUTH,
json = {
"id": pageID,
"type": "page",
"title": newtitle,
"body": {
"storage":{
"value": newtext,
"representation":"storage"
},
},
"version": {
"number": version,
}
}
)
Wondering this as well, did you find a reason?
Hi!
Please, have a look here a few solutions
https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/confluence.py
Also, I will be happy for new Pull Requests.
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.