Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Pull changes since a revision

Any signed in user. Returns a device’s changes past since_rev, oldest first, cursor max_rev. It is a delta feed, so a caller advances its cursor and repeats until max_rev stops moving.

GET/api/v1/sync/pull
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Query parameters
device_idstringrequired

The device whose branch scope the pull is read through.

since_revinteger

Return changes above this revision. Defaults to 0.

limitinteger

Rows to return, capped at 1000. Defaults to 500.

Responses
200

The delta and the new cursor

changesobject[]required
Show properties
Array of object
revintegerrequired
min -9007199254740991 · max 9007199254740991
origin_branch_idstringrequired
entitystringrequired
entity_idstringrequired
operationstringrequired
to_branch_idstring | nullrequired
payloadobjectrequired
max_revintegerrequired
min -9007199254740991 · max 9007199254740991
400

device_id is missing, since_rev or limit is not a non-negative integer, or limit is below 1

detailstringrequired
401

Not authenticated

detailstringrequired
403

The device belongs to another branch, or the device has been revoked

detailstringrequired
404

Unknown device

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/sync/pull?device_id=string' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "changes": [
    {
      "rev": -9007199254740991,
      "origin_branch_id": "string",
      "entity": "string",
      "entity_id": "string",
      "operation": "string",
      "to_branch_id": "string",
      "payload": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "max_rev": -9007199254740991
}