Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FORMAT: 1A
- HOST: http://younglyapi.molegroup.co/
- # Youngly
- # Group User
- ## Register with email [/user/?register_email]
- ### Register with email [POST]
- Register for account with emaill and password. (no facebook)
- <ul>
- <li>email* (string) - Users email address</li>
- <li>password* (int) - users password (min 6 charaters)</li>
- </ul>
- + Request (application/x-www-form-urlencoded)
- email=1&password=1
- + Response 200 (application/json)
- {
- "result": true,
- "user": {
- "id": 1,
- "email": "",
- "preference": "",
- "basket_count": "",
- "style": "outlet"
- }
- }
- + Response 400 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- + Response 400 (application/json)
- {
- "result": false,
- "message": "email address already exists"
- }
- ## Login with email [/user/?login_email]
- ### Login with email [POST]
- Login with users email address
- <ul>
- <li>email* (string) - Users email address</li>
- <li>password* (int) - users password (min 6 charaters)</li>
- </ul>
- + Request (application/x-www-form-urlencoded)
- email=1&password=1
- + Response 200 (application/json)
- {
- "result": true,
- "user": {
- "id": 1,
- "email": "",
- "preference": "",
- "basket_count": "",
- "style": "outlet"
- }
- }
- + Response 400 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- + Response 400 (application/json)
- {
- "result": false,
- "message": "incorrect email password combo"
- }
- ## Login/Register Facebook [/user/?login_facebook]
- ### Login/Register Facebook [POST]
- Login/register with facebook account
- <ul>
- <li>facebook_token* (int) - user facebook token</li>
- </ul>
- + Request (application/x-www-form-urlencoded)
- facebook_token=1
- + Response 200 (application/json)
- {
- "result": true,
- "user": {
- "id": 1,
- "email": "",
- "preference": "",
- "basket_count": "",
- "style": "outlet"
- }
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## View profile [/user/?profile]
- ### View profile [POST]
- View users profile
- <ul>
- <li>viewing_user* (int) - users id</li>
- </ul>
- + Request (application/x-www-form-urlencoded)
- viewing_user=1
- + Response 200 (application/json)
- {
- "result": true,
- "user": {
- "id": 1,
- "email": "",
- "preference": "",
- "basket_count": "",
- "style": "outlet"
- }
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## update profile [/user/?update_profile]
- ### update profile [POST]
- View users profile
- only passed passed paramates will be updated
- <ul>
- <li>viewing_user* (int) - users id</li>
- <li>preference (string) - "boy","girl" or "both"</li>
- <li>style (string) - "luxury","highstreet" or "outlet"</li>
- </ul>
- + Request (application/x-www-form-urlencoded)
- viewing_user=1&preference=1
- + Response 200 (application/json)
- {
- "result": true,
- "user": {
- "id": 1,
- "email": "",
- "preference": "",
- "basket_count": "",
- "style": "outlet"
- }
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## forgot password [/user/?forgot_password]
- ### forgot password [POST]
- View user profile
- <ul>
- <li>email* (int) - users email address</li>
- </ul>
- + Request (application/x-www-form-urlencoded)
- email=1
- + Response 200 (application/json)
- {
- "result": true,
- "message": "new password sent"
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- # Group product
- ## Add product to backet [/product/?add_to_basket]
- ### Add product to backet [POST]
- Add product to users backet
- <ul>
- <li>viewing_user* (int) - id of the users making the call</li>
- <li>product_id* (int) - id of the product to add to the backet</li>
- </ul>
- + Header
- auth
- + Request (application/x-www-form-urlencoded)
- viewing_user=1&product_id=1
- + Response 200 (application/json)
- {
- "result": true,
- "product": [
- {
- "id": 1,
- "name": "string",
- "description": "string",
- "avatar": "http://google.co.uk",
- "price": "1.00",
- "product_link": "http://google.co.uk",
- "preference": "boy",
- "style": "1"
- }
- ]
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## remove product from backet [/product/?remove_from_basket]
- ### remove product from backet [POST]
- <ul>
- <li>viewing_user* (int) - id of the users making the call</li>
- <li>product_id* (int) - id of the product to remove from backet</li>
- </ul>
- + Header
- auth
- + Request (application/x-www-form-urlencoded)
- viewing_user=1&product_id=1
- + Response 200 (application/json)
- {
- "result": true,
- "message": "success"
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## get all product categories [/product/?get_categories]
- ### get all product categories [POST]
- <ul>
- <li>viewing_user* (int) - id of the users making the call</li>
- </ul>
- + Header
- auth
- + Request (application/x-www-form-urlencoded)
- viewing_user=1
- + Response 200 (application/json)
- {
- "result": true,
- "categories": [
- {
- "id": "1",
- "name": "Baby boy",
- "avatar": "http://youngly.api/img/babyBoyIcon@2x.png"
- },
- {
- "id": "2",
- "name": "Baby girl",
- "avatar": "http://youngly.api/img/babyGirlIcon@2x.png"
- },
- {
- "id": "3",
- "name": "Boy",
- "avatar": "http://youngly.api/img/boyIcon@2x.png"
- },
- {
- "id": "4",
- "name": "Girl",
- "avatar": "http://youngly.api/img/girlIcon@2x.png"
- },
- {
- "id": "5",
- "name": "Special occasions",
- "avatar": "http://youngly.api/img/specialOccasionsIcon@2x.png"
- },
- {
- "id": "6",
- "name": "Accessories",
- "avatar": "http://youngly.api/img/accessoriesIcon@2x.png"
- }
- ]
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## View basket [/product/?view_basket]
- ### View basket [POST]
- <ul>
- <li>viewing_user* (int) - id of the users making the call</li>
- </ul>
- + Header
- auth
- + Request (application/x-www-form-urlencoded)
- viewing_user=1
- + Response 200 (application/json)
- {
- "result": true,
- "product": [
- {
- "id": 1,
- "name": "string",
- "description": "string",
- "avatar": "http://google.co.uk",
- "price": "1.00",
- "product_link": "http://google.co.uk",
- "preference": "boy",
- "style": "1"
- }
- ]
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## Search for product [/product/?search]
- ### Search for product [POST]
- <ul>
- <li>viewing_user* (int) - id of the users making the call</li>
- <li>search* (string) - search term</li>
- </ul>
- + Header
- auth
- + Request (application/x-www-form-urlencoded)
- viewing_user=1&search=1
- + Response 200 (application/json)
- {
- "result": true,
- "product": [
- {
- "id": 1,
- "name": "string",
- "description": "string",
- "avatar": "http://google.co.uk",
- "price": "1.00",
- "product_link": "http://google.co.uk",
- "preference": "boy",
- "style": "1"
- }
- ]
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## View products [/product/?view]
- ### View products [POST]
- 5 products returned at a time
- <ul>
- <li>viewing_user* (int) - id of the users making the call</li>
- </ul>
- + Header
- auth
- + Request (application/x-www-form-urlencoded)
- viewing_user=1
- + Response 200 (application/json)
- {
- "result": true,
- "product": [
- {
- "id": 1,
- "name": "string",
- "description": "string",
- "avatar": "http://google.co.uk",
- "price": "1.00",
- "product_link": "http://google.co.uk",
- "preference": "boy",
- "style": "1"
- }
- ]
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
- ## View products in Category [/product/?view_in_category]
- ### View products in Category [POST]
- 5 products returned at a time
- <ul>
- <li>viewing_user* (int) - id of the users making the call</li>
- <li>cat_id* (int) - id of the category</li>
- <li>page (int) - page number to view, if none past page 1 returned</li>
- </ul>
- + Header
- auth
- + Request (application/x-www-form-urlencoded)
- viewing_user=1&cat_id=1&page=1
- + Response 200 (application/json)
- {
- "result": true,
- "page": 1,
- "products": [
- {
- "id": 1,
- "name": "string",
- "description": "string",
- "avatar": "http://google.co.uk",
- "price": "1.00",
- "product_link": "http://google.co.uk",
- "preference": "boy",
- "style": "1"
- }
- ]
- }
- + Response 401 (application/json)
- {
- "result": false,
- "message": "post paramater(s) missing"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement