"Add a note" endpoint / docs say content-type should be "application/x-www-form-urlencoded"

The “Add a note” endpoint docs say content-type should be “application/x-www-form-urlencoded” - however, it only worked for me when I changed it to “application/json”

Hi @briiian,

I forwarded your query to our developers. They said they tried out with application/x-www-form-urlencoded and it worked for them.

Would it be possible for you to PM me with your company ID and request body so we can check on this for you, please?

The misleading ‘application/x-www-form-urlencoded’ instead of ‘application/json’ shows in numerous places in API documentation. Guess, one has to follow the actual content type in use, rather than following documentation.

1 Like

I’ve never worked with an API where the content-type changes based on the endpoint. I’m new here, so this is a red flag for me.

As a follow up, I was able to “Add a note” with content-type “application/x-www-form-urlencoded” IF the method is set to GET and the payload is in the URI/URL (query string encoded).

It changes based upon recommended method for given endpoint, e.g GET vs. POST: one can take web request with parameters, the later can take a body with string (which can be JSON.)

Thanks Lev. I’m new-ish to this API, but for anyone else coming across this thread:

A POST method can take either JSON or Query String format, depending on the endpoint. Where the documentation will say “Body parameters: application/x-www-form-urlencoded” or “Body parameters: application/json” – that note/documentation has nothing to do with the Content-Type (which is always “application/json” - regardless of how the content is actually formatted).

For any Pipedrive dev’s reading this, it would be ideal if the body could be delivered to you in a consistent format. It makes for less logic in my code and less opportunity for errors.
Thank you.