Python Apis for PoolClues Test server for front end setup at http://api.poolclues.anip.xyz:8080/ so use it as url in front end. NOTE: This ip address is blocked in college so use proxy to access it in college
To test if you are apble to connect to server send http get request to http://api.poolclues.anip.xyz:8080/ or try to open it in browser
response should be { "success": "It works" }
#Api description:
so url will be http://api.poolclues.anip.xyz:8080/register
{
"first_name": "Gaurav",
"middle_name":"Ramakant",
"last_name": "Shukla",
"email_id":"deathping1994@gmail.com",
"password":"bastard007",
"house_no":"559 ka/48 kha",
"street":"Singar Nagar",
"city":"Lucknow",
"state":"Uttar Pradesh",
"country":"India",
"phone":"8375847862", //optional
"user_img":"imgae url" //optional
}
{
"success": "User successfully registered"
}
or
{
"error": "Oops something went wrong. Contact the adminsitrator"
}
so url will be http://api.poolclues.anip.xyz:8080/fblogin
{
"fbtoken":"send fb token here",
"first_name": "Gaurav",
"middle_name":"Ramakant",
"last_name": "Shukla",
"email_id":"deathping1994@gmail.com",
"password":"", //don't send any password
"house_no":"559 ka/48 kha",
"street":"Singar Nagar",
"city":"Lucknow",
"state":"Uttar Pradesh",
"country":"India",
"phone":"8375847862", //optional
"user_img":"imgae url" //optional
}
{
"success": "User successfully logged in",
"authtoken": "$2b$12$WI1yg7EgIo0MbGblJd7sA.zhaPBSpMuKenvnoWEiiUANR1ywBOEaC"
}
or
{
"error": "Oops something went wrong. Contact the adminsitrator"
}
so url will be http://localhost:8080/gshukla66@gmail.com/verify
{
"authtoken": "$2b$12$WI1yg7EgIo0MbGblJd7sA.zhaPBSpMuKenvnoWEiiUANR1ywBOEaC",
"verification_code":"7OL124"
}
{
"success": ""Email Successfully verified"
}
or
{
"error": "Some error message"
}
so url will be http://localhost:8080/forgotpassword/gshukla66@gmail.com
{
"success": "Password change request has been recorded check your email for further instructions."
}
or
{
"error": "Some error message"
}
example: http://api.poolclues.anip.xyz:8080/logout/gshukla66@gmail.com
{
"email_id":<user's email_id>,
"password":<user's password>
}
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq",
"success": "Successfully Logged in !"
}
or
{
"error":"Some error message"
}
example: http://api.poolclues.anip.xyz:8080/logout/gshukla66@gmail.com
{"authtoken":<user's suth token>
}
{
"success":"Successfully logged off"
}
or
{
"error":"Some error message"
}
NOTE: As of now this endpoint return successfully logged off even when you are not logged in , this is a bug but wont be fixed keeping in mind that this system would be replaced with three legged auth system using redis,and JWT
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/addphone/8375847862
{"authtoken":<user's suth token>
}
{
"success":"Contact added Successfully!"
}
or
{
"error":"Some error message"
}
so url will be http://localhost:8080/products/search?query="search keyword"
or http://localhost:8080/products/search?query=beautiful%20watch&from=100
default size is 10 and default from is 0
where from denotes the result number eg: is total matches is 100 and from is 30 then products from 30 onwards are returned
{
"authtoken": "$2b$12$WI1yg7EgIo0MbGblJd7sA.zhaPBSpMuKenvnoWEiiUANR1ywBOEaC"
}
{
"hits": [
{
"_id": "97805",
"_index": "products",
"_score": 0.8274903,
"_source": {
"Brand": "Suunto",
"COD": "Yes",
"Category Id": "1559",
"Category Path": "Jewelry & Watches///Watches///Unisex",
"Customer_type": "R",
"Deal": "No",
"Discount (percentage)": "15%",
"EMI": "Yes",
"FreeBee Inside": "No",
"Gender": "U",
"Leaf Category": "Unisex",
"Leaf CategoryId": "1559",
"MRP": "22950.00",
"Meta category": "Jewelry Watches",
"Price": "19508.00",
"Product ID": "97805",
"Product Label1": "NotAvailable",
"Product Label2": "NotAvailable",
"Product Label3": "NotAvailable",
"Product Label4": "NotAvailable\n",
"Product Name": "Suunto Quest Orange Watch SS018154000",
"Product URL": "http://www.shopclues.com/suunto-quest-orange-watch-ss018154000.html",
"Shipping Cost": "0.00",
"Stock": "Yes",
"Warranty": "NotAvailable",
"image_path": "http://cdn.shopclues.net/images/detailed/85/SUUNTO_QUEST_ORANGE.jpg"
},
"_type": "product"
}
],
"max_score": 1.3740486,
"total": 202
}
TO change password once the forgot password request has been generated example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/change/password
{
"request_code":"password change request code sent in email".
"new_password":"new password"
}
{
"success": "Password changed successfully"
}
or
{
"error":"Some error message"
}
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/change/password/2
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq",
"new_password": "new password here"
}
{
"success": "Password updated successfully"
}
or
{
"error":"Some error message"
}
type can be invited, all, created contributed : List all pools the user has contributed to created : List all events user has created all : Include both created and contributed example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/pool/list/invited
{
"pool_list": [
{
"date_created": "2015-10-08",
"pool_description": "Too lazy for that",
"pool_id": 106,
"pool_name": "Gaurav's b'day",
"public": true,
"target_amount": 5000,
"target_date": "2015-12-11"
},
{
"date_created": "2015-10-08",
"pool_description": "Too lazy for that",
"pool_id": 106,
"pool_name": "Gaurav's b'day",
"public": true,
"target_amount": 5000,
"target_date": "2015-12-11"
}
]
}
or
{
"error":"Some error message"
}
To give details of a single pool example: http://api.poolclues.anip.xyz:8080/pool/115
{
"contributors": [
{
"amount": 2500,
"amount_paid": null,
"email_id": "deathping19@gmail.com",
"status": "UNPAID"
},
{
"amount": 2500,
"amount_paid": null,
"email_id": "deathping192@gmail.com",
"status": "UNPAID"
}
],
"is_creator":true,
"pool_description": "Too lazy for that",
"pool_id": 116,
"pool_name": "Gaurav's b'day",
"target_amount": 5000,
"target_date": "2015-12-11"
}
or
{
"error":"Some error message"
}
example: http://api.poolclues.anip.xyz:8080/pool/create
{"email_id":"94@gmail.com",
"pool_name": "Gaurav's b'day",
"pool_img": "url for pool image" //optional
"target_date": "11122015",
"target_amount":"5000",
"description":"Too lazy for that",
"contributors": [{"email_id":"deathping1994@gmail.com","amount":"2000"},// minimum two contributors required
{"email_id":"94@gmail.com","amount":"2000"} // creator must also be a contributor
],
"products":["id1","id2"], //Array of pid of products selected as gift (optional in case of cash voucher do not pass this field)
"msg": "new custom message",
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq",
"searchable": true
}
{
"failedlist": [],
"inviteSent": true,
"pool_id": 116,
"success": "Pool created successfully."
}
or
{
"error":"Some error message"
}
example: http://api.poolclues.anip.xyz:8080/event/104/invite
{
"contributors": [{"email_id":"deathping1994@gmail.com","amount":2000} // amount here is not optional.
],
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"success": "Invites sent successfully"
}
or
{
"error":"Some error message"
}
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/pool/104/delete
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"success": "Pool Deleted successfully"
}
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/pool/104/update ###Note: Constraints This api can't be used to upload images, and target amount can't be reduced Only send fields that need to be updated
{ "pool_name": "Gaurav's b'day",
"target_date": "11122015",
"target_amount":"5000",
"description":"Too lazy for that",
"searchable": true
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"success":"Pool updated Successfully"
}
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/103/find/share
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"success": "Payment request submitted check status in the payment history"
}
or
{
"error":"Some error message"
}
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/pay/103
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"success": "Payment request submitted check status in the payment history"
}
or
{
"error":"Some error message"
}
Registry is like wish list of user. User creates a registry and selects products which he wants to receive as gifts. Invite is send to all email id from whom user wishes to get a gift. User is not bound to make any payment and only this products get delivered for which the payment is complete
example: http://api.poolclues.anip.xyz:8080/registry/create
{
"email_id":"deathping1994@gmail.com",
"registry_name": "Gaurav's b'day",
"target_date": "11122015",
"description":"Too lazy for that",
"invites": [{"email_id":"poolclues@gmail.com","amount":3000
}],
"products":["id1","id2"],
"msg": "new custom message",
"authtoken": "$2b$12$zXJud8qrfsPbMjdyLULT7O13LsrJ.LfO5RwwxrpCvy3cuSyrqXPqS",
"public": true //optional By default Assumed too be true
}
{
"failedlist": [],
"inviteSent": true,
"registry_id": 105,
"success": "Registry created successfully."
}
or
{
"error":"Some error message"
}
example: http://api.poolclues.anip.xyz:8080/deathping1994@gmail.com/registry/list
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"registry_list": [
{
"date_created": "2015-11-28",
"pool_description": "Too lazy for that",
"pool_id": 102,
"pool_name": "Gaurav's b'day",
"searchable": true,
"target_date": "2015-12-11"
}
]
}
or
{
"error":"Some Error Message"
}
example: http://api.poolclues.anip.xyz:8080/registry/104
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"giftbucket": [
{
"pid": "id1",
"status": null
},
{
"pid": "id2",
"status": null
}
],
"invitees": [
"poolclues@gmail.com"
],
"is_creator": true,
"registry_description": "Too lazy for that",
"registry_id": 101,
"registry_name": "Gaurav's b'day",
"target_date": "2015-12-11"
}
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/registry/104/delete
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"success": "Registry Deleted successfully"
}
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/registry/104/update ###Note: Constraints This api can't be used to upload images, and target amount can't be reduced Only send fields that need to be updated
{ "registry_name": "Gaurav's b'day",
"target_date": "11122015",
"target_amount":"5000",
"description":"Too lazy for that",
"searchable": true
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"success":"Pool updated Successfully"
}
example: http://api.poolclues.anip.xyz:8080/registry/104/invite
{
"invites": [{"email_id":"deathping1994@gmail.com","amount":2000}
],
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"success": "Invites sent successfully"
}
or
{
"error":"Some error message"
}
{
"authtoken": "your auth token"
}
{"amount": amount in wallet
}
or
{"error": "Some error msg"
}
Shows list of all transaction by a particular user. Where pool_id ='' in response then the money was added to wallet. if pool_id=event id or registry id
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/wallet/history
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"transactions": [
{
"amount": 0,
"date": "2015-11-04",
"pool_id": "",
"transaction_id": "$2b$12$C1Ba/kQF3jhBNNdKpzUy6uCPGRTRym0/SCgA.48Cr463G0nxOHMSm"
},
{
"amount": 400,
"date": "2015-11-04",
"pool_id": "",
"transaction_id": "$2b$12$Q9yqx80LPuDBX3KCL9x0Y.Bn8T/gNplTzD2YnNvcEVYUm.Zlq8aqa"
}
]
}
or
{
"error":"Some error message"
}
Each user is given a wallet when he signs up all the payments are processed via this wallet. Initially the balance is zero to add money to wallet user needs to be logged in and then submit a request to add money to wallet via this url.
example: http://api.poolclues.anip.xyz:8080/gshukla66@gmail.com/wallet/add
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq",
"amount": 5000
}
{
"success": "Payment request submitted check status in the payment history"
}
or
{
"error":"Some error message"
}
##List all POSTS on POOL AND REGISTRY timeline
example: http://api.poolclues.anip.xyz:8080/104/post/list
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"posts": [
{
"author": "deathping1994@gmail.com",
"comments": [],
"content": "hi how are you ganesh ?",
"post_id": 10
},
{
"author": "deathping1994@gmail.com",
"comments": [
{
"author": "deathping1994@gmail.com",
"comment_id": 20,
"content": "hi how are you ganesh ?"
}
],
"content": "hi how are you ganesh ?",
"post_id": 11
}
]
}
or
{
"error":"Some error message"
}
##List single POST
example: http://api.poolclues.anip.xyz:8080/104/post/21
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq"
}
{
"author": "deathping1994@gmail.com",
"comments": [
{
"author": "deathping1994@gmail.com",
"comment_id": 20,
"content": "hi how are you ganesh ?"
}
],
"content": "hi how are you ganesh ?",
"post_id": 11
}
or
{
"error":"Some error message"
}
##POSTS on POOL AND REGISTRY timeline
example: http://api.poolclues.anip.xyz:8080/104/post
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq",
"content": "post content goes here"
}
{
"success": "Posted Successfully"
}
or
{
"error":"Some error message"
}
##Comments on Posts
example: http://api.poolclues.anip.xyz:8080/104/21/comment
{
"authtoken": "$2a$12$wdss4GzgeKb/JW/HUpINjO0pZ462LF65U2dBnlHAGmF7TIndhdRgq",
"content": "comment content goes here"
}
{
"success": "Comment Posted Successfully"
}
or
{
"error":"Some error message"
}