Cannot update contact property option values


#1

I followed this document to try to add more option values for a given contact property using API. However it doesn’t work for me:

I pasted my code here: what’s the problem?? thank you so much for your help!

def update_sales_dev_owner_property():
""“
put new sales dev into sales dev owner value list
”""
try:
# get operation works for me. I can get property obj
sdr_owner = get_hubspot_property()

    data = {}
    data['name'] = 'new_property'
    data['groupName'] = sdr_owner['groupName']
    data['description'] = sdr_owner['description']
    data['fieldType'] = sdr_owner['fieldType']
    data['formField'] = sdr_owner['formField']
    data['type'] = sdr_owner['type']
    data['displayOrder'] = sdr_owner['displayOrder']
    data['label'] = sdr_owner['label']
    data['options'] = sdr_owner['options']

    url = "https://api.hubapi.com/properties/v1/contacts/properties/named/new_property?hapikey=" + settings.HUBSPOT_HAPIKEY
    response = requests.put(
            url,
            data=json.dumps(data),
            verify = False,  # Verify SSL certificate
        )   
    result = response.ok
    if response.ok:
        print response.json()
except: 
    logger.exception(make_log_msg("update property", "", "", traceback.format_stack()))
return