|
| 1 | +## User API Documentation |
| 2 | + |
| 3 | +- [Get Product Detail](#get-product) |
| 4 | + + [Resource URL](#get-product-url) |
| 5 | + + [Parameters](#get-product-param) |
| 6 | + + [Sample Request](#get-product-request) |
| 7 | + + [Sample Response](#get-product-response) |
| 8 | +- [Get Product by User](#get-product-user) |
| 9 | + + [Resource URL](#get-product-user-url) |
| 10 | + + [Parameters](#get-product-user-param) |
| 11 | + + [Sample Request](#get-product-user-request) |
| 12 | + + [Sample Response](#get-product-user-response) |
| 13 | +- [Add Product](#add-product) |
| 14 | + + [Resource URL](#add-product-url) |
| 15 | + + [Parameters](#add-product-param) |
| 16 | + + [Sample Request](#add-product-request) |
| 17 | + + [Sample Response](#add-product-response) |
| 18 | +- [Edit Product](#edit-product) |
| 19 | + + [Resource URL](#edit-product-url) |
| 20 | + + [Parameters](#edit-product-param) |
| 21 | + + [Sample Request](#edit-product-request) |
| 22 | + + [Sample Response](#edit-product-response) |
| 23 | + |
| 24 | + |
| 25 | +#### <a name="get-product-detail"></a> `🔒` `GET` Get Product Detail |
| 26 | +Get detail product |
| 27 | + |
| 28 | +##### <a name="get-product-detail-url"></a> Resource URL |
| 29 | +/api/v2/product/get_product_detail |
| 30 | + |
| 31 | +##### <a name="get-product-detail-param"></a> Parameters |
| 32 | ++ `id_product` ___`required`___ ID of product. |
| 33 | + |
| 34 | +##### <a name="get-product-detail-request"></a>Sample Request |
| 35 | +````sh |
| 36 | +curl -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/product/get_product_detail?id_product=1932 |
| 37 | +```` |
| 38 | + |
| 39 | +##### <a name="get-product-detail-response"></a>Sample Response |
| 40 | + |
| 41 | +````json |
| 42 | +{ |
| 43 | + "status": 1, |
| 44 | + "product": { |
| 45 | + "id_product": "1929", |
| 46 | + "prod_title": "tes", |
| 47 | + "prod_desc": "Tes", |
| 48 | + "prod_price": "123", |
| 49 | + "prod_curr": "IDR", |
| 50 | + "prod_order": "", |
| 51 | + "prod_status": "0", |
| 52 | + "prod_share": null, |
| 53 | + "prod_image": "1929.jpg", |
| 54 | + "prod_tag": "tes, tesx", |
| 55 | + "prod_stock": "1", |
| 56 | + "langitude": null, |
| 57 | + "longitude": null, |
| 58 | + "id_user": "667", |
| 59 | + "prod_time": "2014-01-13 16:12:11", |
| 60 | + "fb_post": null, |
| 61 | + "hubmeup_link": "http://www.hubmeup.com/tes-102/", |
| 62 | + "from_app": null, |
| 63 | + "id_supercat": "1", |
| 64 | + "id_superloc": "11", |
| 65 | + "discount": "0", |
| 66 | + "view_count": "0", |
| 67 | + "is_nego": "0", |
| 68 | + "image_migrate": "0", |
| 69 | + "condition": "new", |
| 70 | + "shoop_count": "0", |
| 71 | + "comment_count": "0", |
| 72 | + "supercat": { |
| 73 | + "idsc": "1", |
| 74 | + "name": "Perlengkapan Olahraga" |
| 75 | + }, |
| 76 | + "superloc": { |
| 77 | + "idsl": "11", |
| 78 | + "name": "Jawa Tengah" |
| 79 | + }, |
| 80 | + "comment_status": 0, |
| 81 | + "shoop_status": 0, |
| 82 | + "tag": [ |
| 83 | + { |
| 84 | + "id_tag": "143", |
| 85 | + "tag": "tes" |
| 86 | + }, |
| 87 | + { |
| 88 | + "id_tag": "178", |
| 89 | + "tag": "tesx" |
| 90 | + } |
| 91 | + ], |
| 92 | + "image": [ |
| 93 | + { |
| 94 | + "id_image": "88", |
| 95 | + "product_image": "1929_1389604315.jpg" |
| 96 | + } |
| 97 | + ], |
| 98 | + "user": { |
| 99 | + "id_user": "667", |
| 100 | + "name": "afiev", |
| 101 | + "address": "yoyoyoyo", |
| 102 | + "email": "afiev@firzil.co.id", |
| 103 | + "phone": "1233232323", |
| 104 | + "city": null, |
| 105 | + "country": "heheheh", |
| 106 | + "avatar": "2014-01-1390193388912.jpg", |
| 107 | + "buyer_poin": "0", |
| 108 | + "seller_poin": "0", |
| 109 | + "id_location": "12", |
| 110 | + "follow": { |
| 111 | + "following": 15, |
| 112 | + "follower": 19 |
| 113 | + }, |
| 114 | + "product_count": { |
| 115 | + "all": 171, |
| 116 | + "active": 0 |
| 117 | + } |
| 118 | + }, |
| 119 | + "link": [ |
| 120 | + { |
| 121 | + "store_name": "Blogger fir", |
| 122 | + "id_platform": "13", |
| 123 | + "platform_name": "Blogger", |
| 124 | + "status": "2", |
| 125 | + "link": null |
| 126 | + }, |
| 127 | + { |
| 128 | + "store_name": "Facebook", |
| 129 | + "id_platform": "10", |
| 130 | + "platform_name": "Facebook", |
| 131 | + "status": "1", |
| 132 | + "link": "http://www.facebook.com/10201354019279997#,#http://www.facebook.com/10201354019640006" |
| 133 | + } |
| 134 | + ] |
| 135 | + } |
| 136 | +} |
| 137 | +```` |
| 138 | + |
| 139 | +#### <a name="get-product-user"></a> `🔒` `GET` Get Product User |
| 140 | +Get product that uploaded and liked active user |
| 141 | + |
| 142 | +##### <a name="get-product-user-url"></a> Resource URL |
| 143 | +/api/v2/product/get_product_user |
| 144 | + |
| 145 | +##### <a name="get-product-user-param"></a> Parameters |
| 146 | ++ `id_user` ___`required`___ ID of user. If empty, will use default: <code>active user</code> |
| 147 | ++ `limit` _`optional`_ Limit for browse. Default <code>6</code> |
| 148 | ++ `offset` _`optional`_ Limit for browse. Default <code>1</code> |
| 149 | ++ `keyword` _`optional`_ Search key |
| 150 | ++ `id_supercat` _`optional`_ Location ID |
| 151 | ++ `id_superloc` _`optional`_ Category ID |
| 152 | ++ `tag` _`optional`_ Tag filter |
| 153 | ++ `filter` _`optional`_ filter for browse, enum <code>all</all> or <code>own</code>. Default <code>all</code> |
| 154 | ++ `last_time` _`optional`_ Browse from last_time |
| 155 | ++ `sort` _`optional`_ Sort product, enum <code>time</code> <code>popular</code> <code>comment</code> <code>price</code> <code>stock</code>. Default <code>time</code> |
| 156 | ++ `direction` _`optional`_ Direction of sort. enum <code>desc</code> or <code>asc</code>. Default <code>desc</code> |
| 157 | + |
| 158 | +##### <a name="get-product-user-request"></a>Sample Request |
| 159 | +````sh |
| 160 | +curl -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/product/get_product_user?limit=2 |
| 161 | +```` |
| 162 | + |
| 163 | +##### <a name="get-product-user-response"></a>Sample Response |
| 164 | + |
| 165 | +````json |
| 166 | +{ |
| 167 | + "status": 1, |
| 168 | + "limit": "2", |
| 169 | + "offset": 1, |
| 170 | + "count": 1191, |
| 171 | + "product": [ |
| 172 | + { |
| 173 | + "id_product": "1931", |
| 174 | + "prod_title": "laptop compaq", |
| 175 | + "prod_price": "2500000", |
| 176 | + "prod_curr": "IDR", |
| 177 | + "discount": null, |
| 178 | + "view_count": null, |
| 179 | + "prod_stock": "1", |
| 180 | + "id_user": "461", |
| 181 | + "shoop_count": "0", |
| 182 | + "comment_count": "0", |
| 183 | + "comment_status": 0, |
| 184 | + "shoop_status": 0, |
| 185 | + "user": { |
| 186 | + "id_user": "461", |
| 187 | + "name": "Akuikialieeeeee", |
| 188 | + "address": "Surabaya", |
| 189 | + "email": "ali@firzil.co.id", |
| 190 | + "phone": "+6285730432092", |
| 191 | + "city": null, |
| 192 | + "country": "83", |
| 193 | + "avatar": "461.jpg", |
| 194 | + "buyer_poin": "0", |
| 195 | + "seller_poin": "0", |
| 196 | + "id_location": null |
| 197 | + }, |
| 198 | + "tag": [ |
| 199 | + { |
| 200 | + "id_tag": "180", |
| 201 | + "tag": "shoop" |
| 202 | + } |
| 203 | + ], |
| 204 | + "image": [] |
| 205 | + }, |
| 206 | + { |
| 207 | + "id_product": "1929", |
| 208 | + "prod_title": "tes", |
| 209 | + "prod_price": "123", |
| 210 | + "prod_curr": "IDR", |
| 211 | + "discount": null, |
| 212 | + "view_count": null, |
| 213 | + "prod_stock": "1", |
| 214 | + "id_user": "667", |
| 215 | + "shoop_count": "0", |
| 216 | + "comment_count": "0", |
| 217 | + "comment_status": 0, |
| 218 | + "shoop_status": 0, |
| 219 | + "user": { |
| 220 | + "id_user": "667", |
| 221 | + "name": "afiev", |
| 222 | + "address": "yoyoyoyo", |
| 223 | + "email": "afiev@firzil.co.id", |
| 224 | + "phone": "1233232323", |
| 225 | + "city": null, |
| 226 | + "country": "heheheh", |
| 227 | + "avatar": "2014-01-1390193388912.jpg", |
| 228 | + "buyer_poin": "0", |
| 229 | + "seller_poin": "0", |
| 230 | + "id_location": "12" |
| 231 | + }, |
| 232 | + "tag": [ |
| 233 | + { |
| 234 | + "id_tag": "143", |
| 235 | + "tag": "tes" |
| 236 | + }, |
| 237 | + { |
| 238 | + "id_tag": "178", |
| 239 | + "tag": "tesx" |
| 240 | + } |
| 241 | + ], |
| 242 | + "image": [ |
| 243 | + { |
| 244 | + "id_image": "88", |
| 245 | + "product_image": "1929_1389604315.jpg" |
| 246 | + } |
| 247 | + ] |
| 248 | + } |
| 249 | + ] |
| 250 | +} |
| 251 | +```` |
| 252 | + |
| 253 | +#### <a name="add-product"></a> `🔒` `POST` Add Product |
| 254 | +Add Product |
| 255 | + |
| 256 | +##### <a name="add-product-url"></a> Resource URL |
| 257 | +/api/v2/product/add_product |
| 258 | + |
| 259 | +##### <a name="add-product-param"></a> Parameters |
| 260 | ++ `id_user` ___`required`___ ID User from user which request. |
| 261 | ++ `prod_name` ___`required`___ |
| 262 | ++ `prod_price` ___`required`___ |
| 263 | ++ `prod_curr` ___`required`___ |
| 264 | ++ `prod_tag` ___`required`___ pisah dengan <code>,</code> |
| 265 | ++ `prod_desc` ___`required`___ |
| 266 | ++ `id_supercat` ___`required`___ |
| 267 | ++ `id_superloc` ___`required`___ |
| 268 | ++ `condition` _`optional`_ |
| 269 | ++ `is_nego` _`optional`_ |
| 270 | ++ `discount` _`optional`_ |
| 271 | ++ `prod_image` _`optional`_ array Product Image. |
| 272 | ++ `from_app` _`optional`_ |
| 273 | + |
| 274 | +##### <a name="add-product-request"></a>Sample Request |
| 275 | +````sh |
| 276 | +curl -X POST --data "prod_title=Baju&prod_price=15000&prod_curr=IDR&prod_desc=just_test&id_supercat=1&id_superloc=1" -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/user/add_product |
| 277 | +```` |
| 278 | + |
| 279 | +##### <a name="add-product-response"></a>Sample Response |
| 280 | + |
| 281 | +````json |
| 282 | +{ |
| 283 | + "status": 1, |
| 284 | + "product": { |
| 285 | + "id_product": "1937", |
| 286 | + "prod_title": "Baju", |
| 287 | + "prod_desc": "just test", |
| 288 | + "prod_price": "150000", |
| 289 | + "prod_curr": "IDR", |
| 290 | + "prod_order": null, |
| 291 | + "prod_status": "0", |
| 292 | + "prod_share": null, |
| 293 | + "prod_image": null, |
| 294 | + "prod_tag": null, |
| 295 | + "prod_stock": "1", |
| 296 | + "langitude": null, |
| 297 | + "longitude": null, |
| 298 | + "id_user": "2", |
| 299 | + "prod_time": "2014-02-01 11:40:58", |
| 300 | + "fb_post": null, |
| 301 | + "hubmeup_link": null, |
| 302 | + "from_app": null, |
| 303 | + "id_supercat": "1", |
| 304 | + "id_superloc": "1", |
| 305 | + "discount": "0", |
| 306 | + "view_count": "0", |
| 307 | + "is_nego": "0", |
| 308 | + "image_migrate": "0", |
| 309 | + "condition": "new", |
| 310 | + "shoop_count": "0", |
| 311 | + "comment_count": "0", |
| 312 | + "supercat": { |
| 313 | + "idsc": "1", |
| 314 | + "name": "Perlengkapan Olahraga" |
| 315 | + }, |
| 316 | + "superloc": { |
| 317 | + "idsl": "1", |
| 318 | + "name": "Jawa Timur" |
| 319 | + } |
| 320 | + } |
| 321 | +} |
| 322 | +```` |
| 323 | + |
| 324 | +#### <a name="edit-product"></a> `🔒` `POST` Edit User <code>Not Finished Yet</code> |
| 325 | +Edit active user |
| 326 | + |
| 327 | +##### <a name="edit-product-url"></a> Resource URL |
| 328 | +/api/v2/user/edit_user |
| 329 | + |
| 330 | +##### <a name="edit-product-param"></a> Parameters |
| 331 | ++ `name` _`optional`_ The name of the user. |
| 332 | ++ `gcm_id` _`optional`_ |
| 333 | ++ `address` _`optional`_ |
| 334 | ++ `id_location` _`optional`_ |
| 335 | ++ `phone` _`optional`_ |
| 336 | ++ `is_sundul` _`optional`_ |
| 337 | ++ `tw_token` _`optional`_ |
| 338 | ++ `tw_secret` _`optional`_ |
| 339 | ++ `avatar` _`optional`_ |
| 340 | ++ `fb_token` _`optional`_ |
| 341 | ++ `fb_uid` _`optional`_ |
| 342 | ++ `fb_token_expired` _`optional`_ |
| 343 | ++ `latitude` _`optional`_ |
| 344 | ++ `longitude` _`optional`_ |
| 345 | + |
| 346 | + |
| 347 | +##### <a name="edit-product-request"></a>Sample Request |
| 348 | +````sh |
| 349 | +curl -X POST --data "name=hayashi" -H "X-API-KEY: 4974328ce522a3eb86ecf73a193490314cf98c74" http://shoop.dev/api/v2/user/edit_user |
| 350 | +```` |
| 351 | + |
| 352 | +##### <a name="edit-product-response"></a>Sample Response |
| 353 | + |
| 354 | +````json |
| 355 | +{ |
| 356 | + "user": { |
| 357 | + "id_user": "2", |
| 358 | + "name": "hayashi", |
| 359 | + "email": "shcode@ymail.com", |
| 360 | + "phone": "+6283857723355", |
| 361 | + "birthdate": "1986-12-15", |
| 362 | + "username": "shcode", |
| 363 | + "address": "Jl. Merak No. 10 Surabaya", |
| 364 | + "city": "Surabaya", |
| 365 | + "country": "Indonesia", |
| 366 | + "bio": null, |
| 367 | + "avatar": "hohoho", |
| 368 | + "type": "2", |
| 369 | + "fb_token": "", |
| 370 | + "fb_token_expired": null, |
| 371 | + "tw_token": "218307206-cTmwJ7vAijoufjtbQzVvowImzP9jq2WUbADcFtnc", |
| 372 | + "tw_secret": "SHhfmg4jmiBEwO0EFBIMCaaI4V2hArJyI5vKnl4aq5Y", |
| 373 | + "album_id": "4222704171637", |
| 374 | + "show_phone": "1", |
| 375 | + "gcm_id": null, |
| 376 | + "updated": "1", |
| 377 | + "fb_uid": "null", |
| 378 | + "joined_date": "2013-04-01 11:00:00", |
| 379 | + "premium_end": "2013-10-15 00:47:55", |
| 380 | + "id_key": "2", |
| 381 | + "last_activity": null, |
| 382 | + "buyer_poin": "0", |
| 383 | + "seller_poin": "0", |
| 384 | + "is_trusted": "0", |
| 385 | + "is_premium": "1", |
| 386 | + "id_location": null |
| 387 | + }, |
| 388 | + "product_count": { |
| 389 | + "all": 54, |
| 390 | + "active": 0 |
| 391 | + }, |
| 392 | + "follow": { |
| 393 | + "following": 0, |
| 394 | + "follower": 0 |
| 395 | + }, |
| 396 | + "status": 1 |
| 397 | +} |
| 398 | +```` |
0 commit comments