Incorrect API responses

Hi Dev support team,

We are using the API when creating deals from different lead sources in order to check if (1) a person already exists and if found - (2) if there are open deals for that person.

However, I noticed for several times now that an API call has returned a response that says that there are no open deals for a person while there is an open deal.

Example:
Person ID 858
That person has an open deal: 994
However, when we sent the following API request on aaaa it that there are no open deals.

Request:
> [
> {
> “ca”: null,
> “qs”: [],
> “url”: “https://api.pipedrive.com/v1/deals/search?term=2020&person_id=858&status=open&start=0&api_token=xxxxxxxxxx”,
> “gzip”: true,
> “method”: “get”,
> “headers”: [],
> “timeout”: null,
> “authPass”: null,
> “authUser”: null,
> “bodyType”: null,
> “shareCookies”: false,
> “parseResponse”: true,
> “followRedirect”: true,
> “useQuerystring”: false,
> “followAllRedirects”: false,
> “rejectUnauthorized”: true
> }
> ]

The response:
> [
> {
> “statusCode”: 200,
> “headers”: [
> {
> “name”: “date”,
> “value”: “Thu, 05 Nov 2020 16:47:38 GMT”
> },
> {
> “name”: “content-type”,
> “value”: “application/json; charset=utf-8”
> },
> {
> “name”: “transfer-encoding”,
> “value”: “chunked”
> },
> {
> “name”: “connection”,
> “value”: “close”
> },
> {
> “name”: “set-cookie”,
> “value”: “__cfduid=dc09199672506681618e09c1bf7fe3e181604594858; expires=Sat, 05-Dec-20 16:47:38 GMT; path=/; domain=.pipedrive.com; HttpOnly; SameSite=Lax”
> },
> {
> “name”: “x-correlation-id”,
> “value”: “d4b889c4-4f8d-4b2f-9687-011edd427a3a”
> },
> {
> “name”: “badi”,
> “value”: “Routing: eu-central-1=>eu-central-1; Version: a0fa; Host: bari;”
> },
> {
> “name”: “cache-control”,
> “value”: “no-cache”
> },
> {
> “name”: “access-control-expose-headers”,
> “value”: “X-RateLimit-Remaining, X-RateLimit-Limit, X-RateLimit-Reset”
> },
> {
> “name”: “pdtrusted-wgw-real-user-ip”,
> “value”: “82.208.14.112”
> },
> {
> “name”: “access-control-allow-origin”,
> “value”: ""*
> },
> {
> “name”: “x-ratelimit-limit”,
> “value”: “40”
> },
> {
> “name”: “x-ratelimit-remaining”,
> “value”: “38”
> },
> {
> “name”: “x-ratelimit-reset”,
> “value”: “2”
> },
> {
> “name”: “x-xss-protection”,
> “value”: “1; mode=block”
> },
> {
> “name”: “x-content-type-options”,
> “value”: “nosniff”
> },
> {
> “name”: “strict-transport-security”,
> “value”: “max-age=31536000; includeSubDomains”
> },
> {
> “name”: “cf-cache-status”,
> “value”: “DYNAMIC”
> },
> {
> “name”: “cf-request-id”,
> “value”: “063ae7912200002778000ab000000001”
> },
> {
> “name”: “expect-ct”,
> “value”: “max-age=604800, report-uri=”[https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct](https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct/)""
> },
> {
> “name”: “server”,
> “value”: “cloudflare”
> },
> {
> “name”: “cf-ray”,
> “value”: “5ed80ec83a162778-PRG”
> },
> {
> “name”: “content-encoding”,
> “value”: “gzip”
> }
> ],
> “cookieHeaders”: [
> “__cfduid=dc09199672506681618e09c1bf7fe3e181604594858; expires=Sat, 05-Dec-20 16:47:38 GMT; path=/; domain=.pipedrive.com; HttpOnly; SameSite=Lax”
> ],
> “data”: {
> “success”: true,
> “data”: {
> “items”: []
> },
> “additional_data”: {
> “pagination”: {
> “start”: 0,
> “limit”: 100,
> “more_items_in_collection”: false
> }
> }
> },
> “fileSize”: 126
> }
> ]

