Finding site id

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
owen
Posts: 12
Joined: Tue Oct 24, 2023 4:07 pm

Finding site id

Post by owen » Tue Nov 28, 2023 10:12 am

Hi,

Is anyone aware of a method/GET url that can return the site id of a site just from the site name?

Currently this works to display sites from a customer ....

'https://consiliumcs.simprosuite.com/api ... umns=Sites'

however it would really help if i could search for a specific site within this called "2 test lane",

Thanks
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Finding site id

Post by Sindre » Tue Nov 28, 2023 11:48 pm

Hi owen,
To get a site ID based on the site name you can add it as a search parameter in the url.

Here is an example for the sites endpoint:

Code: Select all

/api/v1.0/companies/{companyID}/sites/?Name=abc
Alternatively in the customers endpoint:

Code: Select all

/api/v1.0/companies/{companyID}/customers/companies/?Sites.Name=abc
Regards
Sindre
API Developer | Simpro Software Group
Post Reply