Dear Community,
since September 5 we are having issues with updating a custom person field using a PUT request for /v1/personFields
. I think it is related to the issue from September 5 with custom fields, which should be fixed (Pipedrive Status). We get the following response:
{'success': False, 'error': 'Internal Server Error (2544b177-3153-44be-b021-7cacbdc19934)', 'error_info': 'Please check developers.pipedrive.com', 'data': None, 'additional_data': None, 'code': 'ERR_UNKNOWN'}
Does anyone else have similar problems or know how to fix it?
Thank you 
Hello, from our logs I see two issues with your requests.
The requests are coming to following URL. There is definitely some weird unknown query parameter which should be removed
/api/v1/personFields/FIELD_ID?Accept=application%2Fjson
And second thing I see is you’re sending
Content-Type: application/x-www-form-urlencoded
The content type should be
Content-Type: application/json
This should fix your issues. Hoped this helps, but if there is still some problem, please let me know, I’ll be happy to help.
Hello, thank you for your quick reply.
Indeed, the code was written long time ago and passed this query parameter. I also changed to Content-Type: application/json
. The code I am using now is this:
response = rq.put(company/api/v1/personFields/FIELD_ID,
params = {
'api_token': API_TOKEN
},
headers={
'Content-Type': 'application/json'
},
data={
'id': FIELD_ID,
'options': new_options
})
I still get the same error with this code. The request are coming now to the URL: /api/v1/personFields/FIELD_ID?api_token=API_TOKEN
. Am I missing here something? Do I provide the API token correctly?
Now I see only following error:
Unexpected token i in JSON at position 0
Unfortunately we’re not logging whole requests not to leak any possibly sensitive information. I’m not used to python and I don’t know what exact request this produces. But could you instead of
data={...}
use
json={...}
Or doing something like JSON.encode(…) before passing it to data…? The API token seems to work fine.
If you’ll send me what exactly in python you use to send the requests, I might be able to dig more into that.
1 Like