web_interface:sync_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
web_interface:sync_api [2021/06/22 10:11] – [HTTP POST] Adrian Booneweb_interface:sync_api [2023/06/26 12:09] (current) Gary Willetts
Line 1: Line 1:
 {{indexmenu_n>100}} {{indexmenu_n>100}}
-====== 18.10. mSupply sync API ======+====== 19.11. mSupply sync API ======
 ===== What is it? ===== ===== What is it? =====
 There are multiple ways to configure an mSupply installation. Where the internet is good, or you are using a local area network, you can have real-time communication with an mSupply server. Where internet access is poor or non-existent, we have mSupply sync. You can have a local application that saves all the changes the user makes to a local database - this can be a mobile app, a single user application on a PC or a tablet, or a client-server application on a local LAN.  There are multiple ways to configure an mSupply installation. Where the internet is good, or you are using a local area network, you can have real-time communication with an mSupply server. Where internet access is poor or non-existent, we have mSupply sync. You can have a local application that saves all the changes the user makes to a local database - this can be a mobile app, a single user application on a PC or a tablet, or a client-server application on a local LAN. 
  
-The machine on which the data is stored, which we call a //satellite//, then periodically communicates with a central mSupply server, which we call the //primary// - this may be in a central location in the country, or it may be a cloud-based server. The REST API described here is used to send and receive data from the primary server to keep both satellite and primary sites up to date with data additions, modifications and deletions. See [[other_stuff:remote_sync|Remote Synchronisation]] for more details on how sync works.+The machine on which the data is stored, which we call a //satellite//, then periodically communicates with a central mSupply server, which we call the //primary// - this may be in a central location in the country, or it may be a cloud-based server. The REST API described here is used to send and receive data from the primary server to keep both satellite and primary sites up to date with data additions, modifications and deletions. See [[synchronisation:introduction|]] for more details on how sync works.
  
 ===== Basics ===== ===== Basics =====
Line 166: Line 166:
 \\ \\
  
-=== PATIENT HISTORY === +=== HTTP GET === 
-**GET** +
 <code>https://example.com/sync/v4/patient_history?id=[name id]</code> <code>https://example.com/sync/v4/patient_history?id=[name id]</code>
 Requests patient dispensing history for the specified name record Requests patient dispensing history for the specified name record
Line 226: Line 226:
  
 A 401 will be returned if authentication fails. A 401 will be returned if authentication fails.
 +
 +
 +===== Available calls (v5) =====
 +==== HTTP GET ====
 +=== central_records ===
 +<code>https://example.com/sync/v5/central_records?cursor=0&limit=1000</code>
 +Requests sync change log records for the sync site matching the authentication sent in the header.
 +
 +== Attributes ==
 +  * **cursor**: the record number to return from. e.g. ''cursor=10'' means start returning from the 10th record onwards.
 +  * **limit**: the maximum number of records that can be returned. If omitted, the //limit// is set to 1000. If a //limit// value above 1000 is used, the //limit// is set to 1000.
 +
 +=== queue ===
 +<code>https://example.com/sync/v5/queue?limit=[number of records]</code>
 +Requests sync records that require processing for the sync site which matches the authentication passed in the header.
 +
 +== Attributes ==
 +  * **limit**: the maximum number of records that can be returned. If ommitted, the //limit// is set to 1000. If a //limit// value above 1000 is used, the //limit// is set to 1000.
 +
 +
 \\ \\
 \\ \\
-|  //  Previous:  **[[web_interface:apis]]** | | Next: **[[mobile:]]** //  |+|  //  Previous:  **[[web_interface:apis]]** | | Next: **[[web_interface:unfpa_reports_app]]** //  |
 ---- struct data ---- ---- struct data ----
 pagestatus.status    :  pagestatus.status    : 
 ---- ----
  
  • Last modified: 2021/06/22 10:11
  • by Adrian Boone