Files
Gainsight/Scripts/Backup_Notes_Scripts/notestoconfluence.py

50 lines
1.1 KiB
Python
Raw Permalink Normal View History

2022-09-20 16:29:23 -04:00
import requeearts
2022-09-16 15:43:56 -04:00
# Create a new page from API Docs
2022-09-20 16:29:23 -04:00
# This is in bash
2022-09-16 15:43:56 -04:00
curl -u admin:admin -X POST -H 'Content-Type: application/json' -d '{"type":"page","title":"new page",
"space":{"key":"TST"},"body":{"storage":{"value":"<p>This is <br/> a new page</p>","representation":
"storage"}}}' http://localhost:8080/confluence/rest/api/content/ | python -mjson.tool
2022-10-03 18:59:40 -04:00
# This is an example of updating content
PUT /rest/api/content/456
{
"version": {
"number": 2
},
"title": "My new title",
"type": "page",
"body": {
"storage": {
"value": "<p>New page data.</p>",
"representation": "storage"
}
}
}
2022-09-20 16:29:23 -04:00
# This is a Northpas example in python
import requests
url = "https://api.northpass.com/v2/people/person_uuid/deactivations"
headers = {"accept": "*/*"}
response = requests.post(url, headers=headers)
print(response.text)
# Confluence example in Python
import requests
url = "http/"
2022-09-16 15:43:56 -04:00
import requests
url = "https://api.northpass.com/v2/activities"
headers = {"accept": "application/json"}
response = requests.get(url, headers=headers)
2022-10-03 18:59:40 -04:00
pagename = file(read file)
title = filename
value = file.read()
2022-09-16 15:43:56 -04:00