Add dealFields 500 Internal Server Error

When I try to creat a deal field I got Internal Server Error but I see a key like:
7f7fe222-3146-4130-9a8b-95d5e5e88d6f

All API request is working add person, org, deal etc … but deal fields is not.

I use Devio Laravel library.

I tryed it with doc exmaple data:

Request:
$values = [
‘name’ => ‘Random name for a custom field’,
‘field_type’ => ‘double’
];
$pipedrive->dealFields()->add($values);

Response:
Devio\Pipedrive\Exceptions\PipedriveException

Internal Server Error (7f7fe222-3146-4130-9a8b-95d5e5e88d6f)

Hi @Balint_Lengyel ,
Welcome to the community :wave:

I can see in our logs the following error:

  "message": "Unsupported Media Type: application/x-www-form-urlencoded",

You need to specify the Content-Type header of your request to application/json. Unfortunately, I have no knowledge of the Devio Laravel library, so I cannot say how it can be changed.

1 Like

Hello @Tomas_Tauer

Thank you for your fast reply.

I will check soon what I missed.

I checked the code and I do the same method for

$pipedrive->organizations()->add($values);
$pipedrive->persons()->add($values);

And all works fine, except the
$pipedrive->dealFields()->add($values);

Please refer to Custom fields API regression, there is a broader explanation of why it does not work. In a nutshell, the library did not conform to our API documentation and used undocumented behavior.