Customer API - Location

The Get /customers API returns two fields called

  • location_name
  • location_id

Where in the Syncro Web UI are these configured?
Are these fields in some way linked to the ability to have multiple site/addresses for each customer?
Using the API I cannot figure out how to get a list of site/addresses for each customer.
The API only seems to be able to get the main address.
What am I missing?

I believe this is referring to additional addresses you have associated with a customer record. When you add more than one address you can assign a name to the location. And the ID just refers to the record for that associated address since there can be multiple.

Thanks @andy
Yes, when I first looked at the API I first assumed that these 2 fields would display something to do with Multiple sites.
But that is not the case, and further reflection and examination of the WebUI for customers explains why.

In the customer edit screen there 5 fields to enter in the customer address. Then additional NAMED addresses can be entered.
There is no field to specify which of the NAMED addresses is actually assigned as the default (or HQ) for the customer. The NAMED addresses can be selected to denote where a Contact or an Asset is located. But the customer record itself, cannot have an assigned NAMED address.

For the record in the snip, there are 3 NAMED addresses.
When the API is used to retrieve this specific customer record the location_name field and the location_id field are both null.
The support ticket number is 00160881

That I don’t know. I’d reach out to support on that one. I just recognized what it was referencing.

Thanks, as mentioned, I have logged a ticket with support. Ticket 0160881
Hopefully they are reading this thread, and their first response isn’t the same answer you did.

Their first response to my opt_out ticket leads me to suspect that Support testing with a different code base than being used in production. If you are curious, check my response to Support on ticket 00160844.
Essentually Support are getting different results to the api-docs URL.
SyncroMSP API Docs

1 Like

Just to be sure we aren’t getting our threads crossed, my response above was relating to the address stuff. I responded to your other thread regarding the opt_out stuff separately. That one I don’t know about.

1 Like

Agree, it can be quite confusing. I realise that I’ve not helped by bring the 2 topics into the one thread, but trying to get the correct information on the API seems to be incredibly difficult, and frustrating.

The quality of the documentation for the API is the biggest problem here.
There is nothing in the documentation indicating which API field is supposed to align with which WebUI element.
Also there is zero information in the API as to the expected data types of the fields included the API responses.

I was looking into this a little bit tonight. When you get your response when polling the API do any of the secondary addresses show up in the results or no?

I had another look @Andy

The example Value in the documentation for the /customers API is below.
This example Value doesn’t have any fields for additional addresses.
But I see down at the bottom of the response when I try out the API
SyncroMSP API Docs

there is this array.

“addresses”: [ ]

This should be documented, without needing to discovered it. Same with phones[ ] and contracts[ ].
Only contacts[ ] is documented in the example Value.
Why does Syncro leave it to syuncro customers to discover these things instead of putting them in the documentation?
To get this documentation fixed should a ticket be raised pointing to a “Bug” in the documentation…or should a Feature Request be raised?

So this is where the additional site addresses are retrieved by the API.
But sadly the mystrey of location_name and location_id still isn’t solved.

“customer”: {
“id”: 1,
“firstname”: “Walkin”,
“lastname”: “Customer”,
“fullname”: “Walkin Customer”,
“business_name”: null,
“email”: “”,
“phone”: “123”,
“mobile”: null,
“created_at”: “2019-10-21T08:33:21.053Z”,
“updated_at”: “2019-10-21T08:33:21.053Z”,
“pdf_url”: null,
“address”: null,
“address_2”: null,
“city”: null,
“state”: null,
“zip”: null,
“latitude”: null,
“longitude”: null,
“notes”: null,
“get_sms”: false,
“opt_out”: false,
“disabled”: false,
“no_email”: true,
“location_name”: null,
“location_id”: null,
“properties”: {},
“online_profile_url”: “”,
“tax_rate_id”: null,
“notification_email”: null,
“invoice_cc_emails”: null,
“invoice_term_id”: null,
“referred_by”: null,
“ref_customer_id”: null,
“business_and_full_name”: “Walkin Customer”,
“business_then_name”: “Walkin Customer”,
“contacts”: [ ]

</example Value>

1 Like

I was just asking what the actual output you are seeing for addresses when testing to see if it matched mine. I know where it’s supposed to go, I am just curious if it’s actually going there for you. The output you are showing doesn’t have anything for the extra addresses, which is making me think it’s potentially a bug (or more likely an accidental omission). I am guessing that is why it’s not present in the documentation either.

I would open a ticket on it in general and support will classify it as a bug or FR, but I’d definitely go the ticket route in either event.

I am fairly certain the location name and ID present above will always be null because they use the same model as the additional addresses, but won’t need a name because they technically belong as the listed address for the company. The omission makes it more confusing than it should be, I totally agree there.

That output is a copy and paste direct from the Syncro Documentation website.
Who ever wrote Syncro’s documentation for the API, should go back and try again.

Yes I am aware of what the output is. As I mentioned this is going to need to go through support at this point because it does appear to be a bug, or a FR due to an omission.

There is a ticket open. No response yet.

1 Like

@andrewd, I just brought this to supports attention. You should get a reply soon.