Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.52 KB | None | 0 0
  1. Get profile data
  2. This method is used for the user want to get all information
  3. API Path
  4. Endpoint
  5. Method
  6. /customer/{version}/customers/{customerId} GET
  7.  
  8. Parameters
  9. Description
  10. Parameter
  11. Type
  12. Mandatory
  13. Notes
  14. accessToken String x Include in header
  15. customerId Number x Path (id of customer)
  16. Example
  17. GET /customer/v1/customers/342345
  18. Response
  19. Description
  20. Response
  21. Type
  22. Notes
  23. <top_level> Customer
  24. Example
  25. {
  26. "id": 342345,
  27. "loginType": "EMAIL",
  28. "email": "leduchieu02@gmail.com",
  29. "password": null,
  30. "accessToken": "2eca82f2-a5e6-4f23-80c6-8fcd54ea4416",
  31. "expireDate": [2018, 1, 12, 16, 58, 24, 367000000],
  32. "activate": true,
  33. "accessTokenEmail": "4d5562f9-0a41-4532-8b4a-39b6e12da597",
  34. "expireDateEmail": [2017, 1, 13, 16, 40, 34, 406000000],
  35. "firstName": null,
  36. "lastName": null,
  37. "socialNetwork": {
  38. "socialId": null,
  39. "socialToken": null,
  40. "profilePictureUrl": null
  41. },
  42. "fiscalCode": null,
  43. "phoneNumber": "+84901876372",
  44. "optinMarketing": false,
  45. "optinThirdParty": false,
  46. "optinProfiling": false,
  47. "contactInfos": [
  48. {
  49. "id": 45,
  50. "email": "test1@gmail.com",
  51. "phoneNumber": "+3325658878"
  52. },
  53. {
  54. "id": 46,
  55. "email": "test2@gmail.com",
  56. "phoneNumber": "+3325634778"
  57. }
  58. ],
  59. "vehicles": [
  60. {
  61. "id": 56,
  62. "name": "KIA Rio2",
  63. "plateNumber": "KZ-2809",
  64. "model": "KIA",
  65. "make": "Rio",
  66. "details": "1.6 TDCi DPF SW 5p/d/1560cc",
  67. "modelYear": 2017
  68. },
  69. {
  70. "id": 57,
  71. "name": "KIA Rio3",
  72. "plateNumber": "KZ-2809",
  73. "model": "KIA",
  74. "made": "Rio",
  75. "details": "1.6 TDCi DPF SW 5p/d/1560cc",
  76. "modelYear": 2014
  77. }
  78. ],
  79. "locationInfos": [
  80. {
  81. "id": 78,
  82. "name": "Home",
  83. "address": "Neon Street, 34",
  84. "postalCode": "80001",
  85. "latitude": 48.209,
  86. "longitude": 15.23568795
  87. },
  88. {
  89. "id": 79,
  90. "name": "Company",
  91. "address": "Neon Street, 34",
  92. "postalCode": "80001",
  93. "latitude": 48.209,
  94. "longitude": 15.23568795
  95. }
  96. ]
  97. }
  98. Error example
  99. {
  100. "code":"ERR_CUS_000"
  101. }
  102. Available Status
  103. Code
  104. Note
  105. 200 User found
  106. 404 User not found
  107. 400 missing param, wrong param, etc...
  108. Operation rules
  109. Operation rules
  110. Description
  111. Internal Error Code
  112. Error Description
  113.  
  114.  
  115.  
  116. Change password
  117. This method is used for user want to change his/her password.
  118. API Path
  119. Endpoint
  120. Method
  121. /customer/{version}/customers/{customerId}/changePassword POST
  122. Parameters
  123. Parameter
  124. Type
  125. Mandatory
  126. Notes
  127. accessToken String x Include in header
  128. customerId Number x Path (Id of customer)
  129. oldPassword String x Body
  130. newPassword String x Body
  131. Body example
  132. {
  133. "oldPassword": "old_password",
  134. "newPassword": "new_password"
  135. }
  136. Update general information of customer
  137. This method is used for the user want to update his/her profile (name, phone,...)
  138. API Path
  139. Endpoint
  140. Method
  141. /customer/{version}/customers/{customerId}/general POST
  142. Path example
  143. /customer/v1/customers/5678/general
  144. Parameters
  145. Description
  146. Parameter
  147. Type
  148. Mandatory
  149. Notes
  150. accessToken String x Include in header
  151. customerId Number x Path (id of customer)
  152. lastName String x Body
  153. firstName String x Body
  154. email String x Body
  155. phoneNumber String x Body
  156. Body Example
  157. {
  158. "lastName": "My last name",
  159. "firstName": "My first name",
  160. "email": "my email",
  161. "phoneNumber": "+3365464646"
  162. }
  163. Response
  164. Description
  165. Response
  166. Type
  167. Notes
  168.  
  169. Example
  170.  
  171. Error example
  172. {
  173. "code":"ERR_CUS_000"
  174. }
  175. Available Status
  176. HTTP Code
  177. Meaning
  178. 200 OK
  179. 201 Created
  180. 401 Unauthorized
  181. 403 Forbidden
  182. 404 User not found
  183. 400
  184. Bad request
  185.  
  186. Operation rules
  187. Operation rules
  188. Description
  189. Internal Error Code
  190. Error Description
  191.  
  192.  
  193. Update contact
  194. This method allow user update his/her another contact.
  195. API Path
  196. Endpoint
  197. Method
  198. /customer/{version}/customers/{customerId}/contatcs/{contactId} POST
  199.  
  200. Parameters
  201. Description
  202. Parameter
  203. Type
  204. Mandatory
  205. Notes
  206. accessToken String x Include in header
  207. customerId Number x Path (id of customer)
  208. contactId Number x Path (id of contact)
  209. email String x Body
  210. phoneNumber String x Body
  211. Body Example
  212. {
  213. "email": "My email",
  214. "phoneNumber": "+33454545454"
  215. }
  216. Response
  217. N/A
  218. Available Status
  219. HTTP Code
  220. Meaning
  221. 200 OK
  222. 400
  223. Bad request
  224. 401 Unauthorized
  225.  
  226. Operation rules
  227. Operation rules
  228. Description
  229. Internal Error Code
  230. Error Description
  231.  
  232. Update location
  233. This method allow user update his/her location
  234. API Path
  235. Endpoint
  236. Method
  237. /customer/{version}/customers/{id}/locations/{locationId} POST
  238. Parameters
  239. Description
  240. Parameter
  241. Type
  242. Mandatory
  243. Notes
  244. accessToken String x Include in header
  245. customerId Number x Path (id of customer)
  246. locationId Number x Path (id of location)
  247. name String x Body
  248. address String x Body
  249. postalCode String x Body
  250. latitude Number x Body
  251. longitude Number x Body
  252. Example
  253. {
  254. "name": "My Home",
  255. "address": "Lottery Tower - 77 Tran Nhan Ton",
  256. "postalCode": "80010",
  257. "latitude": 45.2356485,
  258. "longitude": 75.3664545665
  259. }
  260. Response
  261. N/A
  262. Available Status
  263. HTTP Code
  264. Meaning
  265. 200 OK
  266. 401 Unauthorized
  267. 403 Forbidden
  268. 404 User not found
  269. 400
  270. Bad request
  271. Operation rules
  272. Operation rules
  273. Description
  274. Internal Error Code
  275. Error Description
  276.  
  277. Update vehicle information
  278. This method allow user update his/her vehicle information
  279. API Path
  280. Endpoint
  281. Method
  282. /customer/{version}/customers/{id}/vehicles/{vehicleId} POST
  283.  
  284. Parameters
  285. Description
  286. Parameter
  287. Type
  288. Mandatory
  289. Notes
  290. accessToken String x Include in header
  291. customerId Number x Path (id of customer)
  292. vehicleId Number x Path (id of vehicle)
  293. name String x Body
  294. Example
  295. {
  296. "name": "My Civic"
  297. }
  298. Response
  299. Description
  300. N/A
  301. Example
  302. N/A
  303. Available Status
  304. HTTP Code
  305. Meaning
  306. 200 OK
  307. 401 Unauthorized
  308. 403 Forbidden
  309. 404 User not found
  310. 400
  311. Bad request
  312. Operation rules
  313. Operation rules
  314. Description
  315. Internal Error Code
  316. Error Description
  317.  
  318.  
  319. Add new contact
  320. This method allow create new contact
  321. API Path
  322. Endpoint
  323. Method
  324. /customer/{version}/customers/{customerId}/contacts POST
  325. Parameters
  326. Description
  327. Parameter
  328. Type
  329. Mandatory
  330. Notes
  331. accessToken String x Include in header
  332. customerId Number x Path (id of customer)
  333. email String x Body
  334. phoneNumber String x Body
  335. Body Example
  336. {
  337. "email": "My email",
  338. "phoneNumber": "+33454545454"
  339. }
  340. Available Status
  341. HTTP Code
  342. Meaning
  343. 200 OK
  344. 401 Unauthorized
  345. 403 Forbidden
  346. 404 User not found
  347. 400
  348. Bad request
  349. Operation rules
  350. Operation rules
  351. Description
  352. Internal Error Code
  353. Error Description
  354.  
  355.  
  356. Add new vehicle
  357. This method allow user create new vehicle
  358. API Path
  359. Endpoint Method
  360. /customer/{version}/customers/{customerId}/vehicles POST
  361. Parameters
  362. Description
  363. Parameter Type Mandatory Notes
  364. accessToken String x Include in header
  365. customerId Number x Path (id of customer)
  366. name String x Body
  367. model String x Body
  368. modelYear Number x Body
  369. plateNumber String x Body
  370. details String x Body
  371. Example
  372. {
  373. "name": "My Civic",
  374. "model": "CIVIC",
  375. "make": "HONDA",
  376. "modelYear": 2017,
  377. "plateNumber": "93T1-3332",
  378. "details": "Car's details here"
  379. }
  380. Add new location
  381. This method allow user create new location
  382. API Path
  383. Endpoint Method
  384. /customer/{version}/customers/{customerId}/locations POST
  385. Parameters
  386. Description
  387. Parameter Type Mandatory Notes
  388. accessToken String x Include in header
  389. customerId Number x Path (id of customer)
  390. name String x Body
  391. address String x Body
  392. postalCode String x Body
  393. latitude Number x Body
  394. longitude Number x Body
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement