Page 1 of 1

Linked sites API

Posted: Fri Mar 22, 2024 2:39 pm
by Ian
Hi,

We can link sites to customers so that specific customers can see more than one site when they login to their customer portal. For example, 1 customer account can be treated as a master with access to information for 4 customer accounts that we have linked to it. Therefore, giving that master account a "regional overview" of asset info for all the sites that have been linked to it.

Please can you advise how to find individual sites linked to users via the simPRO API or a way to query other users (logins) at all?

Many thanks

Re: Linked sites API

Posted: Mon Mar 25, 2024 3:43 am
by Sindre
Hi Ian,
You can see all the sites that are linked to a specific customer in the customers endpoint here:

Code: Select all

/api/v1.0/companies/{companyID}/customers/companies/{customerID}
https://developer.simprogroup.com/apido ... 8ba56cae54

If you are looking for all customers that are linked to a specific site you can query using parameters like this:

Code: Select all

/api/v1.0/companies/{companyID}/customers/?Sites.ID={SiteID}
I hope this helps.

Regards

Re: Linked sites API

Posted: Tue Mar 26, 2024 1:03 pm
by Ian
Hi Sindre,

Thanks for this.

When we log in to simPRO as a customer, the account appears to be Company ID 9.

But when we query /customers/companies/9

We get a list of 141 Sites linked to this company.

But in the simPRO admin area under 'Sites' we only get a single site for this user which we assume is Site ID 113.

We assume the simPRO admin area has its own custom way of linking individual User accounts (not Companies) to sites, that we do not have access to.

The only User related query I can see via their documentation is a request to:
/currentUser

Is there are any other User account related queries we can make via their API, perhaps some that are undocumented? Or if this is not possible to do via their API at all?

I assume these are User accounts, when simPRO only allows us to query the main company.

We can either query companies:
/customers/companies/9

Or individuals:
/customers/individuals/12345

But cannot query User accounts.

https://developer.simprogroup.com/apido ... f87e04cd88

Thanks

Re: Linked sites API

Posted: Wed Mar 27, 2024 3:22 am
by Sindre
Hi,
The endpoint /customers/companies/9 gives you the customer with customer ID 9. The /companies/ is because this is a company customer.

This ID doesn't have any relation to company ID which is the ID of a particular company on your multi company build.

The list of 141 sites you see is all the sites that this customer is linked to.

I am unsure what Admin area you refer to. If you wish to connect customers to sites you can do this under Customers and the sites tab in Simpro. To update sites for a customer in the API use this endpoint:
https://developer.simprogroup.com/apido ... 3425eaf5f1

You can not assign specific sites to an employee but you can assign specific companies if you have a multi company build in Simpro. This is not available in the API.

We don't have other user related endpoints that is not in the documentation. This setup should be done in Simpro.

Regards