401 Unauthorized Error When Using Personal API Token with Pipedrive API

Hello Pipedrive Community,

I’ve been trying to integrate with the Pipedrive API using my personal API token, but I keep encountering a “401 Unauthorized” error. Here’s a summary of what I’ve tried and the issues I’ve faced:

  1. API Token: I’m using the personal API token found under “Personal preferences” in my Pipedrive settings.
  2. Endpoint: I’ve been trying to send data to the https://sample-pumpkin.pipedrive.com/v1/persons endpoint.
  3. Headers: I’ve set the Authorization header as “Bearer [MY_API_TOKEN]”.
  4. Request Method: I’m using the POST method to send data.
  5. Error Message: The exact error message I receive is: “Request failed for https://sample-pumpkin.pipedrive.com returned code 401. Truncated server response: {“success”:false,“error”:“unauthorized access”,“errorCode”:401,“error_info”:“Please check developers.pipedrive.com”}”.

I’ve double-checked the API token and ensured that it’s being sent correctly in the request headers. I’ve also reviewed the Pipedrive API documentation but haven’t found a solution to this issue.

Could anyone provide insights or suggestions on how to resolve this? Any help would be greatly appreciated.

Thank you in advance!

Hello, @nabatame and welcome to the community! :wave:

For api_token based authentication, the token needs to be supplied as a query string. Here’s our documentation regarding authentication.

Let us know if you have additional questions!

Cheers,
Helena