Empty Job Cost Centre parts

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
wildhart
Posts: 32
Joined: Tue May 11, 2021 8:54 pm

Empty Job Cost Centre parts

Post by wildhart » Thu Aug 24, 2023 2:55 am

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 2734 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 2734 times
I have an identical job which works fine:
image (2).png
image (2).png (124.5 KiB) Viewed 2734 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?
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Empty Job Cost Centre parts

Post by Sindre » Thu Aug 24, 2023 4:02 am

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
Sindre
API Developer | Simpro Software Group
wildhart
Posts: 32
Joined: Tue May 11, 2021 8:54 pm

Re: Empty Job Cost Centre parts

Post by wildhart » Thu Aug 24, 2023 4:14 am

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.
Post Reply