Skip to content

Instantly share code, notes, and snippets.

@maisaengineering
Last active August 29, 2015 14:05
Show Gist options
  • Save maisaengineering/bd3be2e08792c71e0c0e to your computer and use it in GitHub Desktop.
Save maisaengineering/bd3be2e08792c71e0c0e to your computer and use it in GitHub Desktop.
====================API's Description ===============
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":"",
"remember_me": "<boolean value true (or) false>"
}
}
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>"
}
]
},
"onboarding_partner":{
"name":"<hospital name>",
"kl_id":"<UId>",
"url":"<offical site url>",
"logo":"<hospital logo url>",
"is_local_partner":"<boolean value true or false and true indicates first login>"
}
}
}
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
}
1.9. All Preload Images:
description: it sends list image urls along with priority from server, to preload at client sides .
command: all_preload_images
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.9.1. Request Format:
{
"command":"all_preload_images"
}
1.9.2. Response Format:
{
"command":"all_preload_images",
"status":200,
"message":"Ok",
"body":{
"images":"<array of image url's>"
}
}
1.10. Prompt Images:
description: it sends list image urls along with priority from server, to preload at client sides .
command: prompt_images
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.10.1. Request Format:
{
"command":"prompt_images"
}
1.10.2. Response Format:
{
"command":"prompt_images",
"status":200,
"message":"Ok",
"body":{
"images":"<array of image url's>"
}
}
1.11. Tour Images:
description: it sends list image urls along with priority from server, to preload at client sides .
command: tour_images
method: POST
URL: https://kl-json.herokuapp.com/api/users
1.11.1. Request Format:
{
"command":"tour_images",
"body":{
"tour_name" : "<Name of the specific tour (or) if not specified, server take as default tour>"
}
}
1.11.2. Response Format:
{
"command":"tour_images",
"status":200,
"message":"Ok",
"body":{
"images":"<array of image url's>"
}
}
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 referral 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":"",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"photograph":"",
"phone_numbers":[
{
"number":"",
"type":""
},
{
"number":"",
"type":""
},
{
"number":"",
"type":""
}
],
"profiles_manageds":[
{
"relationship":"<how parent is related to specified>",
"manageable":"<it should be Boolean value, true or false>",
"kid_kl_id":"<kid_kl_id>",
"kid_name":"<kid_nickname>"
}
],
"sharing_documents_with_me":"<Boolean value true (or) false>",
"i_am_sharing_documents_to":"<Boolean value true (or) false>",
"is_kidslink_user)":"<Boolean value true (or) false>"
}
],
"kids":[
{
"kl_id":"",
"zipcode":"",
"fname":"",
"mname":"",
"lname":"",
"nickname":"",
"gender":"",
"other_basic_details":"",
"medicines":"",
"food_allergies":"",
"medical_issues":"",
"special_needs":"",
"other_concerns":"",
"photograph":"",
"birthdate":"",
"age":"",
"doctor":"",
"dentist":"",
"document_sharing":true
}
],
"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":{
"kl_id":"",
"zipcode":"",
"fname":"",
"mname":"",
"lname":"",
"nickname":"",
"gender":"",
"other_basic_details":"",
"medicines":"",
"food_allergies":"",
"medical_issues":"",
"special_needs":"",
"other_concerns":"",
"photograph":"",
"birthdate":"",
"age":"",
"doctor":{
"name":"",
"phone_no":"",
"email":""
},
"dentist":{
"name":"",
"phone_no":"",
"email":""
},
"parents":[
{
"kl_id":"",
"manageable":"<true or flase>",
"relation_ship":"",
"email":"",
"fname":"",
"mname":"",
"lname":""
}
]
}
}
}
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":"",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"photograph":"",
"phone_numbers":[
{
"number":"",
"type":""
}
],
"profiles_manageds":[
{
"relationship":"<how parent is related to specified>",
"manageable":"<it should be Boolean value, true or false>",
"kid_kl_id":"<kid_kl_id>",
"kid_name":"<kid_nickname>"
}
]
}
}
}
3.4. Add New Parent:
description: Add another parent to any individual kid.
command: add_new_parent
method: POST"manageable":true,
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":"",
"photograph":"",
"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":""
}
]
}
]
}
}
}
3.6. Change Access:
description: change Access of individual family members on current user mangaeable kids.
command: change_access
method: POST
URL: https://kl-json.herokuapp.com/api/profiles
3.6.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"change_access",
"body":{
"profile_id":"<parents profile_id from family info>",
"kids":[
{
"kid_profile_id":"<profile_id any kid in family>",
"relationship":"<relation between specified parent and kid>",
"manageable":"<it should be Boolean value, true or false>"
}
],
"share_documents":"<it should be Boolean value, true or false>"
}
}
Notes:
manageable:
1) if parent profile id is different from current parent logged_in,doesn't matter what the value of manageable it treats as 'true'.
2) if parent profile id belongs to current parent logged_in, true means he is willing to manage kid and any thing else will be treated as not willing to manage.
share_documents:
1) if the value is true, current logged in parent is interested in mutual sharing documents to view and false is vice-versa.
3.6.2. Success Response Format :
{
"command":"change_access",
"status":200,
"message":"OK",
"body":{
}
}
3.6.3. Error Response Format :
{
"command":"change_access",
"status":400,
"message":"<list of error messages with a ', ' separator.>",
"body":{
}
}
3.7. Change Address:
description: it helps to create or change address of current user logged in
command: change_address
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/:kl_id
3.7.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"change_access",
"body":{
"address1":"",
"address2":"",
"city":"",
"state":"",
"zipcode":""
}
}
3.7.2. Success Response Format :
{
"command":"change_address",
"status":200,
"message":"OK",
"body":{
}
}
3.7.3. Error Response Format :
{
"command":"change_address",
"status":400,
"message":"<list of error messages with a ', ' separator.>",
"body":{
}
}
3.8.Update Parent Profile:
description: it helps to update current user parent profile
command: update_parent_profile
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/:kl_id
note: the kl_id in url should be parent kl_id
3.8.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"update_parent_profile",
"body":{
"fname":"",
"lname":"",
"mnane":"",
"photo_id":"<document_id>",
"phone_numbers":[
{
"contact":"<phone number>",
"type":"<Mobile (or) Work, (or) Home etc.,>"
}
],
"address":{
"address1":"",
"address2":"",
"city":"",
"state":"",
"zipcode":""
}
}
}
3.8.2. Success Response Format :
{
"command":"update_parent_profile",
"status":200,
"message":"Successfully Updated",
"body":{
"profile":{
"kl_id":"<parent profile kl_id>",
"fname":"",
"mname":"",
"lname":"",
"email":"",
"photograph":"",
"phone_numbers":[
{
"number":"<phone number>",
"type":"<Mobile (or) Work, (or) Home etc.,>"
}
],
"profiles_manageds":[
{
"relationship":"<how parent is related to specified>",
"manageable":"<it should be Boolean value, true or false>",
"kid_kl_id":"<kid_kl_id>",
"kid_name":"<kid_nickname>"
}
]
}
}
}
3.8.3. Error Response Format :
{
"command":"update_parent_profile",
"status":400,
"message":"<list of error messages with a ', ' separator.>",
"body":{
}
}
3.9.Update Kid Profile:
description: it helps to update current user parent profile
command: update_kid_profile
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/:kl_id
note: the kl_id in url should be from managed kids
3.9.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"update_kid_profile",
"body":{
"fname":"",
"mname":"",
"lname":"",
"nickname":"",
"birthdate":"<date should be mm/dd/yyyy format>",
"gender":"<male (or) female>",
"photo_id":"",
"other_basic_details":"",
"medicines":"",
"food_allergies":"",
"medical_issues":"",
"special_needs":"",
"other_concerns":"",
"doctor_name":"",
"doctor_phone":"",
"doctor_email":"",
"dentist_name":"",
"dentist_phone":"",
"dentist_email":"",
"address":{
"address1":"",
"address2":"",
"city":"",
"state":"",
"zipcode":""
}
}
}
3.9.2. Success 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":""
}
]
}
]
}
}
}
3.9.3. Error Response Format :
{
"command":"update_kid_profile",
"status":400,
"message":"<list of error messages with a ', ' separator.>",
"body":{
}
}
3.10. Friends List:
description: it helps to get list of friends, whom sharing the post.
command: friends_list
method: POST
URL: https://kl-json.herokuapp.com/api/v2/profiles
3.10.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"friends_list",
"body":{
}
}
3.10.2. Success Response Format :
{
"command":"friends_list",
"status":200,
"message":"Ok",
"body":{
"sharing_with_me":[
{
"full_name":"",
"kl_id":"",
"phone_number":"",
"status":2,
"photograph":"",
"created_at":"",
"expected_responses":"< array of acceptable responses>"
}],
"i_am_sharing":"<array of friends same as above>"
"ignored":"<array of friends same as above>",
"kl_users":[
{
"phone_number":"9550469555",
"referral_code":"",
"status":0,
"sms_text":"<text message to user>",
"expected_responses":""
}],
"pending_invitations":[
{
"email":"",
"phone_number":"77777777",
"status":0,
"fname":"",
"lname":"",
"expected_responses":"< array of acceptable responses>"
}
],
"status_notation":{
"-1":"Ingore",
"0":"Pending (or) I am Sharing with",
"1":"Sharing with me",
"2":"Two way sharing"
}
}
}
3.11. Now Sharing:
description: it helps to get list of friends, whom sharing post to current user.
command: now_sharing
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/
3.11.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"now_sharing",
"body":{
}
}
3.10.2. Success Response Format :
{
"command":"now_sharing",
"status":200,
"message":"Ok",
"body":{
"friends":[
{
"full_name":"",
"kl_id":"",
"phone_number":"",
"status":2,
"photograph":"",
"created_at":"",
"expected_responses":"< array of acceptable responses>"
}
],
"status_notation":{
"-1":"Ingore",
"0":"Pending (or) I am Sharing with",
"1":"Sharing with me",
"2":"Two way sharing"
}
}
}
3.12. Ignored Friends:
description: it helps to get list of friends, whom current user ignored(i.e don't want to see posts).
command: ignored_friends
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/
3.12.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"ignored_friends",
"body":{
}
}
3.12.2. Success Response Format :
{
"command":"ignored_friends",
"status":200,
"message":"Ok",
"body":{
"friends":[
{
"full_name":"",
"kl_id":"",
"phone_number":"",
"status":2,
"photograph":"",
"created_at":"",
"expected_responses":"< array of acceptable responses>"
}
],
"status_notation":{
"-1":"Ingore",
"0":"Pending (or) I am Sharing with",
"1":"Sharing with me",
"2":"Two way sharing"
}
}
}
3.12. Pending Friends:
description: it helps to get list of friends, whom current user sharing post and also friends whom current_user invited to share posts
command: ignored_friends
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/
3.12.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"ignored_friends",
"body":{
}
}
3.12.2. Success Response Format :
{
"command":"ignored_friends",
"status":200,
"message":"Ok",
"body":{
"friends":[
{
"full_name":"",
"kl_id":"",
"phone_number":"",
"status":2,
"photograph":"",
"created_at":"",
"expected_responses":"< array of acceptable responses>"
}
],
"ignored":"<array of friends same as above>",
"status_notation":{
"-1":"Ingore",
"0":"Pending (or) I am Sharing with",
"1":"Sharing with me",
"2":"Two way sharing"
}
}
}
3.13. Change Friend Access:
description: it helps to get list of friends, whom sharing the post.
command: change_friend_access
method: POST
URL: https://kl-json.herokuapp.com/api/profiles/:kl_id
note: kl_id: Friends profiles kl_id.
3.13.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"change_friend_access",
"body":{
"state":"<choose from expected responses>"
}
}
3.13.2. Success Response Format :
{
"command":"change_friend_access",
"status":200,
"message":"Successfully Updated",
"body":""
}
3.13. Get Whom I Share:
description: it helps to check whether i am sharing posts with some one and gets the count of them.
command: get_whom_i_share
method: POST
URL: https://kl-json.herokuapp.com/api/profiles
3.13.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"get_whom_i_share",
"body":{
}
}
3.13.2. Success Response Format :
{
"command":"get_whom_i_share",
"status":200,
"message":"Ok",
"body":{
"i_am_sharing":"<boolean value true (or) false, true if the current user is sharing with some one>",
"i_am_sharing_count":"<count of the friends current user is sharing with.>",
}
}
3.14.Add Verified Phone Number:
description: it helps to add verified phone number to current user profile.
command: add_verified_phone_number
method: POST
URL: https://kl-json.herokuapp.com/api/profiles
3.14.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"add_verified_phone_number",
"body":{
"phone_number":""
}
}
3.14.2. Success Response Format :
{
"command":"add_verified_phone_number",
"status":200,
"message":"phone number successfully added",
"body":""
}
3.15. Change Parent Access:
description: change Access of individual family members on current user mangaeable kids.
command: change_parent_access
method: POST
URL: https://kl-json.herokuapp.com/api/profiles
3.15.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"change_access",
"body":{
"profile_id":"<parents profile_id from family info>",
"kids":[
{
"kid_profile_id":"<profile_id any kid in family>",
"relationship":"<relation between specified parent and kid>",
"manageable":"<it should be Boolean value, true or false>"
}
],
"allow_to_join_family":"<it should be Boolean value, true or false>"
}
}
Notes:
manageable:
1) if parent profile id is different from current parent logged_in,doesn't matter what the value of manageable it treats as 'true'.
2) if parent profile id belongs to current parent logged_in, true means he is willing to manage kid and any thing else will be treated as not willing to manage.
3.15.2. Success Response Format :
{
"command":"change_parent_access",
"status":200,
"message":"OK",
"body":{
}
}
3.15.3. Error Response Format :
{
"command":"change_parent_access",
"status":400,
"message":"<list of error messages with a ', ' separator.>",
"body":{
}
}
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. >",
"per_page":"<specify no objects per page. if empty, it assumes the default value>",
"page":"<page number you would like to view>"
}
}
4.5.2. Response Format:
{
"command":"all_alerts",
"status":200,
"message":"OK",
"body":{
"total_pages":"<total number of pages>",
"current_page_no":"<current page viewing>",
"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>"
}
]
}
],
"custom_tags_list": "<an array containing custom tag names.>"
}
}
5.2. 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.2.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.2.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_document",
"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.>"
}
}
6.12. Delete Document :
description: to get documents source urls of the documents.
command: delete_document
method: POST
URL: https://kl-json.herokuapp.com/api/document-vault/:kl_id
6.12.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"delete_document",
"body":{
}
}
6.12.2.Response Format:
{
"command":"document_source",
"status":200,
"message":"Document successfully deleted",
"body":{
}
}
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>"
}
}
}
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: invite_mom
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>"
}
}
7.5. Change Onboarding Partner:
description: it help to create or update onboarding partner(i.e Hospital Membership)
command: change_onboard_partner
method: POST
URL: https://kl-json.herokuapp.com/api/onboard_partners/
7.5.1. Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"change_onboard_partner",
"body":{
"hospital_id":"<kl_id of new onboading partner(i.e. hospital)>"
}
}
7.5.2. Response Format:
7.5.2.1 Success Response Format:
{
"command":"change_onboard_partner",
"status":200,
"message":"OK",
"body":{
"kl_id":"<hospital uid>",
"name":"<hospital name>",
"mobileinfo":"<html data>",
"logo":"<image url>",
"logo2":"<image url>"
}
}
7.5.2.2 Failure Response Format:
{
"command":"change_onboard_partner",
"status":400,
"message":"<list error messages seperated by ','>",
"body":{
}
}
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>"
}
]
}
]
}
}
9. Invitation Api’s:
9.1. Invite parent with kid access:
description: invite parent/spouse to manage kids and document access
command: invite_family_member
method: POST
URL: https://kl-json.herokuapp.com/api/invitations
9.1.1.Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "invite_family_member",
"body": {
"fname":"",
"lname":"",
"receiver_phone_number": "111111111",
"manageable_kids": [
{
"kid_profile_id": "< kid profile id >",
"relationship": "<relation between specified parent and kid>"
}
],
"allow_to_join_family": "<it should be Boolean value, true or false>"
}
}
9.1.2. Response format:
{
"command":"invite_family_member",
"status":200,
"message":"OK",
"body":{
"referral_message":"<message to family member along with referral url>",
"referral_code":"",
"is_invitee_exists":"<Boolean value true (or) false>"
}
}
9.2. Invite friend:
description: invite friend to share post and vice varsa
command: invite_friend
method: POST
URL: https://kl-json.herokuapp.com/api/invitations
9.2.1.Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "invite_friend",
"body": {
"fname":"",
"lname":"",
"receiver_phone_number": "<Mobile contact no from phone contacts>"
}
}
9.2.2. Response format:
{
"command":"invite_friend",
"status":200,
"message":"Ok",
"body":{
"now_sharing":true,
"referral_message":"",
"referral_code":"",
"is_invitee_exists":"<Boolean value true (or) false>"
}
}
9.3. Any Pending Actions:
description: this api is used to check any out standing invitation and total count of notification for current user logged in.
command: any_pending_actions
method: POST
URL: https://kl-json.herokuapp.com/api/invitations
9.3.1.Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "any_pending_actions",
"body": {
}
}
9.3.2. Response format:
{
"command":"any_pending_actions",
"status":200,
"message":"ok",
"body":{
"pending_actions":"<boolean value true (or) false>",
"notification_count":"<total notifications count>"
}
}
9.4.Pending Actions:
description: this api is used to get Pending Actions details one by one for current user logged in.
command: pending_actions
method: POST
URL: https://kl-json.herokuapp.com/api/invitations
9.4.1.Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "pending_actions",
"body": {
}
}
9.4.2. Response format:
{
"command":"pending_actions",
"status":200,
"message":"ok",
"body":{
"any_more_pending_actions" : "<Boolean value true (or) false>"
"referral_code":"<a unique identifier>",
"expected_responses":"<array of responses, need to choose one from them>",
"message":"< text to display on popup>"
"full_name":"<inviter full name>",
"photograph":"<inviter photograph>"
}
}
9.5. Capture Response to Pending Actions:
description: this helps to respond to above invitations.
command: respond_to_pending_action
method: POST
URL: https://kl-json.herokuapp.com/api/invitations
9.5.1.Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "respond_to_pending_action",
"body": {
"referral_code":"<a unique identifier>",
"state":"<pass of one of the expected responses send as part of invitation >"
}
}
9.5.2. Response format:
{
"command":"respond_to_pending_action",
"status":200,
"message":"Successfully Updated",
"body":""
}
9.6. Cancelling Invitation
description: this helps to cancel any Pending Invitation.
command: cancel_invitation
method: POST
URL: https://kl-json.herokuapp.com/api/invitations
9.6.1.Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "cancel_invitation",
"body": {
"referral_code":""
}
}
9.6.2. Response format:
{
"command":"respond_to_invitation",
"status":200,
"message":"Successfully Cancelled",
"body":""
}
10. Streaming(stories) Api’s:
10.1. Sample Milestones:
description: it helps to create milestone on mobile app
command: sample_milestones
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.1.1.Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"sample_milestones",
"body":{
}
}
10.1.2. Response format:
{
"command":"sample_milestones",
"status":200,
"message":"ok",
"body":{
"milestone_templates":[
{
"kl_id":"<kl_id of milestone_template>",
"name":"<name of the template>"
}
]
}
}
10.2. Create Story:
description: it helps to create story on mobile app
command: create_story
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.2.1.Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "create_story",
"body":{
"additional_text":"<message need to share>",
"tags":"<array of profile_ids to whom the story tagged (or) a string containing profile_ids seperated by ',' >",
"image_slug":"<image_slug>",
"scope":"<private (or) public>"
}
}
10.2.2. Response format:
{
"command":"create_story",
"status":200,
"message":"Story successfully created.",
"body":""
}
10.3. Create Milestone:
description: it helps to create milestone on mobile app
command: create_milestone
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.3.1.Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"create_milestone",
"body":{
"title":"<title of milestone>",
"date":"<date in mm/dd/yyyy>",
"additional_text":"<text to share on milestones>",
"tags":"<array of profile_ids to whom the story tagged (or) a string containing profile_ids seperated by ',' >",
"image_slug":"<image_slug>",
"scope":"<private (or) public>"
}
}
10.3.2. Response format:
{
"command":"create_milestone",
"status":200,
"message":"successfully created.",
"body":""
}
10.3. Create Question:
description: it helps to create milestone on mobile app
command: create_question
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.3.1.Request Format:
{
"access_token":"<Application authentication token>",
"auth_token":"<user authentication token>",
"command":"create_question",
"body":{
"additional_text":"<text to share on milestones>",
"scope":"<private (or) public>"
}
}
10.3.2. Response format:
{
"command":"create_question",
"status":200,
"message":"Question to friends Successfully created",
"body":""
}
10.4. Upload Image(Images to stories):
description: it helps to upload images to stories
command: upload_story_image
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.4.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "upload_story_image",
"body":{
"name":"doc1.jpeg",
"content_type":"image/jpeg",
"content":""
}
}
10.4.2. Response format:
{
"command":"upload_story_image",
"status":200,
"message":" successfully uploaded",
"body":{
"image_slug":"<a unique identifier for image>",
"image_url":"<image url>"
}
}
10.5. Upload Milestone Image(Images to milestones):
description: it helps to upload images to stories
command: upload_milestone_image
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.5.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "upload_milestone_image",
"body":{
"name":"doc1.jpeg",
"content_type":"image/jpeg",
"content":""
}
}
10.5.2. Response format:
{
"command":"upload_milestone_image",
"status":200,
"message":" successfully uploaded",
"body":{
"image_slug":"<a unique identifier for image>",
"image_url":"<image url>"
}
}
10.6. Profile Posts:
description: it helps to get all the post relevant profile, these include post which are shared to him, tagged him and created by him.
command: profile_posts
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.6.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "family_posts",
"body":{
"last_modified":"",
"post_count":0,
"step":"next",
"profile_id":"<profiles kl_id. if it left empty , family documents will be displayed.>"
}
}
10.6.2. Response format:
{
"command":"streams",
"status":200,
"message":"Ok",
"body":{
"posts":[
{
"kl_id":"<unique identifier of story>",
"slug":"<unique slug generated for post>",
"post_type":"Story",
"text":"<content of story>",
"tags":"<array of profile_ids tagged, at the time of story creation>",
"image":"mobile version post image url",
"large_image":"originally uploaded post image url",
"can_delete":"<Boolean value true (or) false>",
"tagged_to":[
{
"name":"<name of the profile tagged to>",
"photograph":""
}
],
"comments":[
{
"content":"<text of the comment>",
"created_at":"<created time stamp>",
"slug":"<slug for comment>",
"commented_by":"<name of the commenter>",
"commenter_photo":"<photograph of commentor>"
}
]
}
]
}
}
10.7. Friend Posts:
description: it helps to get all the post relevant profile, these include post which are shared to him, tagged him and created by him.
command: friend_posts
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.7.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "friend_posts",
"body":{
"last_modified":"",
"post_count":0,
"step":"next",
"friend_id":"<friensd kl_id. if it left empty , friends will be displayed.>"
}
}
10.7.2. Response format:
{
"command":"friend_posts",
"status":200,
"message":"Ok",
"body":{
"posts":[
{
"kl_id":"<unique identifier of story>",
"slug":"<unique slug generated for post>",
"post_type":"Story",
"text":"<content of story>",
"tags":"<array of profile_ids tagged, at the time of story creation>",
"image":"mobile version post image url",
"large_image":"originally uploaded post image url",
"can_delete":"<Boolean value true (or) false>",
"tagged_to":[
{
"name":"<name of the profile tagged to>",
"photograph":""
}
],
"comments":[
{
"content":"<text of the comment>",
"created_at":"<created time stamp>",
"slug":"<slug for comment>",
"commented_by":"<name of the commenter>",
"commenter_photo":"<photograph of commentor>"
}
]
}
]
}
}
10.8. All Streams:
description: it helps to get all the post relevant profile, these include post which are shared to him, tagged him and created by him.
command: family_posts
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.8.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "family_posts",
"body":{
"last_modified":"",
"post_count":0,
"feed_count":0,
"step":"next"
}
}
10.8.2. Response format:
{
"command":"streams",
"status":200,
"message":"Ok",
"body":{
"posts":[
{
"kl_id":"<unique identifier of story>",
"slug":"<unique slug generated for post>",
"post_type":"Story",
"text":"<content of story>",
"tags":"<array of profile_ids tagged, at the time of story creation>",
"image":"mobile version post image url",
"large_image":"originally uploaded post image url",
"can_delete":"<Boolean value true (or) false>",
"tagged_to":[
{
"name":"<name of the profile tagged to>",
"photograph":""
}
],
"comments":[
{
"content":"<text of the comment>",
"created_at":"<created time stamp>",
"slug":"<slug for comment>",
"commented_by":"<name of the commenter>",
"commenter_photo":"<photograph of commentor>"
}
]
}
]
}
}
10.9. Delete Stream / Post:
description: it helps to delete any of Moments, Milestones and Questions created by current user.
command: delete_post
method: POST
URL: https://kl-json.herokuapp.com/api/posts/:kl_id
10.9.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "delete_post",
"body":""
}
10.9.2. Success Response format:
{
"command":"delete_post",
"status":200,
"message":"Post sucessfully deleted.",
"body":""
}
10.9.3. Failure Response format:
{
"command":"delete_post",
"status":400,
"message":"Opps!, Non of your post matched with given id.",
"body":""
}
10.10. Get Post Original Image:
description: it helps to get original image of Moments, Milestones created by current user or his friends or family members.
command: delete_post
method: POST
URL: https://kl-json.herokuapp.com/api/posts
10.10.1. Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "get_post_image",
"body":{
"post_slug":"<slug of any post>"
}
}
10.10.2. Success Response format:
{
"command":"delete_post",
"status":200,
"message":"ok",
"body":{
"large_image": "<image url>"
}
}
10.10.3. Failure Response format:
{
"command":"delete_post",
"status":400,
"message":"Opps! Post with given identifier not found for Current User",
"body":""
}
11. Comments Api's :
11.1. Create Comment:
description: it helps to comment on posts authorized to current user.
command: create
method: POST
URL: https://kl-json.herokuapp.com/api/comments
11.1.1.Request Format:
{
"access_token": "<Application authentication token>",
"auth_token": "<user authentication token>",
"command": "create",
"body":{
"post_slug": "<slug of post to comment>",
"post_type":"<Story (or) Milestone>",
"text":"<textual representation of comment>",
"scope":"<public (or) private>"
}
}
Note : 'public' for All of [Moment poster's] friends.
'private' for Only mutual friends
11.1.2. Response format:
{
"command":"create",
"status":200,
"message":"Successfully Commented.",
"body":{
"content":"<text of the comment>",
"created_at":"<created time stamp>",
"slug":"<slug for comment>",
"commented_by":"<name of the commenter>"
"commenter_photo":"<photograph of commentor>"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment