Integration methods: sync
The Integration Verbs sync as typed SDK methods, with inputs, result, refusals and an example.
Reference for Integration, one group of Integration methods.
Integration.sync
Sync exchanges records between a System and its connector, and the declared leader wins every conflict. Verb page.
interface IntegrationVerbs {
sync(input: IntegrationSyncInput, options?: SB.CallOptions): SB.Call<Integration>
}Emits Integration.synced.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
integration | Integration | required | The connector to sync. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
integration | Integration | required | The Integration with its sync cursor moved. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The request carries no key, or its key is expired or revoked. | unauthorized | Sign in again, or send a current key as a bearer token. | None. |
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
| The caller sent more requests than its rate allows. | rate-limited | Wait the number of seconds in the Retry-After header, then retry. | None. |
Example
import { $ } from 'startup-builder'
const integration = await $.Integration.sync({ integration: 'integration_alVwjQcmRy' })