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:apis [2019/10/28 19:49] – [16.09. mSupply mobile API] Emily Porrelloweb_interface:apis [2023/06/26 12:10] (current) – [Errors] Gary Willetts
Line 1: Line 1:
-{{indexmenu_n>100}} +{{indexmenu_n>95}} 
-====== 16.09. mSupply Mobile API ====== +====== 19.10. mSupply legacy REST APIs ======
 ===== What is it? ===== ===== What is it? =====
- 
 This document describes an application programming interface for communicating with mSupply. This document describes an application programming interface for communicating with mSupply.
  
Line 12: Line 10:
  
 ===== Authentication ===== ===== Authentication =====
- 
   * All requests must have standard HTTP basic authentication headers   * All requests must have standard HTTP basic authentication headers
   * You **must** use SSL to secure your communications unless you want to tell the world your password.   * You **must** use SSL to secure your communications unless you want to tell the world your password.
Line 88: Line 85:
 ^ Fields you can query | none. Just call the ID number like this \\ <code>http://example.com/mobile/invoice/578</code> | ^ Fields you can query | none. Just call the ID number like this \\ <code>http://example.com/mobile/invoice/578</code> |
 ^ Returns by default JSON array containing | id \\ name_id \\ name_name (The actual name of the customer or supplier) \\ total \\ their_ref \\ type \\ entry_date \\ confirm_date \\ comment \\ entered_by (username not ID) \\ store (name not ID) \\ hold \\ lines: contains an array containing the lines on the invoice. Each array row contains: \\ item_id \\ item_name \\ quantity (no. of individual items i.e. pack size x quantity in a pack) \\ stock: \\ contains an array of all stock lines used on the invoice, and also any other stock lines for items on the invoice whose quantity is greater than zero. This means that for a "normal" invoice line editing operation (where you are not changing the item) you already have all the information that you need without a further call to the REST server when a line is edited) | ^ Returns by default JSON array containing | id \\ name_id \\ name_name (The actual name of the customer or supplier) \\ total \\ their_ref \\ type \\ entry_date \\ confirm_date \\ comment \\ entered_by (username not ID) \\ store (name not ID) \\ hold \\ lines: contains an array containing the lines on the invoice. Each array row contains: \\ item_id \\ item_name \\ quantity (no. of individual items i.e. pack size x quantity in a pack) \\ stock: \\ contains an array of all stock lines used on the invoice, and also any other stock lines for items on the invoice whose quantity is greater than zero. This means that for a "normal" invoice line editing operation (where you are not changing the item) you already have all the information that you need without a further call to the REST server when a line is edited) |
-^ Example |<code>+^ Example |<code javascript>
 { {
   "id" : 587,   "id" : 587,
Line 238: Line 235:
 ^ Returned  | JSON containing the "Successfully sent" or any errors encounters  | ^ Returned  | JSON containing the "Successfully sent" or any errors encounters  |
 ^Example | <code>http://example.com/mobile/report/type=currentstock</code> | ^Example | <code>http://example.com/mobile/report/type=currentstock</code> |
 +
 +=== Patients ===
 +|<90% 35%>|
 +^ Resource name  | patient |
 +^ Query parameters | first_name: first name of patient \\ last_name: last name of patient \\ dob: patient date of birth (DD:MM:YY) \\ policy_number: patient insurance policy number |
 +^ Returned  | JSON array of patient objects matching query parameters: \\ <code>
 +[{
 +  "ID":,
 +  "name",
 +  "phone",
 +  "customer",
 +  "bill_address1",
 +  "supplier",
 +  "email",
 +  "code",
 +  "last", 
 +  "first",
 +  "date_of_birth",
 +  "type",
 +  "manufacturer",
 +  "bill_address3",
 +  "bill_address4",
 +  "bill_postal_zip_code",
 +  "supplying_store_id",
 +  "nameNotes": ["note1","note2", ...],
 +  "nameInsuranceJoin": [{ 
 +    "ID",
 +    "insuranceProviderID",
 +    "nameID",
 +    "isActive",
 +    "policyNumberFamily", 
 +    "policyNumberPerson", 
 +    "type", 
 +    "discountRate",
 +    "expiryDate",
 +    "policyNumberFull",
 +    "enteredByID" }, ... ],
 + }, ... ] </code> |
 +^ Example | <code>http://example.com/api/v4/patient?first_name=j@&last_name=doe&dob=01/01/1960</code> |
 +
 +=== Prescribers ===
 +|<90% 35%>|
 +^ Resource name  | prescriber |
 +^ Query parameters | first_name: first name of prescriber \\ last_name: last name of prescriber \\ code: prescriber code |
 +^ Returned  | JSON array of prescriber objects matching query parameters: \\ <code>
 +[{
 +   "ID",
 +   "code",
 +   "first_name",
 +   "last_name",
 +   "initials",
 +   "registration_code",
 +   "category",
 +   "address1",
 +   "address2",
 +   "phone",
 +   "mobile",
 +   "email",
 +   "female",
 +   "active",
 +   "store_ID"
 +}, ... ] </code> |
 +^ Example | <code>http://example.com/api/v4/prescriber?first_name=j@&last_name=doe&code=foo@</code> 
  
 ==== The Stock Endpoint ==== ==== The Stock Endpoint ====
  
 This API is used by the mSupply stock web app. This API is used by the mSupply stock web app.
- 
  
  
Line 348: Line 407:
 \\ \\
 \\ \\
-|  //  Previous:  **[[web_interface:stock|16.08. Stock Web App]]** | | Next: **[[web_interface:sync_api|16.10. mSupply sync API]]** //  |+|  //  Previous:  **[[web_interface:rest_api]]** | | Next: **[[web_interface:sync_api]]** //  |
  
 ---- struct data ---- ---- struct data ----
 +pagestatus.status    : 
 ---- ----
  
  • Last modified: 2019/10/28 19:49
  • by Emily Porrello