Content-Type: application/json not supported

Hello,

it’s said: " We recommend using JSON body format when performing API requests. In order to do a proper JSON-formatted request, make sure you provide Content-Type: application/json in HTTP request headers."
But I get an error “Content-Type: application/json not supported” even if I add Content-Type Application/json in header.
See screenshots.

Hello Nina,

Content-Type is indeed supported so a possible explanation for that could be that the JSON body is not completely valid (some typo, for instance). Could you double check the body or send it fully so I could double check for you?

Cheers,

Juan

1 Like

Hello Juan,

there was indeed an error in json-body I overlooked, but it would be better you return “invalid json” instead of “Content-Type: application/json not supported” as an error description.
Could you please help me to find out which call should I use to get all possible “labels” for the properties “phone” and “email”?
{“name”:“Anna Ruff”,
“org_id”: 10,
“first_name”: “Anna”,
“last_name”: “Ruff”,
“phone”: [
{
“label”: “Business”,
“value”: “+49123445634”,
“primary”: true
},
{
“label”: “Private”,
“value”: “094792-487”,
“primary”: false
}
],
“email”: [
{
“label”: “Business”,
“value”: “np@mail.com”,
“primary”: true
},
{
“label”: “Private”,
“value”: “np@gmail.com”,
“primary”: false
}
]
}
image

Hello Nina,

You are completely right regarding the error description and it is something we are going to look at and improve in the near future.

About the labels, I am not completely sure I follow you, but have you checked https://developers.pipedrive.com/docs/api/v1/#!/PersonFields/get_personFields ? Could that be what you are looking for?

Regards,

Juan

1 Like

no, it’s not. I need a list of all values that can be used in “email”->“label” property of a person. From previous screenshot I would need the values “Geschäftlich”, “Privat” and “Sonstiges”. So how can I get these values?

Hi @Nina_Pashinina

I think Juan missed your answer back. Unfortunately there’s no way to find the ID for default field labels (phone/email) right now so you can only set these via in-app. Hopefully in the future we will reveal this within the public endpoint.

Hello David,

thanks for the notice. But I’m not sure what do you mean saying “via in-app”. What do you mean with “in-app”?

Sorry for the confusion, I mean you can only directly apply the work/home/other labels directly within the Pipedrive Web application (and not via API).

We have now fixed it:

When the user will use an incorrect JSON payload, they’ll see the following response:

{
    "status": false,
    "error": "Invalid or malformed JSON"
}

And the following response when a user is using an incorrect Content-type:

{
    "status": false,
    "error": "Content-Type: text/plain not supported"
}
3 Likes