Timestampe: November 5th 18:47 IL Time

The requests are done from Integromat.

Since we observed this more than once and we have a large setup based on the API which works great, I think this is a bug rather than incorrect usage.

Please look into the logs from your side to check why this happens.
You can reach out to me directly and we can look into other examples.

Thanks,
Michael

Hello @Michael_Imas

Have you tried to call Pipedrive API without Integromat (for example via Postman)? To see if this behavior reproduces with plain HTTP requests.

1 Like

When I try now it’s working fine, both from Integromat and postman. But at the time of the request it returned zero deals so I cannot reproduce or check this without Pipedrive’s input after they look at the logs. Also the mechanism is working fine for 95% of the time

Hi @mykhailo,

Any feedback on this?
It has critical impact as the reps are calling leads twice (the merging doesn’t work due to incorrect lookup of existing deals).

Maybe we can have a quick screen sharing session?

Thanks,
Michael

Hello @Michael_Imas ,

As I understood the Pipedrive API is working fine but the Integromat setup you have is a bit unstable. Or if you call the Pipedrive API (without Integromat) you can also reproduce the issue (meaning you have steps I can use to reproduce it on my side)?

I’m asking, as in order to start looking into the problem we need to understand what exactly does not work, Pipedrive API or Integromat setup.

Hi Mykhailo,

Based on your response it sounds like we have a misunderstanding.
Let me clarify what’s the exact issue is-

In some of the API requests that are pulling the open deals for a certain person we get an empty deal list although there are open deals.

In most of the requests, we do get the open deals and everything works properly. That’s why it’s irrelevant to check this proactivly from postman or ontegromate - it will return a correct response, I checked. This fact eliminates any suspicions that the issue is related to syntax or platform.

Despite that, I must investigate why it’s not always working properly, that’s why I sent you an example.
With this example, you can check the logs on your end and see that the API request was received properly and that there were open deals.

This issue is critical for us, this technical capability is part of a larger duplicate detection mechanism and this issue causes reps to call leads twice.

What do you think?

Thanks,
Michael

Did I get it right, that exact same request some times works fine, and sometimes does not (not in Integromat, but just if you make a request)? Or there is a difference in query params (person_id, term, etc), meaning for some query params it works fine and for some, it doesn’t?

The first option.

And since I can reproduce it I’m asking to check it against your logs

Hey @Michael_Imas,

For this case then, I would recommend reaching out directly to our support as it will require our Support Engineers to take a look into your account’s logs directly (something we can’t really do here without risking privacy).

Hi David,

That’s where I started - they referred me to you and said that any dev issues related to api should be reported via this portal. It sounded strange to me as well. Can you please talk with the support team? they account I used (the customer here) is ofir@footbalance.co.il

Hey Michael,

Sorry for the run around on that then. Let me talk with the dev team and see if we can find anything.

Thank you for your response, will wait for your update.
I’m here for questions

Hey Michael,

When looking at the original question, you included “2020” as the search term for your request. Do you know what field/area you were trying to match with this?

As it stands, it may be best if you’re able to send a new example as soon as you see one and then we can try to quickly replicate it.

Hi David,

The reason I’m using this term is that it doesn’t work without a term and all of our deals have a date on their title.
It’s sort of a workaround.
Do you have a query that looks up existing deals for a specified person without using a term?

As for samples, it’s very complex for me to find these, why can’t we use the one I sent?

Thanks,
Michael

I understand the use of a term, it was more to ask whether or not something changed in connection to the term from when you originally used it to now.

The sample you sent doesn’t work for us as we can’t replicate it. We can find the right information with the endpoints currently (as can you). Maybe a new example will offer some more insight.

David, can we have a quick call? I feel the back and forth here can be saved by a quick clarification call…
My number is: +972-54-7704121

Anyway, the reason it’s hard to find another sample, as I mentioned before, is that it doesn’t happen all the time. Only sometimes, that’s why we need to investigate that specific occurrence and understand why pipedrive didn’t return the list of open deals although there were open deals for that person at the time.

Thanks,
Michael