The Spanish version is the authoritative reference. View in Spanish
Docupath: Periodic polling — automatic process
Flow ② (Docupath → Gosocket) delivers the processed document via push, but it only happens once the document reaches approved status in Docupath — a transition that requires manual review in the portal, since Docupath's auto-approval ("autoreview") feature doesn't behave reliably. That's why Flow ② is only a manual contingency, not the main mechanism.
This flow (③) is the integration's automatic process: Gosocket queries the result directly on its own, following a three-tier escalating retry policy, without depending on anyone approving anything by hand in the portal.
Process actors
Environments
| Environment | Base URL |
|---|---|
| DEV / Testing | https://api.docupathdev.app |
| PRD / Production | https://api.docupath.app |
Same credentials and access_token as Flow ① (Gosocket → Docupath) — no additional authentication is required.
Process flow
Step 1 — Authentication
This flow reuses the OAuth 2.0 access_token obtained in Flow ①. If it expired (it lasts ~1 hour), renew it with the refresh_token before continuing polling — see POST /v1/oauth/token. Since the total polling window can stretch up to 15 hours (see below), the token gets renewed several times over the course of the process.
Step 2 — Poll periodically
GET /v1/documents/search?external_id={id} using the same external_id that Gosocket sent in Flow ①. The retry policy has three nested tiers:
In the worst case (no valid response is ever received), Gosocket performs a total of 125 queries (5 queries × 5 reprocesses × 5 repetitions), spanning 12 to 15 hours between the first and last query. If all retries run out without current_status reaching pending_review or approved, the document must be flagged as pending/error in Gosocket's monitoring table for manual review — Docupath doesn't proactively notify when a document gets stuck in processing.
Step 3 — Obtain XML and PDF
As soon as the response includes processed_info, polling is considered resolved — there's no need to wait for approved: