Google — connect location to review site
Overview
Connect a Google Business Profile location to a store review site. Persists the account/location/place ids + token, sets sendto_scrapper=Y, url_status=enable, connection_status=connected; soft-deletes obsolete RD-scraped Google reviews for the (store, Google) pair (Google's own API becomes source of truth). And records a gbp_connection_events row (CONNECTED / RECONNECTED / ACCOUNT_SWITCHED). Emits audit STORE_REVIEW_SITE_OAUTH_CONNECTED (and GOOGLE_OAUTH_WIPED_RD_REVIEWS when rows are wiped).
Prerequisites
- Either a bearer token in the
Authorizationheader, or the invitehashthis endpoint accepts in place of one.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/google/review-site/connect
Authentication
-
A bearer token is optional here. Send one to act as a signed-in user, or supply the documented
hashinstead. -
Use a bearer token (api guard, scoped by an ownership check).
-
OR use an invite
hash(no token) whose encoded store must ownstore_review_site_id.
Rate limit
- 30 requests/min per IP (public).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
store_review_site_id | integer | Required | Must exist; in caller scope (an ownership check) unless using hash. |
google_access_token_id | integer | Required | the Google connection's id from the token exchange. |
account_name | string (≤255) | Required | Google account resource, e.g. accounts/123. No angle brackets. |
location_name | string (≤255) | Required | Google location resource, e.g. locations/456. No angle brackets. |
google_place_id | string | Required | Google Place ID. |
mapsUri | url (≤2000) | Required | Google Maps URL → stored as review_site_url. |
newReviewUri | url (≤2000) | Required | Write-review URL → stored as landing_page_url. |
google_response | any | Optional | Raw Google API payload. |
force_update | integer (0,1) | Optional | Re-link even if a different location is already connected (wipes prior reviews). |
hash | string | Optional | Invite hash [store_id, 15]; grants access without a token, must match the row's store. |
{
"store_review_site_id": "<storeReviewSiteId>",
"google_access_token_id": 42,
"account_name": "accounts/123456789",
"location_name": "locations/987654321",
"google_place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4",
"mapsUri": "https://maps.google.com/?cid=123",
"newReviewUri": "https://search.google.com/local/writereview?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4",
"force_update": 0
}How it works
- 200 on connect. 400 if the location belongs to a different location without
force_update, or (production) if the Google location is already linked elsewhere.
Response
200 OK · 200
200{
"data": {
"status": "success",
"message": "The review site has been updated successfully."
}
}400 Location already linked · 400
400{
"message": "Bad Request",
"status": "error",
"errors": "The Google location is already linked to other places. Please connect another GMB account."
}400 Different location · 400
400{
"message": "Bad Request",
"status": "error",
"errors": "The location account does not correspond to the current location. Please choose the same location account"
}Errors
| Status | Meaning |
|---|---|
400 | Location already linked |
401 | The bearer token is missing, expired or invalid |
422 | The request failed validation — the response names the fields |
500 | Unexpected server error |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/google/review-site/connect" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"store_review_site_id": "<storeReviewSiteId>", "google_access_token_id": 42, "account_name": "accounts/123456789", "location_name": "locations/987654321", "google_place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4", "mapsUri": "https://maps.google.com/?cid=123", "newReviewUri": "https://search.google.com/local/writereview?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4", "force_update": 0}'Updated 9 days ago
