πŸ” Overview

Link Switcher delegates Google Search Console automation to an external gsc-gui-tools service.

Requests are created in Link Switcher, sent via HTTP, and later finalized by a callback endpoint.

The integration uses two models:

  • DomainAppealRequest β€” request to send an appeal for a domain/root domain.
  • DomainSafetyRequest β€” request to check whether a domain is safe; can trigger tracking-domain blocking/switching.

πŸ“¦ DomainAppealRequest

Stores a single β€œsend appeal” request.

πŸ“‘ Fields

FieldTypeDescription
ownerForeign Key UserRequest owner (nullable).
domainstrDomain/root domain the appeal is created for.
account_emailemailGoogle account email used by gsc-gui-tools (filled by callback).
created_atdatetimeRequest creation timestamp.
finished_atdatetimeCompletion timestamp (set by callback).
is_sentboolTrue if the appeal was sent successfully.
screenshot_urlURLPublic URL to a screenshot captured during execution (optional).
error_messagetextError details when the request failed (optional).
request_idstrRequest ID in gsc-gui-tools (optional).
tokenstrUnique token used to match callback requests.

🧩 Methods

MethodDescription
can_send_appeal(domain, owner_id)Cooldown check: blocks repeated successful appeals within the last 12 hours.
init_domain_appeal(domain, owner)Creates the record and sends the request to gsc-gui-tools.

πŸ“¦ DomainSafetyRequest

Stores a single β€œdomain safety check” request.

πŸ“‘ Fields

FieldTypeDescription
ownerForeign Key UserRequest owner (nullable).
domainstrDomain to be checked.
account_emailemailGoogle account email used by gsc-gui-tools (filled by callback).
created_atdatetimeRequest creation timestamp.
finished_atdatetimeCompletion timestamp (set by callback).
is_safebool / nullTrue = safe, False = unsafe, None = request failed (see error_message).
screenshot_urlURLPublic URL to a screenshot captured during execution (optional).
error_messagetextError details when the request failed (optional).
request_idstrRequest ID in gsc-gui-tools (optional).
tokenstrUnique token used to match callback requests.

🧩 Methods

MethodDescription
init_domain_check(domain, owner)Creates the record and sends the safety-check request to gsc-gui-tools.
run_switch_tracking_domain()If the domain is unsafe (or check failed), triggers tracking-domain blocking workflow.

πŸ” Callback flow

  • gsc-gui-tools calls Link Switcher callback endpoints with ?token=....
  • The callback updates finished_at, is_sent / is_safe, screenshot_url, and error_message.
  • Safety-check callback additionally runs run_switch_tracking_domain().

For related logic, see: