Saltar al contenido

Queue an integration sync

Módulo Settings

POST/integrations/{id}/syncsintegrations.sync

Queues a sync run on a Connected connection; the run is attempted by the platform job queue with retries. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.

  • Requiere la capacidad org.integrations.manage.
  • Alcances de OAuth: org.
  • Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
  • Estados de error: 400, 401, 404, 409, 422, 429. Los errores son detalles de problema RFC 9457.

Parámetros de ruta y de consulta

integrations.sync: Parámetros de ruta y de consulta
CampoTipoObligatorioDescripción
idstring (uuid)SíIdentifier of the integration.

Cuerpo de la solicitud: IntegrationSyncRequest

integrations.sync: IntegrationSyncRequest
CampoTipoObligatorioDescripción
scope"Ledger Export" | "Payment Sync" | "Calendar Sync" | "File Import" | "Notification Delivery" | "Payroll Export" | "Tracking Refresh" | "Attendance Import"SíWhat to sync; must belong to the connection's category.
direction"Inbound" | "Outbound" | "Two Way"SíDirection of the sync.
project_idstring (uuid) | nullNoIdentifier of the project.
{
  "scope": "Ledger Export",
  "direction": "Outbound",
  "project_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Respuesta 202: IntegrationSyncQueued

integrations.sync: IntegrationSyncQueued
CampoTipoObligatorioDescripción
sync_run_idstring (uuid)SíIdentifier of the sync run.
{
  "sync_run_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Ejemplos de código

curl -X POST "$XOS_BASE_URL/integrations/0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f/syncs" \
  -H "Authorization: Bearer $XOS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"scope":"Ledger Export","direction":"Outbound","project_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}'
const { data } = await xos.integrations.sync("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {
    "scope": "Ledger Export",
    "direction": "Outbound",
    "project_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
  });
response = xos.integrations.sync("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {"scope": "Ledger Export", "direction": "Outbound", "project_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"})
xos integrations sync 0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f --data '{"scope":"Ledger Export","direction":"Outbound","project_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}'