I am setting and getting the value of an optional custom attribute via Python API. For example, to set the value:
r = requests.post('https://company.okta.com/api/v1/users/testuser/',
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization' : 'SSWS XXYYZZ' },
data = '{"profile": {"custom_attr": "attr_value" }}')
And to get the value:
r = requests.get('https://company.okta.com/api/v1/users/testuser/',
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization' : 'SSWS XXYYZZ' })
content = json.loads(r.content)
print content['profile']['custom_attr']
I also have a requirement to remove this optional custom attribute from a specific user profile, but have not found any way to do this and don’t see any reference to this functionality in the API docs.
Any ideas would be greatly appreciated.