Data integrity error

Attempting to get a list of custom field definitions via the beta API using Python (in Django).  Code snippet is as follows:

import requests, json

ACCESS_TOKEN = "<my token>"
ACCESS_EMAIL = "<my email>"

HEADERS = {
'X-PW-AccessToken': ACCESS_TOKEN,
'X-PW-Application': "developer_api",
'X-PW-UserEmail': ACCESS_EMAIL,
'Content-Type': "application/json",
'Cache-Control': "no-cache",
}

def customfields(request):

data = '{"type": {"category":"system"},"page_size": 200}'

api_request = requests.post('https://api.prosperworks.com/developer_api/v1/custom_field_definitions', headers=HEADERS, data=data)

api = json.loads(api_request.content)

print(api)

Error I am receiving is:

{'success': False, 'status': 422, 'message': 'Data integrity error'}

 

What am I doing wrong here?

 

Cheers,
ts

0
2

2 Comments

Please sign in to leave a comment.

Add Comment

Didn’t find what you were looking for?

Start a Discussion