Url:
https://api.oto.dvg-lc.com/token
=> Trả về mã token dành cho các request bên dưới
INPUT:
Đăng nhập bằng tài khoản
{ "grant_type":"password", "UserName":"String content", "Password":"String content", "client_id":"String content", "client_secret" : "String content" "deviceInfo": "String content", "deviceToken": "String content", "tokenFirebase" : "string content" }
Đăng nhập bằng facebook
{ "grant_type":"password", "accesstoken":"access_token", "socialtype":"String content", "client_id":"String content", "client_secret" : "String content" "deviceInfo": "String content", "deviceToken": "String content", "tokenFirebase" : "string content" }
Đăng nhập bằng google oauth2
{ "grant_type":"password", "accesstoken":"id_token", "socialtype":"String content", "client_id":"String content", "client_secret" : "String content" "deviceInfo": "String content", "deviceToken": "String content", "tokenFirebase" : "string content" }
OUTPUT Sample:
{ "access_token": "brHTS_djs9oC9Wntt_qF-iHiBMdimnd5hDUU2folF5OypO7rSv4fXeBw1UPMg9SobyreRKvOham1hM4XVSYL2do-a-hEpu6ixaeRf09QfEIQNVJdoo6UnpUdvTGGY3DPXIobeRUL3I3kPPy6-ZkO5wje9PrlwezktDmI1Cfsoyz8DmkSwoEX0t-9LSxvAW8gSH8r_iE9V5YrBh9RXpk3LOzzD3atFQa88z0eBr2DDUFQsWOwK3ZghWsvlvorK_QHdrJ0Xuwb3VTvgEjxA92T389Q3l7Pom6R0_88mQVe6_JteW1-7bWG4hxeycSs8elWnO-YzksSErF1GlkFrVsYDCfrOFyc173HB8hfKnK3FvE", "token_type": "bearer", "expires_in": 1799, "refresh_token": "c4874e5bec8d447ba8ed77472653ea29", "as:client_id": "2039457982374", "userName": "vinhph@banxehoi.com.vn", ".issued": "Sat, 16 Mar 2019 08:14:19 GMT", ".expires": "Sat, 16 Mar 2019 08:44:19 GMT" }
Url:
https://api.oto.dvg-lc.com/token
=> Trả về mã token dành cho các request bên dưới
INPUT:
Header: TOKEN : "String content" Body: { "grant_type":"refresh_token", "refresh_token":"String content", "client_id":"String content", "client_secret":"String content" }
OUTPUT sample:
{ "access_token": "AHj6iF_P01F9GbMrEl-h36Nbo6ybc4yx5cZeHJ3eT9pn2ugqJkNAA3dMYyGb3eapiv3mlSwQtyY5K4SKmGedfH0ZxqFZt_rwrrD9sSxj1CoxjzIB1OslokcvU8R-_tSTGMjCQG7AKMcJcjCB5mhrCwWg0_fJsT1CVLo7Fysy5lNW1AuSg3BgKG26iGU1f263fIMojpFpZm91zPI4iHHGSv88JES4QGKBeT6waReNvLXyAStqzdEdm3gt8U5W7YHyqDcfbyS5IwtGI2rL8RZo62XQfTUzC_dqdKoJ2GseAxr0QL-mZM1QrmAkQ-AVWUet1q-ttwf5TtAJI901uiGc5DnKMsRYlGaqDB9zPoT1LEues0INRwddnNbdIMG0x-js", "token_type": "bearer", "expires_in": 1799, "refresh_token": "bd308bf177b4457b8d1066e5671b3695", "as:client_id": "2039457982374", "userName": "vinhph@banxehoi.com.vn", ".issued": "Tue, 19 Mar 2019 03:45:13 GMT", ".expires": "Tue, 19 Mar 2019 04:15:13 GMT" }
=> Các function cần user đăng nhập sẽ phải request kèm token trong header
VD:
Header: Authorization : "Bearer" + access_token { Authorization : "Bearer YIp-crwbQmQ-Wq8jvl3Gbag8FPExFxp0yPIS7w2MPhGm_qeCVZdGKgGZJdnn7ZiUwXRT4TvEIBrJf6KzK6GrMhaLu54obXxXS-7ltMN7-nVy4OYv4NcHhjDZVC9hIqxaYPjbIIVXgZH_HODNpWUhM7Ok1T2imWLN3LOkjVDbgZ5SgkaSf1G3et3F-sSWdD0KUg2RwW-f11lA2HGdD7bGs3jxgDMvLwkoR6AEQVsHh7bGaJ27oLcQrOasCJiNuy7bJATfcdCwW-ZlpOHchjiNwTE3RbMsQ6CTnB9HyORZhwxJja6HOfsqowsnMCQnOXGe7qhGbB1ryoJdJf58jq2r3fPtmGtO7_3VrFeSsK9lyWY" }