Resource Synchronization

PortSIP PBX RESTful APIs allow a client to request only resources that have changed. The high-level process is as follows:

  • Client requests a sync token from the server.

  • Server reports token 001.

  • Some time passes.

  • Client makes a sync request on the resource and supplies token 001.

  • Server returns resources that have been created, updated, or deleted and returns token 002. As you can see, after the initial sync, only items that have been created, updated, or deleted will be sent. This has several advantages. The transmitted HTTP response bodies can generally be much shorter, and it is easier on both the client and server in terms of memory and CPU usage because only a limited set of items need to be compared.

Note that a server is free to "forget" any sync tokens that have been previously issued. In this case, a full sync may be needed again. If the supplied sync token is not recognized by the server, an HTTP status code 403 is returned.