I'm trying to move pages programatically from one place in the hierarchy to another. Some claim this can't be done and others claim to have done it with something like this;
url = "https://foobar.atlassian.net/wiki/rest/api/content/1147126"
payload = json.dumps(
{"id":1147126,
"type":"page",
"title":"My page 8",
"ancestors":[{"id":1378762}],
"space":{"key":"CD"},
"version":{"number":4}})
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
r = requests.request("PUT", url, data=payload, headers=headers, auth=auth)
print(r.ok , r.status_code , r.reason, r.url)
jl = json.loads(r.text)
jl
When I run this, I get:
True 200 OK https://foobar.atlassian.net/wiki/rest/api/content/1147126
But, in fact, the page is still in the same place when I refresh.
Can anybody help?