I was wondering if it is possible for a specific page id, to retrieve for each of its content state change, its authorId and date of change.
Heres's the code:
import requests
from requests.auth import HTTPBasicAuth
import json
your_domain = xxx
page_id = xxxx
api_token = xxx
url = f"https://{your_domain}/wiki/api/v2/pages/{page_id}/properties"
auth = HTTPBasicAuth("email", api_token)
headers = {
"Accept": "application/json"
}
response = requests.request(
"GET",
url,
headers=headers,
auth=auth, params={"limit":10}
)
response.json()
# print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
'''
Output:
{'results': [{'value': 'v2', 'key': 'editor', 'id': xxx, 'version': {'number': 1, 'message': '', 'minorEdit': False, 'authorId': 'xxxx', 'createdAt': '2023-06-03T00:20:36.036Z'}}, {'value': '{"contentState":{"id":xxx,"color":"#2684ff","name":"Under construction"},"version":5,"isSpaceState":true,"isNewState":false,"setterAAID":"xxxx"}', 'key': 'content-state-published', 'id': xxx, 'version': {'number': 4, 'message': '', 'minorEdit': False, 'authorId': 'xxx', 'createdAt': '2023-06-03T00:37:55.648Z'}}, {'value': '{"contentState":{"id":xxxx,"color":"#2684ff","name":"Under Construction"},"version":4,"isSpaceState":true,"isNewState":false,"setterAAID":"xxx"}', 'key': 'content-state-draft', 'id': xxx, 'version': {'number': 3, 'message': '', 'minorEdit': False, 'authorId': 'xxx', 'createdAt': '2023-06-03T00:37:53.733Z'}}], '_links': {}}
Desired output:
my response comes with the following field:
'_link' : {'next': url-cursor-key-number-here'}
I'm also open to other ways as long it uses API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.