Skip to content

Instantly share code, notes, and snippets.

@maisaengineering
Last active August 29, 2015 13:55
Show Gist options
  • Save maisaengineering/8708870 to your computer and use it in GitHub Desktop.
Save maisaengineering/8708870 to your computer and use it in GitHub Desktop.
1. Authentication :
oauth2 and devise are used for authentication.
1.1. Application Authentication:
command: client_credentials
method: POST
URL: https://kl-json.herokuapp.com/api/clients/token
1.1.1. Request Format:
{
"grant_type":"client_credentials",
"client_id":"< app id shared by kidslink >",
"client_secret":"< secret key shared by kidslink >",
"scope":"ikidslink"
}
1.1.2. Response Format:
{
"access_token":"<token>",
"token_type":"bearer",
"expires_in":7200,
"scope":"ikidslink"
}
1.2. Refresh Token:
command: refresh_token
method: POST
URL: https://kl-json.herokuapp.com/api/clients/token
1.2.1. Request Format:
{
"client_id":"< app id shared by kidslink >",
"client_secret":"< secret key shared by kidslink >",
"grant_type":"refresh_token",
"refresh_token":"<refresh token got from token generation response>"
}
1.2.2. Response Format:
{
"access_token":"<token>",
"token_type":"bearer",
"expires_in":7200,
"refresh_token":"<to get new token>",
"scope":"public"
}
1.3. User Authentication:
command: authentication
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.3.1. Request Format:
{
"access_token":"<Application authentication token>",
"command":"authentication",
"body":{
"user_email":"user email id",
"password":""
}
}
1.3.2. Response Format:
{
"command":"authentication",
"status":200,
"message":"OK",
"body":{
"auth_token":"<user authentication token>",
"onboarding":"<boolean value true or false and true indicates first login>",
"profile":{
"kl_id":"<unique identifier>",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"phone_numbers":[
{
"number":"<phone number>",
"type":"<home/mobile/work>"
}
]
}
}
}
1.4. Revoke Authentication:
command: revoke_authentication
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.4.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"revoke_authentication",
"body":{
}
}
1.4.2. Response Format :
{
"command":"revoke_authentication",
"status":200,
"message":"OK",
"body":""
}
1.5. Email Validation:
description: to check uniqueness of email
command: validate_email
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.5.1. Request Format:
{
"access_token":"<Application authentication token>",
"command":"validate_email",
"body":{
"email":"<user email id>"
}
}
1.5.2. Response Format:
{
"command":"validate_email",
"status":200,
"message":"OK",
"body":""
}
1.6. Password Validation:
description: to authenticate password for a current user.
command: validate_password
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.6.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"validate_password",
"body":{
"password":"<current_user password>"
}
}
1.6.2. Response Format:
{
"command":"validate_password",
"status":200,
"message":"OK",
"body":{
}
}
1.7. Change Password:
description: to change current user password.
command: change_password
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.7.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"change_password",
"body":{
"current_password":"<current_user password>",
"password":"<new password>",
"password_confirmation":"<repeat new password>"
}
}
1.7.2. Response Format:
{
"command":"change_password",
"status":200,
"message":"OK",
"body":{
}
}
1.8. Forgot Password:
description: its send link to email id, to set new password.
command: forgot_passord
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.8.1. Request Format:
{
"access_token":"<Application authentication token>",
"command":"forgot_password",
"body":{
"email":""
}
}
1.8.2. Response Format:
{
"command":"forgot_password",
"status":200,
"message":"OK",
"body":null
}
2. User Api’s
2.1. Registration:
description: Registration to kidlink through onboarding partner.
command: registration
method: POST
URL: https://kl-json.herokuapp.com/api/users
2.1.1. Request Format:
{
"access_token":"<Application authentication token>",
"command":"registration",
"body":{
"parents":[
{
"relationship":"",
"fname":"",
"lname":"",
"email":"",
"password":"",
"password_confirmation":""
}
],
"kids":[
{
"nickname":"",
"fname":"",
"mname":"",
"lname":"",
"prefix":"",
"birthdate":"",
"gender":"Male/Female",
"photo_id":"<document id>"
}
],
"hospital_id":"",
"zipcode":"",
"is_accepted":"",
"referral_code":"",
"partner":""
}
}
2.1.2. Response Format:
{
"command":"registration",
"status":200,
"message":"OK",
"body":{
"auth_token":"",
"profile":{
"kl_id":"",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"phone_numbers":[
],
"kids":[
{
"relation":"",
"kid_kl_id":""
}
]
}
}
}
2.2. Update Registration:
description: Update exiting profile and adding new parents .
command: update_registration
method: POST
URL: https://kl-json.herokuapp.com/api/users
2.2.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"update_registration",
"body":{
"kid":{
"kl_id":"",
"gender":"Male"
},
"parents":[
{
"kl_id":"",
"relationship":"",
"fname":"",
"lname":"",
"email":""
}
]
}
}
2.2.2. Response Format:
{
"command":"update_registration",
"status":200,
"message":"OK",
"body":""
}
2.3. Confirm Invitation:
description: allowing user to register based on referral url( i.e url passed as a part of invitation).
command: confirm_invitation
method: POST
URL: https://kl-json.herokuapp.com/api/users
2.3.1. Request Format:
{
"command":"confirm_invitation",
"body":{
"referral_code":"<code that passed as a part of url>",
"fname":"",
"lname":"",
"email":"",
"password":"",
"password_confirmation":""
}
}
2.3.2. Response Format:
2.3.2.1. Success Response:
{
"command":"confirm_invitation",
"status":200,
"message":"OK",
"body":""
}
2.3.2.2. Error Response:
note: check message attributes to error message, it would be ‘,’ seperated strings
{
"command":"confirm_invitation",
"status":406,
"message":"Email ERROR: Email already exists.",
"body":""
}
2.3. Complete Registration:
description: user registered with incomplete details, basically a user registered through refferal url need to complete his registration using this url.
command: complete_registration
method: POST
URL: https://kl-json.herokuapp.com/api/users
2.3.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"complete_registration",
"body":{
"zipcode":"<zicode>",
"hospital_id":"<selected onboarding partner secure kl_id>"
}
}
2.3.2. Response Format:
{
"command":"complete_registration",
"status":200,
"message":"OK",
"body":""
}
2.4. Update Preferences:
description: to change current user password, opt_outing onboarding partner for milestone and opt_outing non essential notification emails.
command: update_preferences
method: POST
URL: https://kl-json.herokuapp.com/api/users
2.4.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"update_preferences",
"body":{
"current_password":"<current_user password>",
"password":"<new password>",
"password_confirmation":"<repeat new password>"
"onboard_partner_opt_out":"<should be a Boolean value true (or) false>",
"non_essential_emails_opt_out":"<should be a Boolean value true (or) false>"
}
}
2.4.2. Response Format:
{
"command":"update_preferences",
"status":200,
"message":"OK",
"body":{
}
}
3. Profile Api's:
3.1. Family Information:
description: gets all profile information of current users managed kids and parent related to those kids.
command: family_info
method: POST
URL: https://kl-json.herokuapp.com/api/profiles
3.1.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"family_info",
"body":{
}
}
3.1.2. Response Format:
{
"command":"family_info",
"status":200,
"message":"OK",
"body":{
"parents":[
{
"kl_id":"<uid>",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"phone_numbers":[
{
"number":"",
"type":""
},
{
"number":"",
"type":""
},
{
"number":"",
"type":""
}
]
}
],
"kids":[
{
"nickname":"",
"kl_id":"<UId>",
"photograph":"<url for child photo graph>",
"recent_milestone":{
"name":"<milestone name>",
"last_updated":"2014-01-23T02:21:44.583-05:00"
},
"recent_document":{
"name":"<doc name>",
"last_updated":"2014-01-23T02:21:44.583-05:00"
}
}
],
"onboarding_partner":{
"name":"<hospital name>",
"kl_id":"<UId>",
"logo":"<hospital logo url>"
}
}
}
3.2. Kid Information:
description: gets profile information of current users managed kid with given id.
command: kid_info
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/:kl_id
3.2.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"kid_info",
"body":{
}
}
3.2.2. Response Format:
{
"command":"kid_info",
"status":200,
"message":"OK",
"body":{
"profile":{
"zipcode":"",
"kl_id":"<uid>",
"photograph":"<kid photo url>",
"fname":"",
"mname":"",
"lname":"",
"nickname":"",
"birthdate":"",
"gender":"",
"address1":"",
"address2":"",
"city":"",
"state":"",
"other_basic_details":"",
"medicines":"",
"food_allergies":"",
"medical_issues":"",
"special_needs":"",
"other_concerns":"",
"doctor":{
"name":"",
"phone_no":"",
"email":""
},
"dentist":{
"name":"",
"phone_no":"",
"email":""
},
"parents":[
{
"kl_id":"<uid>",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"phone_numbers":[
{
"number":"",
"type":""
}
]
}
]
}
}
}
3.3. Parent Information:
description: gets profile information of current users if given id match's.
command: parent_info
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/:kl_id
3.3.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"parent_info",
"body":{
}
}
3.3.2. Response Format:
{
"command":"parent_info",
"status":200,
"message":"OK",
"body":{
"profile":{
"kl_id":"<uid>",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"phone_numbers":[
{
"number":"",
"type":""
}
],
"kids":[
{
"relation":"<parent kid relation>",
"kid_kl_id":"<uid>"
}
]
}
}
}
3.4. Add New Parent:
description: Add another parent to any individual kid.
command: add_new_parent
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/:kl_id
3.4.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"add_new_parent",
"body":{
"relationship":"",
"fname":"",
"lname":"",
"email":"",
"manageable":"<true (or) false>"
}
}
3.4.2. Resoponse Format:
{
"command":"add_new_parent",
"status":200,
"message":"OK",
"body":""
}
3.5. Add New Kid:
description: add one more kid.
command: add_new_kid
method: POST
URL: https://kl-json.herokuapp.com/api/profiles
3.5.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"add_new_kid",
"body":{
"nickname":"",
"fname":"",
"lname":"",
"birthdate":"mm/dd/yyyy",
"gender":"< male(or) female >",
"photo_id":"<document_id>",
"managed_by":[
{
"profile_id":"<parent profile kl_id>",
"relationship":"< how parent is related to child>"
}
]
}
}
3.5.2. Response Format :
{
"command":"add_new_kid",
"status":200,
"message":"OK",
"body":{
"profile":{
"zipcode":"",
"kl_id":"",
"photograph":"",
"fname":"",
"mname":"",
"lname":"",
"nickname":"",
"birthdate":"2014-01-01T00:00:00Z",
"gender":"",
"address1":"",
"address2":"",
"city":"",
"state":"",
"other_basic_details":"",
"medicines":"",
"food_allergies":"",
"medical_issues":"",
"special_needs":"",
"other_concerns":"",
"doctor":{
"name":"",
"phone_no":"",
"email":""
},
"dentist":{
"name":"",
"phone_no":"",
"email":""
},
"parents":[
{
"kl_id":"<uid>",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"phone_numbers":[
{
"number":"",
"type":""
},
{
"number":"",
"type":""
},
{
"number":"",
"type":""
}
]
}
]
}
}
}
4. Notification Apis:
4.1. Family Alerts/Notifications:
description: gets all alerts of current users managed kids.
command: family_alerts
method: POST
URL: https://kl-json.herokuapp.com/api/notifications
4.1.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"family_alerts",
"body":{
}
}
4.1.2. Response Format:
{
"command":"family_alerts",
"status":200,
"message":"OK",
"body":{
"parent":{
"normal_notifications":[
],
"ad_hoc_notifications":[
{
"notification_type":"Event/Alert",
"kl_id":"<uid>",
"title":"<",
"issued_on":"2013-11-06T04:02:53.909-05:00",
"content":"",
"expected_responses":[
"Thanks",
"Ignore",
"I've done it"
]
}
],
"scheduled_notifications":[
]
},
"kids":"<array of managed kids notification, similar format as parent>"
}
}
4.2. kid Alerts/Notifications:
description: gets all alerts of current users managed kid with given profile id.
command: kid_alerts
method: POST
URL: https://kl-json.herokuapp.com/api/notifications
4.2.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"kid_alerts",
"body":{
"profile_id":"<kl_id of kid>"
}
}
4.2.2. Response Format:
{
"command":"kid_alerts",
"status":200,
"message":"OK",
"body":{
"normal_notifications":[
],
"ad_hoc_notifications":[
{
"notification_type":"<Event/Alert>",
"kl_id":"<uid>",
"title":"",
"issued_on":"2013-09-19T01:05:02.174-04:00",
"content":"testing",
"expected_responses":[
"I've done it",
"Thanks",
"Ignore"
]
}
],
"scheduled_notifications":[
]
}
}
4.3. Parent Alerts/Notifications:
description: gets all alerts of current users if given id match's.
command: parent_alerts
method: POST
URL: https://kl-json.herokuapp.com/api/notifications
4.3.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"parent_alerts",
"body":{
"profile_id":"<current_user profile id>"
}
}
4.3.2. Response Format:
{
"command":"parent_alerts",
"status":200,
"message":"OK",
"body":{
"normal_notifications":[
],
"ad_hoc_notifications":[
{
"notification_type":"<Event/Alert>",
"kl_id":"<uid>",
"title":"",
"issued_on":"2013-09-19T01:05:02.174-04:00",
"content":"testing",
"expected_responses":[
"I've done it",
"Thanks",
"Ignore"
]
}
],
"scheduled_notifications":[
]
}
}
4.4. Response to Alerts/Notifications:
description: to update users response to the alert.
command: update_status
method: POST
URL: https://kl-json.herokuapp.com/api/notifications/:kl_id
4.4.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"update_status",
"body":{
"status":"I've done it"
}
}
4.4.2. Response Format :
{
"command":"update_status",
"status":200,
"message":"OK",
"body":""
}
4.5.All Alerts/Notifications:
description: gets all alerts of current users managed kids.
command: all_alerts
method: POST
URL: https://kl-json.herokuapp.com/api/notifications
4.5.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"all_alerts",
"body":{
"profile_id":"<it should be current_user profile or one from the kids profiles of the current user. if left blank, it is assumed as complete family notifications.>"
}
}
4.5.2. Response Format:
{
"command":"all_alerts",
"status":200,
"message":"OK",
"body":{
"notifications":[
{
"type":"<AdHocNotification (or) Scheduled (or) Normal>",
"notification_type":"<Alert (or) Event> ",
"kl_id":"<Notification Id>",
"title":"",
"content":"",
"expected_responses":"<array of responses expected from end user>",
"issued_on":"<date in mm/dd/yyyy format>",
"profile_name":"<name of the parent or kid this notification belong to.>",
"profile_id":"<kl_id of the parent or kid this notification belong to.>"
}
]
}
}
5. Category Api’s:
5.1. List of Categories:
description: gets all categories of document already in kidslink database.
command: list
method: POST
URL: https://kl-json.herokuapp.com/api/categories
5.1.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"list",
"body":{
}
}
5.1.2 Response Format:
{
"command":"",
"status":200,
"message":"OK",
"body":{
"categories":[
{
"kl_id":"<root category kl id>",
"name":"<root category name>",
"children":[
{
"kl_id":"<child category kl id>",
"name":"<child category name>"
}
]
}
]
}
}
5.2. List of Categories with Document count:
description: gets all categories of document already in kidslink database.
command: list_with_document_count
method: POST
URL: https://kl-json.herokuapp.com/api/categories
5.2.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"list_with_document_count",
"body":{
"profile_id":"<user relavant profiles id>"
}
}
5.2.2. Response Format:
it contains array of categories and count of the documents uploaded to it and it child categories. each category nested, it child categories as children.
{
"command":"",
"status":200,
"message":"OK",
"body":{
"categories":[
{
"kl_id":"<root category kl id>",
"name":"<root category name>",
"document_count":"<no of uploaded to this category>",
"children":[
{
"kl_id":"<child category kl id>",
"name":"<child category name>",
"document_count":"<no of uploaded to this category>"
}
],
"custom_tags_list": "<an array containing custom tag names.>"
}
]
}
}
5.3. List of Categories with Document count and Document Meta Data:
description: gets all categories of document already in kidslink database.
command: uploaded_documents
method: POST
URL: https://kl-json.herokuapp.com/api/categories
5.3.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"uploaded_documents",
"body":{
"category_id":"<category kl_id. if it left empty all the categories starting from root will be selected.>",
"profile_id":"<profiles kl_id. if it left empty , family documents will be displayed.>",
"depth":"<choose from 1 to any>"
}
}
Note: 1) response will contains array of categories,
2) count of the documents uploaded to it and it child categories.
3) if category is leaf node, then documents at that node will be displayed instead of child categories
4) each category nested, it child categories as children.
5) depth: 1. if depth is 1 then only 1st level of above criteria will be displayed. as depth will be increased the level would also increase.
2. if depth greater than levels is specified then all the levels will be displayed.
3. if depth is 0, then nothing will be displayed
4. if depth is not specified all levels will be displayed
5.3.2. Response Format:
{
"command":"",
"status":200,
"message":"OK",
"body":{
"categories":[
{
"kl_id":"<root category kl id>",
"name":"<root category name>",
"document_count":"<no of uploaded to this category>",
"children":[
{
"kl_id":"<child category kl id>",
"name":"<child category name>",
"document_count":"<no of uploaded to this category>"
"documents": [
{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>"
}
]
}
],
"custom_tags":[
{
"kl_id":"<custom tag kl id>",
"name":"<custom tag name>",
"document_count":"<no of uploaded to this category>"
"documents": [
{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>"
}
]
}
]
}
]
}
}
6. Documents Api’s:
6.1. Upload Document:
description: to upload a document
command: upload_document
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault
6.1.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"upload_multimedia",
"body":{
"name":"doc1.jpeg",
"profile_id":"<profile kl_id>",
"content_type":"image/jpeg",
"content":""
}
}
6.2. Upload Multimedia:
description: to upload a any document with out any details specified, quick uploads.
command: upload_multimedia
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault
6.2.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"upload_multimedia",
"body":{
"profile_id":"<profile kl_id of kid or parent, and its optional>",
"name":"doc1.jpeg",
"content_type":"image/jpeg",
"content":""
}
}
6.2.2. Response Format:
{
"command":"upload_multimedia",
"status":200,
"message":"OK",
"body":{
"document":{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":""
}
}
}
6.3. Add Meta Data To Document:
description: add extra information to the uploaded document.
command: add_meta_data_to_document
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault
6.3.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"add_meta_data_to_document",
"body":{
"profile_id":"",
"category_id":"",
"description":"",
"doc_ids":"<array of document ids involved or single document but as array>",
"org_provider":"",
"taken_on":"",
"expiration_date":"",
"tags":"<user defined tags name with ',' separator>"
}
}
6.3.2. Response Format:
{
"command":"add_meta_data_to_document",
"status":200,
"message":"OK",
"body":{
"document":{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<list of tags for document, based on category>"
}
}
}
6.4. Family Documents:
description: gets all documents of current users managed kids.
command: family_documents
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault
6.4.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"family_documents",
"body":{
}
}
6.4.2. Response Format:
{
"command":"family_documents",
"status":200,
"message":"OK",
"body":{
"parents":[
{
"Full Name":"<parent full name>",
"doc_list":[
{
"category":"<name of the category>",
"count":"<documents count for this category>",
"documents":[
{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>"
}
]
}
]
}
],
"kids":[
{
"Full Name":"<kids full name>",
"doc_list":[
{
"category":"<name of the category>",
"count":"<documents count for this category>",
"documents":[
{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>"
}
]
}
]
}
]
}
}
6.5. Kid Documents:
description: gets all documents of current users managed kid with given profile id.
command: kid_alerts
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault
6.5.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"kid_documents",
"body":{
"profile_id":"<kid kl_id>"
}
}
6.5.2. Response Format:
{
"command":"kid_documents",
"status":200,
"message":"OK",
"body":{
"doc_groups":[
{
"category":"<name of the category>",
"count":"<documents count for this category>",
"documents":[
{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>"
}
]
}
]
}
}
6.6 .Parent Documents:
description: gets all documents of current users if given id match's.
command: parent_alerts
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault
6.6.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"parent_documents",
"body":{
"profile_id":"<current_user's profile kl_id>"
}
}
6.6.2. Response Format:
{
"command":"parent_documents",
"status":200,
"message":"OK",
"body":{
"doc_groups":[
{
"category":"<name of the category>",
"count":"<documents count for this category>",
"documents":[
{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>"
}
]
}
]
}
}
6.7. Document Information:
description: gets the details information document along with source of document.
command: get_document
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault/:kl_id
6.7.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"get_document",
"body":{
}
}
6.7.2.Response Format:
{
"command":"get_document",
"status":200,
"message":"OK",
"body":{
"kl_id":"<doc uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>",
"description":"",
"view":"<color document source url>",
"quick_view":"<back and white document source url>"
}
}
6.8. Documents at Leaf Node:
description: gets all documents information at leaf node of each category, for that profile.
command: documents
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault
6.8.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"leaf_node_documents",
"body":{
"profile_id":"<profile kl_id>",
"category_id":"<category kl_id>"
}
}
6.8.2.Response Format:
{
"command":"leaf_node_documents",
"status":200,
"message":"OK",
"body":{
"documents":[
{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>"
}
]
}
}
6.9. Change Photograph:
description: to change the photograph
command: change_photograph
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault/
6.9.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"change_photograph",
"body":{
"profile_id":"",
"name":"doc1.jpg",
"content_type":"image/jpeg",
"content":""
}
}
6.9.2.Response Format:
{
"command":"change_photograph",
"status":200,
"message":"OK",
"body":{
"kl_id":"<document kl_id>",
"photograph":"<image url>"
}
}
6.10. Document Source:
description: to get documents source urls of the documents.
command: document_source
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault/:kl_id
6.10.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"document_source",
"body":{
}
}
6.10.2.Response Format:
{
"command":"document_source",
"status":200,
"message":"OK",
"body":{
"source_url":"<an array of document source url's if document is combiation of multiple documents.>"
}
}
7. Onboarding Api’s:
7.1. Hospitals List:
description: get all local partner match to the given zipcode, if more than one matches found, gets all local match's and all national partner's irrespective of zipcode.
command: hospitals_list
method: POST
URL: https://kl-json.herokuapp.com/api/onboard_partners
7.1.1.Request Format:
{
"access_token":"<Application authentication token>",
"command":"hospitals_list",
"body":{
"zipcode":""
}
}
7.1.2. Response format:
{
"command":"hospitals_list",
"status":200,
"message":"OK",
"body":{
"hospitals":[
{
"name":"<hospital name>",
"kl_id":"<hospital uid>",
"logo":"<logo image url>"
}
]
}
}
7.2. Alternative Hospitals:
description: get all local partner match's to the given zipcode and all national partner's irrespective of zipcode.
command: alternative_hospitals
method: POST
URL: https://kl-json.herokuapp.com/api/onboard_partners
7.2.1. Request Format:
{
"access_token":"<Application authentication token>",
"command":"alternative_hospitals",
"body":{
"zipcode":""
}
}
7.2.2. Response Format:
{
"command":"alternative_hospitals",
"status":200,
"message":"OK",
"body":{
"hospitals":[
{
"name":"<hospital name>",
"kl_id":"<hospital uid>",
"logo":"<logo image url>"
}
]
}
}
7.3. Invite Mom:
description: to spread kidlink to all moms. sends an invitation to other mom through email
command: alternative_hospitals
method: POST
URL: https://kl-json.herokuapp.com/api/onboard_partners
7.3.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"invite_mom",
"body":{
"email":""
}
}
7.3.2. Response Format:
{
"command":"invite_mom",
"status":200,
"message":"OK",
"body":""
}
7.4. Hospitals Information:
description: get all local partner match to the given zipcode, if more than one matches found, gets all local match's and all national partner's irrespective of zipcode.
command: get_info
method: POST
URL: https://kl-json.herokuapp.com/api/onboard_partners/:kl_id
7.4.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"get_info",
"body":{
}
}
7.4.2. Response Format:
{
"command":"get_info",
"status":200,
"message":"OK",
"body":{
"kl_id":"<hospital uid>",
"name":"<hospital name>",
"mobileinfo":"<html data>",
"logo":"<image url>",
"logo2":"<image url>"
}
}
8. Organizations Api’s:
8.1. Kid Organizations List:
description: get all organizations of an individual kids based on the passed as a part of url
command: kid_organizations
method: POST
URL: https://kl-json.herokuapp.com/api/organizations/:kl_id
8.1.1.Request Format:
{
"access_token":"<Application authentication token>",
"command":"kid_organizations",
"body":{
"zipcode":""
}
}
8.1.2. Response format:
{
"command":"kid_organizations",
"status":200,
"message":"OK",
"body":{
"organization_memberships":[
{
"organization_name":"<name of Organization>",
"seasons":[
{
"status":"<status of the application>",
"season_year":"<season year/ season name kid applied for>"
}
]
}
]
}
}
6.13. Change Document OwnerShip :
description: it helps change Document access between parents.
command: change_document_ownership
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault/:kl_id
Note: kl_id in above url is kl_id of the Document to which ownership to be changed
6.13.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"change_document_ownership",
"body":{
"profile_id": "<profile kl_id of any parent who shared documents with current user or any kid kl_id>"
}
}
6.13.2.Response Format:
{
"command":"change_document_ownership",
"status":200,
"message":"Document Ownership successfully changed",
"body":{
"document":{
"kl_id":"<document uid>",
"taken_on":"date as MM/DD/YYYY",
"expiration_date":"",
"tags":"<ansestors name list of the category and itself>",
"description":"",
"profile_name":"<Document owner name>"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment