Get Google Attributes for a Location
This API lists every Google Business Profile attribute that Google allows for a location, for its primary category and country, with Synup's current value next to each one. Use it to see which attributes are still unfilled for the location.
The list is read live from Google using the Google account the location is connected to in Synup. The location must be connected to Google; if it isn't, the API returns an error asking you to connect it first.
Attributes are returned unfilled first. Each attribute has a valueType:
BOOL: Yes/No. Send"true"or"false".ENUM: single choice. Send one ofallowedValues.REPEATED_ENUM: multi-option list. Send any ofallowedValues.URL: a link.
To set or clear a value, use the update location API with customAttributes, using attributeId as the slug, e.g. {"slug": "wi_fi", "value": ["free_wi_fi"]}. Only the attributes you send are changed. To clear an attribute, send it with an empty value, e.g. {"slug": "wi_fi", "value": []}; it is cleared in Synup and removed from the Google Business Profile on the next sync.
Authorization: API <your-key> — see Getting started.Parameters
Path
| Name | Type | Required | Description |
|---|---|---|---|
locationId | string | required | Required. The location ID, either the numeric ID (e.g. 279403) or the encoded ID returned by other APIs (e.g. TG9jYXRpb246Mjc5NDAz). |
Request
curl -X GET 'https://api.synup.com/api/v4/locations/:locationId/google-attributes' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json'const res = await fetch('https://api.synup.com/api/v4/locations/:locationId/google-attributes', {
method: 'GET',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
});
const data = await res.json();import requests
res = requests.get(
"https://api.synup.com/api/v4/locations/:locationId/google-attributes",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
)
data = res.json()req, _ := http.NewRequest("GET", "https://api.synup.com/api/v4/locations/:locationId/google-attributes", nil)
req.Header.Set("Authorization", "API YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Responses
| Status | Description |
|---|---|
200 | Successfully retrieved the location's Google attributes. |
400 | Bad request: the location isn't connected to Google, Synup can't access the location's Google Business Profile, or the location ID is invalid or not accessible with this API key. `locationGoogleAttributes` is `null`. |
401 | Unauthorized. Invalid or missing API key. |
502 | Google could not be reached or returned an error. Retry after some time. |
{
"data": {
"locationGoogleAttributes": {
"totalResult": 0,
"attributes": [
{
"attributeId": "string",
"displayName": "string",
"groupDisplayName": "string",
"valueType": "BOOL",
"repeatable": true,
"deprecated": true,
"allowedValues": [
{
"value": null,
"displayName": null
}
],
"synupValue": [
"string"
],
"filled": true,
"managedIn": "custom_attribute",
"supportedBySynup": true
}
],
"filledCount": 0,
"unfilledCount": 0
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | required | |
data.locationGoogleAttributes | object | required | Google attributes for the location. |
data.locationGoogleAttributes.totalResult | integer | required | Number of attributes Google allows for the location. |
data.locationGoogleAttributes.attributes | array of object | required | One entry per attribute, unfilled attributes first. |
data.locationGoogleAttributes.attributes[].attributeId | string | required | Google attribute ID, e.g. wi_fi. Use it as the custom attribute slug when you update the location. |
data.locationGoogleAttributes.attributes[].displayName | string | optional | Name Google shows for the attribute. |
data.locationGoogleAttributes.attributes[].groupDisplayName | string | optional | Group Google shows the attribute under, e.g. Amenities. |
data.locationGoogleAttributes.attributes[].valueType | string | required | BOOL (Yes/No), ENUM (single choice), REPEATED_ENUM (multi-option list) or URL (link).BOOLENUMREPEATED_ENUMURL |
data.locationGoogleAttributes.attributes[].repeatable | boolean | optional | Whether more than one value can be set. |
data.locationGoogleAttributes.attributes[].deprecated | boolean | optional | Whether Google has deprecated the attribute. |
data.locationGoogleAttributes.attributes[].allowedValues | array of object | required | Values Google accepts. Empty for URL attributes. |
data.locationGoogleAttributes.attributes[].allowedValues[].value | string | optional | Value to send. |
data.locationGoogleAttributes.attributes[].allowedValues[].displayName | string | optional | Label Google shows for the value. |
data.locationGoogleAttributes.attributes[].synupValue | array | optional | The location's current value in Synup; null when not filled. |
data.locationGoogleAttributes.attributes[].filled | boolean | required | Whether Synup holds a value for the attribute. |
data.locationGoogleAttributes.attributes[].managedIn | string | required | Where the value is managed in Synup: custom_attribute (location custom attributes), social_profile (the location's social links), payment_methods (the location's payment methods) or place_action_links.custom_attributesocial_profilepayment_methodsplace_action_links |
data.locationGoogleAttributes.attributes[].supportedBySynup | boolean | required | Whether Synup publishes this attribute to Google. |
data.locationGoogleAttributes.filledCount | integer | required | Attributes Synup holds a value for. |
data.locationGoogleAttributes.unfilledCount | integer | required | Attributes still unfilled in Synup. |