From 8d18a63732e5f6050eb1109c5f2fbb48d46e1c19 Mon Sep 17 00:00:00 2001 From: Wogiebear Date: Thu, 22 Jan 2015 14:45:57 +0000 Subject: [PATCH 1/5] Created DataFields.md as reference for data fields This page should contain pretty much a raw dump of the corresponding table in the database. TO DO: retrospectively add a plain english description field to the database tables so that the 'Details' comments can be kept at source. --- doc/DataFields.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 doc/DataFields.md diff --git a/doc/DataFields.md b/doc/DataFields.md new file mode 100644 index 0000000..947a139 --- /dev/null +++ b/doc/DataFields.md @@ -0,0 +1,29 @@ +#Overview + +This page provides details on the data fields that help define the resources or objects that SMART is built to serve. + +The names of the fields represent the corresponding columns in the database and are identical to the name of the fields in each API call. + +While we will try to keep this up-to-date, discrepancies will inevitably kick in. We'd like to ask that if you find a discrepancy or inaccuracies, then please let us know at [The Product Works](http://www.theproduct.works/about-us/) + +#Contents + +- [Baby Fields](#baby-fields) + +##Baby Fields + + Table "public.baby" + + Column | Type | Details +------------------------|-----------------------------|--------------------------------------------------- + hospital_number | character varying(40) | Standard format, i.e. "H3nnnnnnn", where n=[0-9] + gender | character varying(10) | Male \| Female + weight | integer | Stored in grams; should be displayed as kilograms to 2 decimal places + delivery_date_time | timestamp without time zone | YYYY-MM-DD HH:MM:SS (e.g. 2014-09-09 13:45:00" + vitamin_k | character varying(20) | _null_ \| Oral \| IM \| Declined \| N/A + hearing | character varying(30) | _null_ \| Complete \| Appt Given \| Declined + newborn_screening_test | character varying(15) | _null_ \| Done \| Declined + name | character varying(40) | _null_ \| Conor! + birth_outcome | character varying(20) | _null_ \| Liveborn \| Stillborn \| Neo-natal death \| Complete Miss \| Incomplete Miss \| Ectopic \| TOP + +[Top of page ↑](#overview) From 1788074c3a22931abaf2c4e2f389039f3ac1ca4f Mon Sep 17 00:00:00 2001 From: Wogiebear Date: Thu, 22 Jan 2015 15:21:30 +0000 Subject: [PATCH 2/5] Added Pregnancy fields --- doc/DataFields.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/DataFields.md b/doc/DataFields.md index 947a139..12cb9cf 100644 --- a/doc/DataFields.md +++ b/doc/DataFields.md @@ -10,6 +10,24 @@ While we will try to keep this up-to-date, discrepancies will inevitably kick in - [Baby Fields](#baby-fields) +## Pregnancy Fields + +Table "public.pregnancy" + + Column | Type | Details +-------------------------|------------------------|-------------------------------------------------------- + estimated_delivery_date | date | YYYY-MM-DD + additional_info | character varying(500) | _TBC_ + birth_mode | character varying(50) | One or more of the following: Svd \| Ventose \| Forceps \| Failed Ventose \| Failed forceps \| LSCS \| + perineum | perineum_choice | Single selection from following options: Intact \| 1 degree with sutures \| 1 degree without sutures \| 2 degree \| 3 degree \| 4 degree + service_user_id | integer | Internal ID of the mother's record + anti_d | character varying(50) | _TBC_ + created_at | date | not null + last_menstrual_period | date | + feeding | feeding_types | Single selection from: Breast \| bottle \| Mixed + + [Top of page ↑](#overview) + ##Baby Fields Table "public.baby" @@ -26,4 +44,4 @@ While we will try to keep this up-to-date, discrepancies will inevitably kick in name | character varying(40) | _null_ \| Conor! birth_outcome | character varying(20) | _null_ \| Liveborn \| Stillborn \| Neo-natal death \| Complete Miss \| Incomplete Miss \| Ectopic \| TOP -[Top of page ↑](#overview) + [Top of page ↑](#overview) From bc6c29c1c499f2e48992dc098d880757c5b4f328 Mon Sep 17 00:00:00 2001 From: Wogiebear Date: Thu, 22 Jan 2015 15:32:20 +0000 Subject: [PATCH 3/5] Updated data for baby and pregnancy records --- doc/api.md | 312 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 181 insertions(+), 131 deletions(-) diff --git a/doc/api.md b/doc/api.md index 28b2b42..4aa058d 100644 --- a/doc/api.md +++ b/doc/api.md @@ -1,6 +1,6 @@ #Introduction -This page serves as the API doc for the SMART API. In it, we've tried to describe all of the requests and resources that the API will serve. We've purposely steered clear of describing each and every field in each and every call—such API docs rapidly grow in our experience—and instead supply examples of each request-response combo as the most effective way to show how to use the API. Many of the fields are self-explanatory but where necessary we provide a description. +This page serves as the API doc for the SMART API. In it, we've tried to describe all of the requests and resources that the API will serve. We've purposely steered clear of describing each and every field in each and every call—such API docs rapidly grow in our experience—and instead are using examples for each request and response as a way to document the API. The fields are pretty self-explanatory but where necessary we provide a description. As with anything, this is far from perfect or 100% accurate, so if you spot an inaccuracy or have a question about any of the content, please let us know at [The Product Works](http://www.theproduct.works/about-us/) @@ -10,9 +10,13 @@ As with anything, this is far from perfect or 100% accurate, so if you spot an i - [/login](#post-login) - [/logout](#post-logout) - [User Account Management](#user-account-management) - - [/reset_password](#post-reset_password) - - [/reset_passwords/:TOKEN](#put-reset_passwords-token) - + - [/reset_passwords](#post-reset_passwords) + - [/reset_passwords/:TOKEN](#put-reset_passwordstoken) + +- [Babies](#baby-resources) + - [GET /babies](#getbabies] + - [POST /babies](#postbabies) + - [PUT /babies/:ID](#putbabiesid) #Authentication @@ -26,9 +30,7 @@ In order to create and destroy a session, the following calls are supported: **NOTE** If the ```Auth-Token``` becomes invalid or expired for any reason, such as a ```service_provider``` becoming inactive, then the API will return a 401 response to any authenticated request. At that point any client should destroy any stored data on the device and show the login screen. - ---------- - ##POST /login ####Notes @@ -52,7 +54,7 @@ If the ```Auth-Token``` becomes invalid or expired for any reason, such as a ``` { "login": { - "token": "S3cr3t", + "token": "S3cr3tT0k3n", "id": 234 } } @@ -73,7 +75,7 @@ If the ```Auth-Token``` becomes invalid or expired for any reason, such as a ``` ```bash $ curl -X POST http://54.72.7.91:8888/logout \ - -H "Auth-Token: S3cr3t" + -H "Auth-Token: S3cr3tT0k3n" { "login": { @@ -94,7 +96,9 @@ Note: if you have SMART installed locally, you need to insert a unique string as __IMPORTANT: the ```Api-Key``` must be included in each API request (other than [/login](#post-login) and [/logout](#post-logout)) and it must match the key stored in the SMART backend.__ ----------- +#User Account Management + + ## POST /reset_passwords ####Notes @@ -112,7 +116,7 @@ __IMPORTANT: the ```Api-Key``` must be included in each API request (other than ``` $ curl -X POST 54.72.7.91:8888/reset_passwords \ -d "{"email":"sp@sp.com","username":"sp"}" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "reset_password": { @@ -141,9 +145,9 @@ $ curl -X POST 54.72.7.91:8888/reset_passwords \ ####Example: ``` -$ curl -X PUT 54.72.7.91:8888/reset_passwords/S3cr3tT0k3n \ +$ curl -X PUT 54.72.7.91:8888/reset_passwords/S3cr3tT0k3nT0k3n \ -d "{"password":"newPwd1234","password_verification":"newPwd1234"}" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "reset_password": { @@ -177,8 +181,8 @@ Actions available to act on the Appointments resource. Deals with everything tha ``` $ curl -X GET 54.72.7.91:8888/appointments -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "appointments": [ @@ -219,9 +223,9 @@ $ curl -X GET 54.72.7.91:8888/appointments -d '{}' \ ``` $ curl -X POST 54.72.7.91:8888/appointments \ -d '{"date":"2014-12-12","time":"13:00:00","priority":"scheduled","visit_type":"post-natal","service_provider_id":125,"service_user_id":345,"clinic_id":1}'\ - -H "Auth-Token: S3cr3t" \ + -H "Auth-Token: S3cr3tT0k3n" \ -H "Content-Type: application/json" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -b /tmp/cookies.txt { @@ -252,8 +256,8 @@ Show details of appointment looked up by `Appointment ID` ``` $ curl -X GET 54.72.7.91:8888/appointments/1 -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "appointments": { @@ -287,8 +291,8 @@ $ curl -X GET 54.72.7.91:8888/appointments/1 -d '{}' \ $ curl -X PUT 54.72.7.91:8888/appointments/1 \ -d '{"date":"2014-12-12","time":"13:00:00","service_provider_id":1}'\ -H "Content-Type: application/json"\ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -b /tmp/cookies.txt { @@ -318,8 +322,8 @@ $ curl -X PUT 54.72.7.91:8888/appointments/1 \ ``` $ curl -X DELETE 54.72.7.91:8888/appointments/1 \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "appointments": { @@ -350,8 +354,8 @@ ServiceOptions to be applied to Clinics and Appointments. ServiceOptions are the ####Example ```bash $ curl -X GET 54.72.7.91:8888/service_options -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -378,8 +382,8 @@ $ curl -X GET 54.72.7.91:8888/service_options -d '{}' \ ####Example ```bash $ curl -X GET 54.72.7.91:8888/service_options/1 -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -408,8 +412,8 @@ Nested endpoint to list, apply or remove service options from Appointments. ####Example ```bash $ curl -X get 54.72.7.91:8888/appointments/1/service_options -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "service_options": [ @@ -435,8 +439,8 @@ $ curl -X get 54.72.7.91:8888/appointments/1/service_options -d '{}' \ ####Example ```bash $ curl -X POST 54.72.7.91:8888/appointments/1/service_options \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -d '{"service_option": {"id":1}}' -H 'Content-Type: application/json' { @@ -459,8 +463,8 @@ $ curl -X POST 54.72.7.91:8888/appointments/1/service_options \ ####Example ```bash $ curl -X DELETE 54.72.7.91:8888/appointments/1/service_options/1 \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -488,8 +492,8 @@ Get all the clinics that are in the system ####Example ```bash $ curl -X GET 54.72.7.91:8888/clinics -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -537,8 +541,8 @@ Get a specific clinic ####Example ```bash $ curl -X GET 54.72.7.91:8888/clinics/1 -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -578,8 +582,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1 -d '{}' \ ####Example ```bash $ curl -X GET 54.72.7.91:8888/clinics/1 \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' \ -d '{"clinic": {"name": "New Clinic", "address": "George's Street"}}' @@ -621,8 +625,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1 \ ```bash $ curl -X GET 54.72.7.91:8888/clinics/1 \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -663,8 +667,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1 \ ```bash $ curl -X POST 54.72.7.91:8888/clinics \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' \ -d '{"clinic": {"name": "New Clinic", "address": "George's Street"}}' @@ -706,8 +710,8 @@ These announcements/notes are in place to notify the midwives on rota in case th ####Example ```bash $ curl -X GET 54.72.7.91:8888/clinics/1/announcements -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -736,8 +740,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1/announcements -d '{}' \ ####Example ```bash $ curl -X GET 54.72.7.91:8888/clinics/1/announcements/2 -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -763,9 +767,9 @@ $ curl -X GET 54.72.7.91:8888/clinics/1/announcements/2 -d '{}' \ ####Example ```bash $ curl -X POST 54.72.7.91:8888/clinics/1/announcements \ - -H "Auth-Token: S3cr3t" \ + -H "Auth-Token: S3cr3tT0k3n" \ -H 'Content-Type: application/json' \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -d '{"note": "No bookings please on Monday","date": "2014-08-11","blocking": true}' { @@ -794,8 +798,8 @@ $ curl -X POST 54.72.7.91:8888/clinics/1/announcements \ ####Example ```bash $ curl -X DELETE 54.72.7.91:8888/clinics/1/announcements/2 \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H 'Content-Type: application/json' { @@ -823,8 +827,8 @@ $ curl -X DELETE 54.72.7.91:8888/clinics/1/announcements/2 \ ####Example ``` $ curl -X GET 54.72.7.91:8888/service_users -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "service_users": [ @@ -885,8 +889,8 @@ Hospital number lookup. ``` $ curl -X GET 54.72.7.91:8888/service_users/1 -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "service_users": [ @@ -933,8 +937,8 @@ $ curl -X GET 54.72.7.91:8888/service_users/1 -d '{}' \ $ curl -X POST 54.72.7.91:8888/service_users \ -d '{"service_user":{"hospital_number":"H2345245", "clinical_fields":{"blood_type":"A+","estimated_delivery_date":"2015-03-03"},"personal_fields":{"home_address":"Scapemanus\nNavan\nCo Meath", "home_post_code": "D2", "home_type": "apartment", "home_county": "Dublin","directions": "Turn left at the thing","dob": "1988-04-03","email":"smyth@gmail.com","home_phone":"0852351234","mobile_phone": "0852351234","name": "John Smyth","next_of_kin_phone": "0852351234", "next_of_kin_name": "John Smith"}}}'\ -H "Content-Type: application/json" \ - -H "Api-Key: 3g3tyh43gswe" \ - -H "Auth-Token: S3cr3t" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ + -H "Auth-Token: S3cr3tT0k3n" \ { "service_user": { @@ -977,8 +981,8 @@ $ curl -X POST 54.72.7.91:8888/service_users \ $ curl -X PUT 54.72.7.91:8888/service_users/1 \ -d '{"service_user":{"hospital_number":"H2345245", "clinical_fields":{"blood_type":"A+","estimated_delivery_date":"2015-03-03"},"personal_fields":{"home_address":"Scapemanus\nNavan\nCo Meath","directions": "Turn left at the thing","dob": "1988-04-03","email":"smyth@gmail.com","home_phone":"0852351234","mobile_phone": "0852351234","name": "John Smyth","next_of_kin_phone": "0852351234", "next_of_kin_name": "John Smith"}}}'\ -H "Content-Type: application/json" \ - -H "Api-Key: 3g3tyh43gswe" \ - -H "Auth-Token: S3cr3t" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ + -H "Auth-Token: S3cr3tT0k3n" \ { "service_user": { @@ -1021,8 +1025,8 @@ CRUD interface for Service Providers. The API is locked down for Admin users onl ####Example ``` $ curl -X GET 54.72.7.91:8888/service_providers -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "service_providers": [ @@ -1056,8 +1060,8 @@ $ curl -X GET 54.72.7.91:8888/service_providers -d '{}' \ ####Example ``` $ curl -X GET 54.72.7.91:8888/service_providers/1 -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "service_provider": { @@ -1090,8 +1094,8 @@ $ curl -X GET 54.72.7.91:8888/service_providers/1 -d '{}' \ $ curl -X POST 54.72.7.91:8888/service_providers \ -d '{"service_provider": {"id": 1, "name": "Mary Murray", "username": "Mary M", "email": "caprisun@nmh.ie", "password": "*********", "active": true, "admin": true, "job_occupation": "Community Midwife", "job_level": "Resident", "primary_phone": "0865656777", "secondary_phone": "0865656777"}}'\ -H "Content-Type: application/json" \ - -H "Api-Key: 3g3tyh43gswe" \ - -H "Auth-Token: S3cr3t" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ + -H "Auth-Token: S3cr3tT0k3n" \ { "service_provider": { @@ -1125,8 +1129,8 @@ $ curl -X POST 54.72.7.91:8888/service_providers \ $ curl -X PUT 54.72.7.91:8888/service_providers/1 \ -d '{"service_provider": {"id": 1, "name": "Mary Murray", "username": "Mary M", "email": "caprisun@nmh.ie", "password": "*********", "active": true, "admin": true, "job_occupation": "Community Midwife", "job_level": "Resident", "primary_phone": "0865656777", "secondary_phone": "0865656777"}}'\ -H "Content-Type: application/json" \ - -H "Api-Key: 3g3tyh43gswe" \ - -H "Auth-Token: S3cr3t" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ + -H "Auth-Token: S3cr3tT0k3n" \ { "service_provider": { @@ -1144,26 +1148,31 @@ $ curl -X PUT 54.72.7.91:8888/service_providers/1 \ } } ``` +[Top of page ↑](#introduction) + ----------- -#Pregnancies Resource +#Pregnancies Resources -Create, Query and Update Pregnancy data +The following API calls detail the requests necessary to get data about pregnancies. +The API supports the creation, querying and updating of these records ## GET /pregnancies #####Notes * List all pregnancies - ####Input +* Nothing really (just don't forget that token!) + ####Output +Big list of pregnancy records. ####Example ```bash $ curl -X GET 54.72.7.91:8888/pregnancies -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "pregnancies": [ @@ -1182,26 +1191,30 @@ $ curl -X GET 54.72.7.91:8888/pregnancies -d '{}' \ ] } ``` +[Top of page ↑](#introduction) + ----------- ## GET /pregnancies/:ID #####Notes -Get data for a specific pregnancy - +* Get data for a specific pregnancy ####Input +* Internal ID of the pregnancy + ####Output +* All the details about the pregnancy. See a [full list of pregnancy fields here](https://github.com/TheProductWorks/smart_client/blob/master/doc/DataFields#pregnancy-fields) ####Example ```bash -$ curl -X GET 54.72.7.91:8888/pregnancies/1 -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" +$ curl -X GET 54.72.7.91:8888/pregnancies/54 -d '{}' \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "pregnancy": { - "id": 1, + "id": 54, "service_user_id": 1, "estimated_delivery_date": "2014-07-23", "additional_info": "N/A", @@ -1214,6 +1227,8 @@ $ curl -X GET 54.72.7.91:8888/pregnancies/1 -d '{}' \ } } ``` +[Top of page ↑](#introduction) + ----------- ## POST /pregnancies @@ -1221,17 +1236,22 @@ $ curl -X GET 54.72.7.91:8888/pregnancies/1 -d '{}' \ ####Notes * Create a new pregnancy - ####Input +* Any supported details about the pregnancy. See a [full list of pregnancy fields here](https://github.com/TheProductWorks/smart_client/blob/master/doc/DataFields#pregnancy-fields) + + ####Output +* All the details about the pregnancy. See a [full list of pregnancy fields here](https://github.com/TheProductWorks/smart_client/blob/master/doc/DataFields#pregnancy-fields) ####Example ```bash $ curl -X POST 54.72.7.91:8888/pregnancies \ - -d '{"pregnancy": {"service_user_id": 1, "estimated_delivery_date": "2014-07-23", "additional_info": "N/A", "birth_mode": ["Svd"], "perineum": "", "anti_d": "", "feeding": "", "last_menstrual_period": ""}}' + -d '{"pregnancy": {"service_user_id": 1, "estimated_delivery_date": "2014-07-23", \ + "additional_info": "N/A", "birth_mode": ["Svd"], "perineum": "", "anti_d": "", \ + "feeding": "", "last_menstrual_period": ""}}' -H "Content-Type: application/json" \ - -H "Api-Key: 3g3tyh43gswe" \ - -H "Auth-Token: S3cr3t" + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ + -H "Auth-Token: S3cr3tT0k3n" { "pregnancy": { @@ -1248,13 +1268,13 @@ $ curl -X POST 54.72.7.91:8888/pregnancies \ } } ``` +[Top of page ↑](#introduction) ----------- ## PUT /pregnancies/:ID ####Notes -Update pregnancy - +* Updates details about a pregnancy ####Input ####Output @@ -1262,30 +1282,35 @@ Update pregnancy ####Example ```bash $ curl -X PUT 54.72.7.91:8888/pregnancies \ - -d '{"pregnancy": {"service_user_id": 1, "estimated_delivery_date": "2014-07-23", "additional_info": "N/A", "birth_mode": ["Svd"], "perineum": "", "anti_d": "", "feeding": "", "last_menstrual_period": ""}}' + -d '{"pregnancy": {"service_user_id": 1, "estimated_delivery_date": "2014-07-23", \ + "additional_info": "N/A", "birth_mode": ["Svd"], "perineum": "", "anti_d": "", \ + "feeding": "", "last_menstrual_period": ""}}' -H "Content-Type: application/json" \ - -H "Api-Key: 3g3tyh43gswe" \ - -H "Auth-Token: S3cr3t" + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ + -H "Auth-Token: S3cr3tT0k3n" { "pregnancy": { "id": 1, - "service_user_id": 1, + "service_user_id": 123, "estimated_delivery_date": "2014-07-23", "additional_info": "N/A", "birth_mode": ["Svd"], - "perineum": "", + "perineum": "1 degree without sutures", "anti_d": "", - "feeding": "", - "last_menstrual_period": "", + "feeding": "Breast ", + "last_menstrual_period": "2014-01-02", "gestation": "23 + 4" } } ``` +[Top of page ↑](#introduction) + ----------- #Babies Resources +The following API calls give access to baby records and data within SMART. ## GET /babies @@ -1294,62 +1319,73 @@ $ curl -X PUT 54.72.7.91:8888/pregnancies \ ####Input +* Nothing really + ####Output +* List of all baby records and the data fields for each. See full list of [data field for a baby record](https://github.com/TheProductWorks/smart_client/blob/master/doc/DataFields#baby-fields) ####Example ```bash $ curl -X GET 54.72.7.91:8888/babies -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "babies": [ { "id": 1, - "pregnancy_id": 1, - "hospital_number": "H9999999", - "gender": "male", - "weight": 3720, - "delivery_date_time": "2014-07-24 12:12:12", - "vitamin_k": "yes", - "hearing": "test passed", - "newborn_screening_test": "passed" - }, + "pregnancy_id": 100, + "hospital_number": "H39999999", + "gender": "male", + "weight": 3720, + "delivery_date_time": "2014-07-24 12:12:12", + "vitamin_k": "Oral", + "hearing": "", + "newborn_screening_test": "Done", + "birth_outcome": "Liveborn" + }}, ... ] } ``` +[Top of page ↑](#introduction) + ---------- ## GET /babies:ID ####Notes -* Get a specific Baby Data +* Get all data for a specified baby ####Input +* The internal ID of the baby record + ####Output +* Spits back out the data fields for that baby record. See full list of [data field for a baby record](https://github.com/TheProductWorks/smart_client/blob/master/doc/api.md#navigate-the-doc) ####Example ```bash -$ curl -X GET 54.72.7.91:8888/babies/1 -d '{}' \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" +$ curl -X GET 54.72.7.91:8888/babies/333 -d '{}' \ + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "baby": { - "id": 1, - "pregnancy_id": 1, - "hospital_number": "H9999999", + "id": 333, + "pregnancy_id": 100, + "hospital_number": "H39999999", "gender": "male", "weight": 3720, "delivery_date_time": "2014-07-24 12:12:12", - "vitamin_k": "yes", - "hearing": "test passed", - "newborn_screening_test": "passed", + "vitamin_k": "Oral", + "hearing": "", + "newborn_screening_test": "Done", "birth_outcome": "Liveborn" } } ``` +[Top of page ↑](#introduction) + --------- ## POST /babies @@ -1357,62 +1393,76 @@ $ curl -X GET 54.72.7.91:8888/babies/1 -d '{}' \ * Create a new Baby record ####Input +* Any of the support fields for a baby. See full list of [data field for a baby record](https://github.com/TheProductWorks/smart_client/blob/master/doc/api.md#navigate-the-doc) + ####Output +* Spits back out the data fields for that baby record. See full list of [data field for a baby record](https://github.com/TheProductWorks/smart_client/blob/master/doc/api.md#navigate-the-doc) ####Example ```bash $ curl -X POST 54.72.7.91:8888/babies \ - -d '{"baby": {"pregnancy_id":1, "hospital_number": "H9999999", "gender": "male", "weight": 3720, "delivery_date_time": "2014-07-24 12:12:12", "vitamin_k": "yes", "hearing": "test passed","newborn_screening_test": "passed", "birth_outcome": "Liveborn"}}' + -d '{"baby": {"pregnancy_id":100, "hospital_number": "H9999999", "gender": "male", \ + "weight": 3720, "delivery_date_time": "2014-07-24 12:12:12", "vitamin_k": "yes", \ + "hearing": "test passed","newborn_screening_test": "passed", "birth_outcome": "Liveborn"}}' -H "Content-Type: application/json" \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "baby": { - "id": 1, - "pregnancy_id": 1, - "hospital_number": "H9999999", + "id": 333, + "pregnancy_id": 100, + "hospital_number": "H39999999", "gender": "male", "weight": 3720, "delivery_date_time": "2014-07-24 12:12:12", - "vitamin_k": "yes", - "hearing": "test passed", - "newborn_screening_test": "passed", + "vitamin_k": "Oral", + "hearing": "", + "newborn_screening_test": "Done", "birth_outcome": "Liveborn" } } ``` +[Top of page ↑](#introduction) + ----------- + ## PUT /babies/:ID #####Notes -Update a Baby record - +* Ability to update a Baby record with edits made on the UI +* ID is the unique number for that baby record ####Input +* Any of the support fields for a baby. See full list of [data field for a baby record](https://github.com/TheProductWorks/smart_client/blob/master/doc/api.md#navigate-the-doc) + ####Output +* Spits back out the data fields for that baby record. See full list of [data field for a baby record](https://github.com/TheProductWorks/smart_client/blob/master/doc/api.md#navigate-the-doc) ####Example ```bash $ curl -X PUT 54.72.7.91:8888/babies/1 \ - -d '{"baby": {"pregnancy_id":1, "hospital_number": "H9999999", "gender": "male", "weight": 3720, "delivery_date_time": "2014-07-24 12:12:12", "vitamin_k": "yes", "hearing": "test passed","newborn_screening_test": "passed", "birth_outcome": "Liveborn"}}' + -d '{"baby": {"pregnancy_id":100, "hospital_number": "H9999999", "gender": "male", \ + "weight": 3720, "delivery_date_time": "2014-07-24 12:12:12", "vitamin_k": "yes", \ + "hearing": "test passed","newborn_screening_test": "passed", "birth_outcome": "Liveborn"}}' -H "Content-Type: application/json" \ - -H "Auth-Token: S3cr3t" \ - -H "Api-Key: 3g3tyh43gswe" + -H "Auth-Token: S3cr3tT0k3n" \ + -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" { "baby": { - "id": 1, - "pregnancy_id": 1, - "hospital_number": "H9999999", + "id": 333, + "pregnancy_id": 100, + "hospital_number": "H39999999", "gender": "male", "weight": 3720, "delivery_date_time": "2014-07-24 12:12:12", - "vitamin_k": "yes", - "hearing": "test passed", - "newborn_screening_test": "passed", + "vitamin_k": "Oral", + "hearing": "", + "newborn_screening_test": "Done", "birth_outcome": "Liveborn" } } ``` ----------- +[Top of page ↑](#introduction) From 32f92eaf4c16ee47d3f0890e0af369b28abe77e3 Mon Sep 17 00:00:00 2001 From: Wogiebear Date: Thu, 22 Jan 2015 16:18:25 +0000 Subject: [PATCH 4/5] Added ToC, service providers --- doc/api.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 79 insertions(+), 12 deletions(-) diff --git a/doc/api.md b/doc/api.md index 4aa058d..da52e70 100644 --- a/doc/api.md +++ b/doc/api.md @@ -7,16 +7,53 @@ As with anything, this is far from perfect or 100% accurate, so if you spot an i #Navigate the doc - [Authentication](#authentication) - - [/login](#post-login) - - [/logout](#post-logout) + - [/login](#post-login) + - [/logout](#post-logout) - [User Account Management](#user-account-management) - [/reset_passwords](#post-reset_passwords) - - [/reset_passwords/:TOKEN](#put-reset_passwordstoken) - + - [/reset_passwords/:TOKEN](#put-reset_passwordstoken) +- [Appointments](#appointments) + - [GET /appointments](#get-appointments) + - [POST /appointments](#post-appointments) + - [GET /appointments/:APPOINTMENT_ID](#get-appointmentsappointment_id) + - [PUT /appointments/:APPOINTMENT_ID](#put-appointmentsappointment_id) + - [DELETE /appointments/:APPOINTMENT_ID](#delete-appointmentsappointment_id) +- [Service Options](#serviceoptions-resource) + - [GET /service_options](#get-service_options) + - [GET /service_options/:ID](#get-service_optionsid) +- [Appointments for a Service Option](#appointment-serviceoptions-resource) + - [GET /appointments/:ID/service_options](#get-appointmentsidservice_options) + - [POST /appointments/:ID/service_options](#post-appointmentsidservice_options) + - [DELETE /appointments/:ID/service_options/:ID](#delete-appointmentsidservice_optionsid) +- [Clinics](#clinic-resource) + - [GET /clinics](#get-clinics) + - [GET /clinics/:ID](#get-clinicsid) + - [PUT /clinics/:ID](#put-clinicsid) + - [DELETE /clinics/:ID](#delete-clinicsid) + - [POST /clinics](#post-clinics) +- [Clinic Announcements](#clinic-announcements-resource) + - [GET /clinics/:ID/announcements/:ID](#get-clinicsidannouncementsid) + - [POST /clinics/:ID/announcements](#post-clinicsidannouncements) + - [DELETE /clinics/:ID/announcements/:ID](#delete-clinicsidannouncementsid) +- [Service Users](#service-users-resource) + - [GET /service_user](#get-service_users) + - [GET /service_users/:ID](#get-service_usersid) + - [POST /service_users](#post-service_users) + - [PUT /service_users/:ID](#put-service_usersid) +- [Service Providers](#service-providers-resource) + - [GET /service_providers](#get-service_providers) + - [GET /service_providers/:ID](#get-service_providersid) + - [POST /service_providers](#post-service_providers) + - [PUT /service-providers](#put-service_providersid) +- [Pregnancy Information](#pregnancies-resources) + - [GET /pregnancies](#get-pregnancies] + - [GET /pregnancies/:ID](#GET /pregnancies/:ID) + - [POST /pregnancies](#post-pregnancies) + - [PUT /pregnancies/:ID](#put-pregnanciesid) - [Babies](#baby-resources) - - [GET /babies](#getbabies] - - [POST /babies](#postbabies) - - [PUT /babies/:ID](#putbabiesid) + - [GET /babies](#get-babiesid) + - [POST /babies](#post-babies) + - [PUT /babies/:ID](#put-babiesid) #Authentication @@ -859,6 +896,8 @@ $ curl -X GET 54.72.7.91:8888/service_users -d '{}' \ "babies": [...], } ``` +[Top of page ↑](#introduction) + ----------- ### Query string params @@ -875,6 +914,8 @@ Exact match lookup for Service User date of birth. Hospital number lookup. +[Top of page ↑](#introduction) + ---------- ## GET /service_users/:ID @@ -921,6 +962,7 @@ $ curl -X GET 54.72.7.91:8888/service_users/1 -d '{}' \ "babies": [ ... ], } ``` +[Top of page ↑](#introduction) ----------- @@ -935,7 +977,10 @@ $ curl -X GET 54.72.7.91:8888/service_users/1 -d '{}' \ ####Example ``` $ curl -X POST 54.72.7.91:8888/service_users \ - -d '{"service_user":{"hospital_number":"H2345245", "clinical_fields":{"blood_type":"A+","estimated_delivery_date":"2015-03-03"},"personal_fields":{"home_address":"Scapemanus\nNavan\nCo Meath", "home_post_code": "D2", "home_type": "apartment", "home_county": "Dublin","directions": "Turn left at the thing","dob": "1988-04-03","email":"smyth@gmail.com","home_phone":"0852351234","mobile_phone": "0852351234","name": "John Smyth","next_of_kin_phone": "0852351234", "next_of_kin_name": "John Smith"}}}'\ + -d '{"service_user":{"hospital_number":"H2345245", "clinical_fields":{"blood_type":"A+","estimated_delivery_date":"2015-03-03"},"personal_fields":{"home_address":"Scapemanus\nNavan\nCo Meath", \ + "home_post_code": "D2", "home_type": "apartment", "home_county": "Dublin","directions": "Turn left at the thing", \ + "dob": "1988-04-03","email":"smyth@gmail.com","home_phone":"0852351234","mobile_phone": "0852351234", \ + "name": "John Smyth","next_of_kin_phone": "0852351234", "next_of_kin_name": "John Smith"}}}'\ -H "Content-Type: application/json" \ -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H "Auth-Token: S3cr3tT0k3n" \ @@ -965,6 +1010,8 @@ $ curl -X POST 54.72.7.91:8888/service_users \ } } ``` +[Top of page ↑](#introduction) + ---------- ## PUT /service_users/:ID @@ -979,7 +1026,10 @@ $ curl -X POST 54.72.7.91:8888/service_users \ ####Example ``` $ curl -X PUT 54.72.7.91:8888/service_users/1 \ - -d '{"service_user":{"hospital_number":"H2345245", "clinical_fields":{"blood_type":"A+","estimated_delivery_date":"2015-03-03"},"personal_fields":{"home_address":"Scapemanus\nNavan\nCo Meath","directions": "Turn left at the thing","dob": "1988-04-03","email":"smyth@gmail.com","home_phone":"0852351234","mobile_phone": "0852351234","name": "John Smyth","next_of_kin_phone": "0852351234", "next_of_kin_name": "John Smith"}}}'\ + -d '{"service_user":{"hospital_number":"H2345245", "clinical_fields":{"blood_type":"A+","estimated_delivery_date":"2015-03-03"}, \ + "personal_fields":{"home_address":"Scapemanus\nNavan\nCo Meath","directions": "Turn left at the thing", \ + "dob": "1988-04-03","email":"smyth@gmail.com","home_phone":"0852351234","mobile_phone": "0852351234", \ + "name": "John Smyth","next_of_kin_phone": "0852351234", "next_of_kin_name": "John Smith"}}}'\ -H "Content-Type: application/json" \ -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H "Auth-Token: S3cr3tT0k3n" \ @@ -1008,6 +1058,9 @@ $ curl -X PUT 54.72.7.91:8888/service_users/1 \ } } ``` +[Top of page ↑](#introduction) + +---------- #Service Providers Resource @@ -1018,8 +1071,8 @@ CRUD interface for Service Providers. The API is locked down for Admin users onl ####Notes * List all service_providers - ####Input + ####Output ####Example @@ -1047,6 +1100,7 @@ $ curl -X GET 54.72.7.91:8888/service_providers -d '{}' \ ] } ``` +[Top of page ↑](#introduction) ## GET /service_providers/:ID @@ -1079,6 +1133,8 @@ $ curl -X GET 54.72.7.91:8888/service_providers/1 -d '{}' \ } } ``` +[Top of page ↑](#introduction) + ----------- ## POST /service_providers @@ -1092,7 +1148,10 @@ $ curl -X GET 54.72.7.91:8888/service_providers/1 -d '{}' \ ####Example ``` $ curl -X POST 54.72.7.91:8888/service_providers \ - -d '{"service_provider": {"id": 1, "name": "Mary Murray", "username": "Mary M", "email": "caprisun@nmh.ie", "password": "*********", "active": true, "admin": true, "job_occupation": "Community Midwife", "job_level": "Resident", "primary_phone": "0865656777", "secondary_phone": "0865656777"}}'\ + -d '{"service_provider": {"id": 1, "name": "Mary Murray", "username": "Mary M", \ + "email": "caprisun@nmh.ie", "password": "*********", "active": true, "admin": true, + "job_occupation": "Community Midwife", "job_level": "Resident", "primary_phone": "0865656777", \ + "secondary_phone": "0865656777"}}'\ -H "Content-Type: application/json" \ -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H "Auth-Token: S3cr3tT0k3n" \ @@ -1113,6 +1172,8 @@ $ curl -X POST 54.72.7.91:8888/service_providers \ } } ``` +[Top of page ↑](#introduction) + ----------- ## PUT /service_providers/:ID @@ -1127,7 +1188,10 @@ $ curl -X POST 54.72.7.91:8888/service_providers \ ####Example ``` $ curl -X PUT 54.72.7.91:8888/service_providers/1 \ - -d '{"service_provider": {"id": 1, "name": "Mary Murray", "username": "Mary M", "email": "caprisun@nmh.ie", "password": "*********", "active": true, "admin": true, "job_occupation": "Community Midwife", "job_level": "Resident", "primary_phone": "0865656777", "secondary_phone": "0865656777"}}'\ + -d '{"service_provider": {"id": 1, "name": "Mary Murray", "username": "Mary M", \ + "email": "caprisun@nmh.ie", "password": "*********", "active": true, "admin": true, \ + "job_occupation": "Community Midwife", "job_level": "Resident", "primary_phone": "0865656777", \ + "secondary_phone": "0865656777"}}'\ -H "Content-Type: application/json" \ -H "Api-Key: t5sample-1234-9c22-a2a2-ap1k3ysamp1e" \ -H "Auth-Token: S3cr3tT0k3n" \ @@ -1269,6 +1333,7 @@ $ curl -X POST 54.72.7.91:8888/pregnancies \ } ``` [Top of page ↑](#introduction) + ----------- ## PUT /pregnancies/:ID @@ -1304,6 +1369,7 @@ $ curl -X PUT 54.72.7.91:8888/pregnancies \ } } ``` + [Top of page ↑](#introduction) ----------- @@ -1348,6 +1414,7 @@ $ curl -X GET 54.72.7.91:8888/babies -d '{}' \ ] } ``` + [Top of page ↑](#introduction) ---------- From 29d43836239222c5df28fc9d92f37bc91a5e4ee1 Mon Sep 17 00:00:00 2001 From: Wogiebear Date: Thu, 22 Jan 2015 16:21:41 +0000 Subject: [PATCH 5/5] Update api.md --- doc/api.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/doc/api.md b/doc/api.md index da52e70..06883b6 100644 --- a/doc/api.md +++ b/doc/api.md @@ -46,7 +46,7 @@ As with anything, this is far from perfect or 100% accurate, so if you spot an i - [POST /service_providers](#post-service_providers) - [PUT /service-providers](#put-service_providersid) - [Pregnancy Information](#pregnancies-resources) - - [GET /pregnancies](#get-pregnancies] + - [GET /pregnancies](#get-pregnancies) - [GET /pregnancies/:ID](#GET /pregnancies/:ID) - [POST /pregnancies](#post-pregnancies) - [PUT /pregnancies/:ID](#put-pregnanciesid) @@ -67,7 +67,9 @@ In order to create and destroy a session, the following calls are supported: **NOTE** If the ```Auth-Token``` becomes invalid or expired for any reason, such as a ```service_provider``` becoming inactive, then the API will return a 401 response to any authenticated request. At that point any client should destroy any stored data on the device and show the login screen. + ---------- + ##POST /login ####Notes @@ -96,6 +98,8 @@ If the ```Auth-Token``` becomes invalid or expired for any reason, such as a ``` } } ``` +[Top of page ↑](#introduction) + ---------- ##POST /logout @@ -120,10 +124,11 @@ If the ```Auth-Token``` becomes invalid or expired for any reason, such as a ``` } } ``` +[Top of page ↑](#introduction) + ---------- # Authorization -============= The SMART API will only talk to clients that it knows - strangers aren't welcome! This is achieved by using an [``Api-Key``](https://github.com/TheProductWorks/smart_app#api-key) ("api_key"). A unique api_key is manually generated for a legitimate client and stored securely in an API_key directory in the SMART server backend. Then, when that client makes a request to the API with the api_key, the SMART server will lookup the api_key in its internal directory. If it's valid, then the API will respond nicely; if it's not, then it's 401 all the way! @@ -162,6 +167,7 @@ $ curl -X POST 54.72.7.91:8888/reset_passwords \ } } ``` +[Top of page ↑](#introduction) ---------- @@ -193,6 +199,8 @@ $ curl -X PUT 54.72.7.91:8888/reset_passwords/S3cr3tT0k3nT0k3n \ } } ``` +[Top of page ↑](#introduction) + ---------- #Appointments @@ -237,6 +245,7 @@ $ curl -X GET 54.72.7.91:8888/appointments -d '{}' \ ] } ``` +[Top of page ↑](#introduction) ---------- @@ -278,6 +287,7 @@ $ curl -X POST 54.72.7.91:8888/appointments \ } } ``` +[Top of page ↑](#introduction) ---------- @@ -312,6 +322,7 @@ $ curl -X GET 54.72.7.91:8888/appointments/1 -d '{}' \ }, } ``` +[Top of page ↑](#introduction) --------- @@ -344,6 +355,7 @@ $ curl -X PUT 54.72.7.91:8888/appointments/1 \ } } ``` +[Top of page ↑](#introduction) ---------- @@ -374,6 +386,8 @@ $ curl -X DELETE 54.72.7.91:8888/appointments/1 \ } } ``` +[Top of page ↑](#introduction) + ---------- #ServiceOptions Resource @@ -405,6 +419,8 @@ $ curl -X GET 54.72.7.91:8888/service_options -d '{}' \ ] } ``` +[Top of page ↑](#introduction) + ---------- ## GET /service_options/:ID @@ -430,10 +446,11 @@ $ curl -X GET 54.72.7.91:8888/service_options/1 -d '{}' \ } } ``` +[Top of page ↑](#introduction) + --------- -Appointment ServiceOptions Resource -========================= +#Appointment ServiceOptions Resource Nested endpoint to list, apply or remove service options from Appointments. @@ -462,6 +479,8 @@ $ curl -X get 54.72.7.91:8888/appointments/1/service_options -d '{}' \ ] } ``` +[Top of page ↑](#introduction) + ---------- ## POST /appointments/:ID/service_options @@ -487,7 +506,10 @@ $ curl -X POST 54.72.7.91:8888/appointments/1/service_options \ } } ``` +[Top of page ↑](#introduction) + ---------- + ## DELETE /appointments/:ID/service_options/:ID ####Notes @@ -511,6 +533,8 @@ $ curl -X DELETE 54.72.7.91:8888/appointments/1/service_options/1 \ } } ``` +[Top of page ↑](#introduction) + ---------- #Clinic Resource @@ -559,6 +583,8 @@ $ curl -X GET 54.72.7.91:8888/clinics -d '{}' \ ] } ``` +[Top of page ↑](#introduction) + ------------ ### Query string params @@ -605,6 +631,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1 -d '{}' \ } } ``` +[Top of page ↑](#introduction) + ---------- ## PUT /clinics/:ID @@ -647,6 +675,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1 \ } } ``` +[Top of page ↑](#introduction) + ------------- ## DELETE /clinics/:ID @@ -689,6 +719,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1 \ } } ``` +[Top of page ↑](#introduction) + ---------- ## POST /clinics @@ -729,6 +761,8 @@ $ curl -X POST 54.72.7.91:8888/clinics \ } } ``` +[Top of page ↑](#introduction) + ----------- #Clinic Announcements Resource @@ -763,6 +797,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1/announcements -d '{}' \ ] } ``` +[Top of page ↑](#introduction) + ---------- ## GET /clinics/:ID/announcements/:ID @@ -790,6 +826,8 @@ $ curl -X GET 54.72.7.91:8888/clinics/1/announcements/2 -d '{}' \ } } ``` +[Top of page ↑](#introduction) + ---------- ## POST /clinics/:ID/announcements @@ -821,6 +859,8 @@ $ curl -X POST 54.72.7.91:8888/clinics/1/announcements \ ] } ``` +[Top of page ↑](#introduction) + ----------- ## DELETE /clinics/:ID/announcements/:ID @@ -848,6 +888,8 @@ $ curl -X DELETE 54.72.7.91:8888/clinics/1/announcements/2 \ } } ``` +[Top of page ↑](#introduction) + --------- #Service Users Resource