Google & Facebook

Auth-optional Google Business Profile and Facebook page connection endpoints for a store's review sites.

Auth-optional Google Business Profile and Facebook page connection endpoints for a store's review sites. Each accepts either a bearer token (authenticated admin/account flow) or an emailed-invite hash (no token) — with a hash, the target store_review_site must belong to the store the hash encodes. Google: exchange OAuth code for an access token, connect/disconnect a GBP location, and record browser-side connection-funnel tracking events. Facebook: save a validated user access token, connect/disconnect a page. Connect wipes obsolete scraped reviews, flips connection_status, and triggers a review pull; disconnect clears credentials and emails the account owner. All live in the public group.

Prerequisites

  • A bearer token in the Authorization header. Any endpoint that needs no token says so on its own page.
  • The id of each record the call targets. Every endpoint page lists the ids it needs.

Errors

StatusMeaning
401The bearer token is missing, expired or invalid
403The token is valid but the record sits outside your account
422The request failed validation — the response names the fields
500Unexpected server error

Individual endpoints may return more; each page lists its own.

Endpoints

MethodEndpointDescription
GETGoogle — exchange OAuth code for access tokenExchanges a Google OAuth code for an access token, stores it (google_access_tokens), and then branches: with connect_google=1 + company_id_hash it links the token to that company and syncs its GBP locations (dispatching DuplicateGMBDebugger).
POSTGoogle — connect location to review siteConnect a Google Business Profile location to a store review site.
GETGoogle — disconnect review siteDisconnect a Google Business Profile location from a store review site: clears the token/location, sets sendto_scrapper=N, connection_status=disconnected, disconnect_reason=MANUAL, clears the company googleapi_access_token, logs the change, emails the account owner (ACCOUNT_DISCONNECTED), and records a DISCONNECTED_MANUAL gbp event.
POSTGoogle — record connection tracking eventRecord a browser-side step of the Google Business Profile connection funnel (sign-in clicked, consent denied, callback error, locations listed) for connection reporting.
POSTFacebook — save user access tokenValidate a Facebook user access token via the Graph API debug endpoint and, if valid, persists the FB user details for the company.
POSTFacebook — connect page to review siteConnect a Facebook page to a store review site.
GETFacebook — disconnect review siteDisconnect a Facebook page from a store review site: clears the token + URLs, sets sendto_scrapper=N, connection_status=disconnected, disconnect_reason=MANUAL, clears the company fb_access_token, logs the change, and emails the account owner (ACCOUNT_DISCONNECTED).