π 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
| Field | Type | Description |
|---|---|---|
owner | Foreign Key User | Request owner (nullable). |
domain | str | Domain/root domain the appeal is created for. |
account_email | Google account email used by gsc-gui-tools (filled by callback). | |
created_at | datetime | Request creation timestamp. |
finished_at | datetime | Completion timestamp (set by callback). |
is_sent | bool | True if the appeal was sent successfully. |
screenshot_url | URL | Public URL to a screenshot captured during execution (optional). |
error_message | text | Error details when the request failed (optional). |
request_id | str | Request ID in gsc-gui-tools (optional). |
token | str | Unique token used to match callback requests. |
π§© Methods
| Method | Description |
|---|---|
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
| Field | Type | Description |
|---|---|---|
owner | Foreign Key User | Request owner (nullable). |
domain | str | Domain to be checked. |
account_email | Google account email used by gsc-gui-tools (filled by callback). | |
created_at | datetime | Request creation timestamp. |
finished_at | datetime | Completion timestamp (set by callback). |
is_safe | bool / null | True = safe, False = unsafe, None = request failed (see error_message). |
screenshot_url | URL | Public URL to a screenshot captured during execution (optional). |
error_message | text | Error details when the request failed (optional). |
request_id | str | Request ID in gsc-gui-tools (optional). |
token | str | Unique token used to match callback requests. |
π§© Methods
| Method | Description |
|---|---|
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, anderror_message. - Safety-check callback additionally runs
run_switch_tracking_domain().
For related logic, see: