Page 1 of 1

Empty Job Cost Centre parts

Posted: Thu Aug 24, 2023 2:55 am
by wildhart
I have one job which when I try to GET the CostCenter I get an empty result, even though the data is present in the SimPro website:
image (1).png
image (1).png (104.06 KiB) Viewed 2737 times
Normally to get these Parts via the API I get the sections, then get the Cost Centers for each section

Code: Select all

GET /jobs/62612/sections/
RESULT:
[
  {
    "ID": 42962,
    "Name": "",
    "Description": "",
    "DisplayOrder": 1
  }
]

GET /jobs/62612/sections/42962
RESULT
{
  "ID": 42962,
  "Name": "",
  "Description": "",
  "IsVariation": false,
  "IsVariationRetention": false,
  "DisplayOrder": 1,
  "DateModified": "2023-07-28T16:20:07+12:00"
}

GET /jobs/62612/sections/42962/costCenters/
RESULT []
As you can see the result is empty:
Screenshot 2023-08-24 144730.png
Screenshot 2023-08-24 144730.png (27.02 KiB) Viewed 2737 times
I have an identical job which works fine:
image (2).png
image (2).png (124.5 KiB) Viewed 2737 times

Code: Select all

GET /jobs/63772/sections/44337/costCenters/
RESULT
[
  {
    "ID": 44994,
    "CostCenter": {
      "ID": 13,
      "Name": "****"
    },
    "JobID": 63772,
    "Name": "***",
    "DisplayOrder": 1,
    "Total": {
      "ExTax": 86.91,
If I PM our subdomain to you, can you investigate this?

Re: Empty Job Cost Centre parts

Posted: Thu Aug 24, 2023 4:02 am
by Sindre
Hi Wildhart,
Please send me a private message with your build details and I will have a look.

I would have thought you looked into the wrong section but it seems to only have one section from your data.

Please also try this endpoint and see if you get the same result.

Code: Select all

/api/v1.0/companies/{companyID}/jobCostCenters/
Regards

Re: Empty Job Cost Centre parts

Posted: Thu Aug 24, 2023 4:14 am
by wildhart
I've sent my build details to your PM.

The other endpoint you suggested given an empty result:

Code: Select all

URL: /jobCostCenters/?Job.ID=62612
RESULT: []
But with "?Job.ID=63772" I get the correct cost centers as per my previous working example.