Skip to content

bjbishop/confluence_page_updater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adding a label

# Add a label to a page
import requests
import json
import getpass
import subprocess

url = "https://confluence.assessment.pearson.com/rest/api/content/19742133/label"
username = getpass.getuser()
password = subprocess.getstatusoutput('security -q find-generic-password -l epic -w')[1]
auth = (username, password)

headers = { "content-type": "application/json" }

data = [
    {
	  "prefix": "global",
	  "name": "TESTING3"
    }
]

data_json = json.dumps(data)

response = requests.post(
    url,
    auth=auth,
    data=data_json,
    headers = headers,
)

response.raise_for_status()
print(response.json())

Deleting a label

# Add a label to a page
import requests
import getpass
import subprocess

url = "https://confluence.assessment.pearson.com/rest/api/content/19742133/label/testing3"
username = getpass.getuser()
password = subprocess.getstatusoutput('security -q find-generic-password -l epic -w')[1]
auth = (username, password)

response = requests.delete(
    url,
    auth=auth,
)

response.raise_for_status()
print(response)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages