Job List Endpoint – Receiving HTTP 400 when certain records are included.

lukm
New Contributor

Sorry if this is in the wrong Discussion board. I could not figure out how to contact Support directly without having a ServiceTitan account.

Hi, I'm a Software Engineer working on Wink Reports. Part of our software syncs data from Service Titan's API for our Clients.

During the sync process, we retrieve a list of Jobs from ServiceTitan. A certain Client of ours has had trouble syncing today, due to a troublesome record that, when included in the pagination for the request, returns a HTTP 400 exception.

```

Headers

{
  "CF-Cache-Status": "DYNAMIC",
  "CF-RAY": "822269bef965aa3a-DFW",
  "Connection": "keep-alive",
  "Content-Length": "270",
  "Content-Type": "application/json",
  "Date": "Tue, 07 Nov 2023 03:15:40 GMT",
  "Server": "cloudflare"
}

Body

{
  "data": {},
  "errors": {
    "": [
      "An item with the same key has already been added. Key: 5730603"
    ]
  },
  "status": 400,
  "title": "An item with the same key has already been added. Key: 5730603",
  "traceId": "822269bef965aa3a-DFW",
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1"
}

```

Because the record is on page 422 if the page size is 100, the following endpoint will return a HTTP 400:

https://api.servicetitan.io//jpm/v2/tenant/_/jobs?pageSize=100&page=422

This will return a HTTP 200:

https://api.servicetitan.io//jpm/v2/tenant/_/jobs?pageSize=100&page=421

Could I please get some assistance as to what this might be?

2 REPLIES 2

lukm
New Contributor

Hi @LBabayan, Is there a way I can PM or Email you the Client's details? I don't want to give their information on a public forum. If not, feel free to email me at luke@winkreports.com and I'll get you in touch with them! 🙂

LBabayan
ServiceTitan Certified Provider
ServiceTitan Certified Provider

Hi @lukm, and thanks for your posting! 

Can you provide your customer's point of contact who has an ST account? I won't be able to forward the issue details to the technical specialists' team in case there is no associated ST account.