Google: record a connection event

Overview

Log a step in the connection process for reporting.

Called by the connection page. Feeds the Google connection activity report in the Advanced group.

You'll need the store_id and the event.

The event is recorded.

Prerequisites

  • A bearer token in the Authorization header, OR an invite hash, OR the public connect-page company_id_hash, OR source=registration (anonymous signup wizard).

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

POST /api/v1/google/connection-event

Authentication

  • A bearer token is optional here. Send one to act as a signed-in user, or supply one of the documented alternatives instead.

  • Use a bearer token.

  • OR use an invite hash.

  • OR use the public connect-page company_id_hash.

  • OR use source=registration (anonymous signup wizard).

Rate limit

  • 30 requests/min per IP (public).

Request body

FieldTypeRequiredDescription
eventstringRequiredOne of: oauth.started, oauth.denied, oauth.callback_error, locations.fetched, locations.none_found.
sourcestringRequiredOne of: invite_link, connect_google_page, registration, settings, debugger.
store_review_site_idintegerOptionalBinds the event to a row (must be accessible via hash/token).
hashstringOptionalInvite hash [store_id, 15]; grants access without a token.
company_id_hashstringOptionalEncoded id of the account (public connect page).
messagestring (≤500)OptionalError detail returned by Google, if any.
accounts_countinteger (≥0)OptionalAccounts listed.
locations_countinteger (≥0)OptionalLocations listed.
{
  "event": "oauth.started",
  "source": "settings",
  "store_review_site_id": "<storeReviewSiteId>"
}

How it works

Returns {data:{status:"recorded"}} on success; on an internal tracking error it swallows the failure and returns {data:{status:"skipped"}} so the SPA is never blocked. Validation errors and authentication failures return appropriate non-2xx status codes.

Response

200 Recorded · 200

{
  "data": {
    "status": "recorded"
  }
}

200 Skipped (tracking error swallowed) · 200

{
  "data": {
    "status": "skipped"
  }
}

422 Validation error · 422

{
  "message": "The selected event is invalid.",
  "errors": {
    "event": [
      "The selected event is invalid."
    ]
  }
}

Errors

StatusMeaning
401The bearer token is missing, expired or invalid
422Validation error
500Unexpected server error

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/google/connection-event" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"event": "oauth.started", "source": "settings", "store_review_site_id": "<storeReviewSiteId>"}'

Did this page help you?