Advertisement
Guest User

Untitled

a guest
Jun 9th, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.38 KB | None | 0 0
  1. FORMAT: 1A
  2. HOST: http://younglyapi.molegroup.co/
  3.  
  4. # Youngly
  5.  
  6. # Group User
  7.  
  8. ## Register with email [/user/?register_email]
  9.  
  10. ### Register with email [POST]
  11.  
  12. Register for account with emaill and password. (no facebook)
  13.  
  14. <ul>
  15. <li>email* (string) - Users email address</li>
  16. <li>password* (int) - users password (min 6 charaters)</li>
  17. </ul>
  18.  
  19. + Request (application/x-www-form-urlencoded)
  20. email=1&password=1
  21.  
  22. + Response 200 (application/json)
  23. {
  24. "result": true,
  25. "user": {
  26. "id": 1,
  27. "email": "",
  28. "preference": "",
  29. "basket_count": "",
  30. "style": "outlet"
  31. }
  32. }
  33. + Response 400 (application/json)
  34.  
  35. {
  36. "result": false,
  37. "message": "post paramater(s) missing"
  38. }
  39. + Response 400 (application/json)
  40.  
  41. {
  42. "result": false,
  43. "message": "email address already exists"
  44. }
  45.  
  46. ## Login with email [/user/?login_email]
  47.  
  48. ### Login with email [POST]
  49.  
  50. Login with users email address
  51. <ul>
  52. <li>email* (string) - Users email address</li>
  53. <li>password* (int) - users password (min 6 charaters)</li>
  54. </ul>
  55.  
  56. + Request (application/x-www-form-urlencoded)
  57. email=1&password=1
  58.  
  59. + Response 200 (application/json)
  60. {
  61. "result": true,
  62. "user": {
  63. "id": 1,
  64. "email": "",
  65. "preference": "",
  66. "basket_count": "",
  67. "style": "outlet"
  68. }
  69. }
  70. + Response 400 (application/json)
  71. {
  72. "result": false,
  73. "message": "post paramater(s) missing"
  74. }
  75. + Response 400 (application/json)
  76. {
  77. "result": false,
  78. "message": "incorrect email password combo"
  79. }
  80.  
  81.  
  82. ## Login/Register Facebook [/user/?login_facebook]
  83.  
  84. ### Login/Register Facebook [POST]
  85.  
  86. Login/register with facebook account
  87. <ul>
  88. <li>facebook_token* (int) - user facebook token</li>
  89. </ul>
  90.  
  91. + Request (application/x-www-form-urlencoded)
  92. facebook_token=1
  93.  
  94. + Response 200 (application/json)
  95. {
  96. "result": true,
  97. "user": {
  98. "id": 1,
  99. "email": "",
  100. "preference": "",
  101. "basket_count": "",
  102. "style": "outlet"
  103. }
  104. }
  105. + Response 401 (application/json)
  106. {
  107. "result": false,
  108. "message": "post paramater(s) missing"
  109. }
  110.  
  111.  
  112. ## View profile [/user/?profile]
  113.  
  114. ### View profile [POST]
  115.  
  116. View users profile
  117. <ul>
  118. <li>viewing_user* (int) - users id</li>
  119. </ul>
  120.  
  121. + Request (application/x-www-form-urlencoded)
  122. viewing_user=1
  123.  
  124. + Response 200 (application/json)
  125. {
  126. "result": true,
  127. "user": {
  128. "id": 1,
  129. "email": "",
  130. "preference": "",
  131. "basket_count": "",
  132. "style": "outlet"
  133. }
  134. }
  135. + Response 401 (application/json)
  136. {
  137. "result": false,
  138. "message": "post paramater(s) missing"
  139. }
  140.  
  141. ## update profile [/user/?update_profile]
  142.  
  143. ### update profile [POST]
  144.  
  145. View users profile
  146.  
  147. only passed passed paramates will be updated
  148. <ul>
  149. <li>viewing_user* (int) - users id</li>
  150. <li>preference (string) - "boy","girl" or "both"</li>
  151. <li>style (string) - "luxury","highstreet" or "outlet"</li>
  152. </ul>
  153.  
  154. + Request (application/x-www-form-urlencoded)
  155. viewing_user=1&preference=1
  156.  
  157. + Response 200 (application/json)
  158. {
  159. "result": true,
  160. "user": {
  161. "id": 1,
  162. "email": "",
  163. "preference": "",
  164. "basket_count": "",
  165. "style": "outlet"
  166. }
  167. }
  168. + Response 401 (application/json)
  169. {
  170. "result": false,
  171. "message": "post paramater(s) missing"
  172. }
  173.  
  174. ## forgot password [/user/?forgot_password]
  175.  
  176. ### forgot password [POST]
  177.  
  178. View user profile
  179. <ul>
  180. <li>email* (int) - users email address</li>
  181. </ul>
  182.  
  183.  
  184. + Request (application/x-www-form-urlencoded)
  185. email=1
  186.  
  187. + Response 200 (application/json)
  188. {
  189. "result": true,
  190. "message": "new password sent"
  191. }
  192. + Response 401 (application/json)
  193. {
  194. "result": false,
  195. "message": "post paramater(s) missing"
  196. }
  197.  
  198. # Group product
  199.  
  200. ## Add product to backet [/product/?add_to_basket]
  201.  
  202. ### Add product to backet [POST]
  203.  
  204. Add product to users backet
  205. <ul>
  206. <li>viewing_user* (int) - id of the users making the call</li>
  207. <li>product_id* (int) - id of the product to add to the backet</li>
  208. </ul>
  209.  
  210. + Header
  211. auth
  212. + Request (application/x-www-form-urlencoded)
  213. viewing_user=1&product_id=1
  214.  
  215. + Response 200 (application/json)
  216. {
  217. "result": true,
  218. "product": [
  219. {
  220. "id": 1,
  221. "name": "string",
  222. "description": "string",
  223. "avatar": "http://google.co.uk",
  224. "price": "1.00",
  225. "product_link": "http://google.co.uk",
  226. "preference": "boy",
  227. "style": "1"
  228. }
  229. ]
  230. }
  231. + Response 401 (application/json)
  232.  
  233. {
  234. "result": false,
  235. "message": "post paramater(s) missing"
  236. }
  237.  
  238. ## remove product from backet [/product/?remove_from_basket]
  239.  
  240. ### remove product from backet [POST]
  241.  
  242. <ul>
  243. <li>viewing_user* (int) - id of the users making the call</li>
  244. <li>product_id* (int) - id of the product to remove from backet</li>
  245. </ul>
  246.  
  247. + Header
  248. auth
  249. + Request (application/x-www-form-urlencoded)
  250. viewing_user=1&product_id=1
  251.  
  252. + Response 200 (application/json)
  253. {
  254. "result": true,
  255. "message": "success"
  256. }
  257. + Response 401 (application/json)
  258.  
  259. {
  260. "result": false,
  261. "message": "post paramater(s) missing"
  262. }
  263.  
  264. ## get all product categories [/product/?get_categories]
  265.  
  266. ### get all product categories [POST]
  267.  
  268. <ul>
  269. <li>viewing_user* (int) - id of the users making the call</li>
  270. </ul>
  271.  
  272. + Header
  273. auth
  274. + Request (application/x-www-form-urlencoded)
  275. viewing_user=1
  276.  
  277. + Response 200 (application/json)
  278. {
  279. "result": true,
  280. "categories": [
  281. {
  282. "id": "1",
  283. "name": "Baby boy",
  284. "avatar": "http://youngly.api/img/babyBoyIcon@2x.png"
  285. },
  286. {
  287. "id": "2",
  288. "name": "Baby girl",
  289. "avatar": "http://youngly.api/img/babyGirlIcon@2x.png"
  290. },
  291. {
  292. "id": "3",
  293. "name": "Boy",
  294. "avatar": "http://youngly.api/img/boyIcon@2x.png"
  295. },
  296. {
  297. "id": "4",
  298. "name": "Girl",
  299. "avatar": "http://youngly.api/img/girlIcon@2x.png"
  300. },
  301. {
  302. "id": "5",
  303. "name": "Special occasions",
  304. "avatar": "http://youngly.api/img/specialOccasionsIcon@2x.png"
  305. },
  306. {
  307. "id": "6",
  308. "name": "Accessories",
  309. "avatar": "http://youngly.api/img/accessoriesIcon@2x.png"
  310. }
  311. ]
  312. }
  313. + Response 401 (application/json)
  314.  
  315. {
  316. "result": false,
  317. "message": "post paramater(s) missing"
  318. }
  319.  
  320. ## View basket [/product/?view_basket]
  321.  
  322. ### View basket [POST]
  323.  
  324. <ul>
  325. <li>viewing_user* (int) - id of the users making the call</li>
  326. </ul>
  327.  
  328. + Header
  329. auth
  330. + Request (application/x-www-form-urlencoded)
  331. viewing_user=1
  332.  
  333. + Response 200 (application/json)
  334. {
  335. "result": true,
  336. "product": [
  337. {
  338. "id": 1,
  339. "name": "string",
  340. "description": "string",
  341. "avatar": "http://google.co.uk",
  342. "price": "1.00",
  343. "product_link": "http://google.co.uk",
  344. "preference": "boy",
  345. "style": "1"
  346. }
  347. ]
  348. }
  349. + Response 401 (application/json)
  350.  
  351. {
  352. "result": false,
  353. "message": "post paramater(s) missing"
  354. }
  355.  
  356. ## Search for product [/product/?search]
  357.  
  358. ### Search for product [POST]
  359.  
  360. <ul>
  361. <li>viewing_user* (int) - id of the users making the call</li>
  362. <li>search* (string) - search term</li>
  363. </ul>
  364.  
  365. + Header
  366. auth
  367. + Request (application/x-www-form-urlencoded)
  368. viewing_user=1&search=1
  369.  
  370. + Response 200 (application/json)
  371. {
  372. "result": true,
  373. "product": [
  374. {
  375. "id": 1,
  376. "name": "string",
  377. "description": "string",
  378. "avatar": "http://google.co.uk",
  379. "price": "1.00",
  380. "product_link": "http://google.co.uk",
  381. "preference": "boy",
  382. "style": "1"
  383. }
  384. ]
  385. }
  386. + Response 401 (application/json)
  387.  
  388. {
  389. "result": false,
  390. "message": "post paramater(s) missing"
  391. }
  392.  
  393. ## View products [/product/?view]
  394.  
  395. ### View products [POST]
  396.  
  397. 5 products returned at a time
  398.  
  399. <ul>
  400. <li>viewing_user* (int) - id of the users making the call</li>
  401. </ul>
  402.  
  403. + Header
  404. auth
  405. + Request (application/x-www-form-urlencoded)
  406. viewing_user=1
  407.  
  408. + Response 200 (application/json)
  409. {
  410. "result": true,
  411. "product": [
  412. {
  413. "id": 1,
  414. "name": "string",
  415. "description": "string",
  416. "avatar": "http://google.co.uk",
  417. "price": "1.00",
  418. "product_link": "http://google.co.uk",
  419. "preference": "boy",
  420. "style": "1"
  421. }
  422. ]
  423. }
  424. + Response 401 (application/json)
  425.  
  426. {
  427. "result": false,
  428. "message": "post paramater(s) missing"
  429. }
  430.  
  431. ## View products in Category [/product/?view_in_category]
  432.  
  433. ### View products in Category [POST]
  434.  
  435. 5 products returned at a time
  436.  
  437. <ul>
  438. <li>viewing_user* (int) - id of the users making the call</li>
  439. <li>cat_id* (int) - id of the category</li>
  440. <li>page (int) - page number to view, if none past page 1 returned</li>
  441. </ul>
  442.  
  443. + Header
  444. auth
  445. + Request (application/x-www-form-urlencoded)
  446. viewing_user=1&cat_id=1&page=1
  447.  
  448. + Response 200 (application/json)
  449. {
  450. "result": true,
  451. "page": 1,
  452. "products": [
  453. {
  454. "id": 1,
  455. "name": "string",
  456. "description": "string",
  457. "avatar": "http://google.co.uk",
  458. "price": "1.00",
  459. "product_link": "http://google.co.uk",
  460. "preference": "boy",
  461. "style": "1"
  462. }
  463. ]
  464. }
  465. + Response 401 (application/json)
  466.  
  467. {
  468. "result": false,
  469. "message": "post paramater(s) missing"
  470. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement