Has anybody had any luck updating Lookandfeel via REST API - from Python.
I used the template from the API documentation and NULLED the values which could not be retrieved via a GET earlier.
However, I keep getting a JSON decode error, since no data is returned / the call fails (405)
Does anyone know why the call fails here?:
import requests
from requests.auth import HTTPBasicAuth
import json
url = "https://{myurl}/wiki/rest/api/settings/lookandfeel"
auth = HTTPBasicAuth("mymail", "myToken")
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
payload = json.dumps( {
"headings": {
"color": "#172b4d"
},
"links": {
"color": "#0052cc"
},
"menus": {
"hoverOrFocus": {
"backgroundColor": "#3572b0"
},
"color": "#333333"
},
"header": {
"backgroundColor": "#0747A6",
"button": {
"backgroundColor": "#3572b0",
"color": "#ffffff"
},
"primaryNavigation": {
"color": "#ffffff",
"highlightColor": None,
"hoverOrFocus": {
"backgroundColor": "#3572b0",
"color": "#ffffff"
}
},
"secondaryNavigation": {
"color": "#333333",
"highlightColor": "#0747A6",
"hoverOrFocus": {
"backgroundColor": "#3572b0",
"color": "#ffffff"
}
},
"search": {
"backgroundColor": "rgba(0, 0, 0, 0.2)",
"color": "#ffffff"
}
},
"horizontalHeader": {
"backgroundColor": "#f3f2f1",
"button": {
"backgroundColor": None,
"color": None
},
"primaryNavigation": {
"color": None,
"highlightColor": "#b00b23",
"hoverOrFocus": {
"backgroundColor": None,
"color": None
}
},
"secondaryNavigation": {
"color": None,
"highlightColor": None,
"hoverOrFocus": {
"backgroundColor": None,
"color": None
}
},
"search": {
"backgroundColor": None,
"color": None
}
},
"content": {
"screen": {
"background": "#FFFFFF",
"backgroundAttachment": None,
"backgroundBlendMode": None,
"backgroundClip": None,
"backgroundColor": "#FFFFFF",
"backgroundImage": "none",
"backgroundOrigin": None,
"backgroundPosition": None,
"backgroundRepeat": None,
"backgroundSize": "auto",
"layer": {
"width": None,
"height": None
},
"gutterTop": "default",
"gutterRight": "default",
"gutterBottom": "default",
"gutterLeft": "default"
},
"container": {
"background": "#FFFFFF",
"backgroundAttachment": None,
"backgroundBlendMode": None,
"backgroundClip": None,
"backgroundColor": "#FFFFFF",
"backgroundImage": "none",
"backgroundOrigin": None,
"backgroundPosition": None,
"backgroundRepeat": None,
"backgroundSize": "auto",
"padding": "0",
"borderRadius": "0"
},
"header": {
"background": "#FFFFFF",
"backgroundAttachment": None,
"backgroundBlendMode": None,
"backgroundClip": None,
"backgroundColor": "#FFFFFF",
"backgroundImage": "none",
"backgroundOrigin": None,
"backgroundPosition": None,
"backgroundRepeat": None,
"backgroundSize": "auto",
"padding": "0",
"borderRadius": "0"
},
"body": {
"background": "#FFFFFF",
"backgroundAttachment": None,
"backgroundBlendMode": None,
"backgroundClip": None,
"backgroundColor": "#FFFFFF",
"backgroundImage": "none",
"backgroundOrigin": None,
"backgroundPosition": None,
"backgroundRepeat": None,
"backgroundSize": "auto",
"padding": "0",
"borderRadius": "0"
}
},
"bordersAndDividers": {
"color": "#cccccc"
},
"spaceReference": {}
} )
response = requests.request(
"POST",
url,
data=payload,
headers=headers,
auth=auth
)
#print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
print(response.status_code)