Connect

Get Google Search Console OAuth connect URL

Changed on

Starts OAuth for Google Search Console. Each connected site becomes its own account with platform googlesearchconsole; it reads Google Search data and does not post.

Requested scope: https://www.googleapis.com/auth/webmasters.readonly.

Flow

Redirect the user to authUrl.

  • One verified site: Zernio connects it and redirects to redirect_url (or the dashboard) with connected=googlesearchconsole, profileId, accountId and username (the site, such as acme.com).
  • Several sites: the user first picks one on a Zernio-hosted page, which then redirects the same way.

Your own site picker

Add headless=true to redirect_url. Zernio then redirects there with step=select_site, profileId, platform=googlesearchconsole and a pendingDataToken for GET /v1/connect/googlesearchconsole/sites and POST /v1/connect/googlesearchconsole/select-site.

Errors

On failure the redirect carries error, platform=googlesearchconsole and error_message. Errors include:

  • googlesearchconsole_scope_missing: the user unticked Search Console access.
  • googlesearchconsole_no_sites: the Google account has no verified Search Console site.
  • googlesearchconsole_no_refresh_token: Google returned no refresh token; connect again.
get/v1/connect/googlesearchconsole

Request

  • Base URL
    https://zernio.com/api
  • Auth
    • HTTP bearer
    • or API key in header X-Connect-Token

Query parameters

profileIdstring required

Your Zernio profile ID (get from /v1/profiles).

redirect_urlstring

Custom redirect after connection. Must be an absolute http(s) URL or custom app scheme such as myapp://callback; relative and unsafe URLs return 400.

reconnectAccountIdstring

Zernio account ID of the Google Search Console account being reconnected. Picking a different site then fails instead of adding a second account.

welcomeboolean

When true, authUrl opens on the Zernio-hosted welcome screen with your brand, as on GET /v1/connect/{platform}, naming Google Search Console.

  • With no redirect_url, the flow ends on the branded result page instead of the Zernio dashboard.
  • When left out, the screen shows if the workspace saved it as on by default (PUT /v1/connect/welcome-screen). Pass false to skip it.
  • Cannot be combined with headless=true in redirect_url (400 INVALID_FIELD_VALUE).
brandNamestring

Welcome screen only: your product name in its heading. Same rules as on GET /v1/connect/{platform}.

logoUrlstring uri

Welcome screen only: https URL of your square logo. Rejected with 400 INVALID_FIELD_VALUE when the welcome screen is not shown.

primaryColorstring

Welcome screen only: hex colour (#RRGGBB) of its button.

welcomeThemestring

Welcome screen only: a URL-encoded JSON object restyling and rewording the welcome screen and the result page, with the keys documented on GET /v1/connect/{platform}. Rejected when the welcome screen is not shown.

Response

OAuth authorization URL and authenticated state

authUrlstring uri required

Google URL to open in the user agent.

statestring required

Authenticated, expiring OAuth state handled by the callback.

Changes

    • info

      added the new optional query request parameter brandName

    • info

      added the new optional query request parameter logoUrl

    • info

      added the new optional query request parameter primaryColor

    • info

      added the new optional query request parameter welcome

    • info

      added the new optional query request parameter welcomeTheme

    • info

      endpoint added