# Apollo ## 登入 ## request path: https://auth.mayohr.com/token ``` { ".expires": "Wed, 08 Jul 2020 03:34:08 GMT", ".issued": "Fri, 03 Jul 2020 03:34:08 GMT", "SelectCompanyRequired": false, "UserStatus": 1, "access_token": "{token}", "code": "9c884a61aed6429aa6ff41b947414d1e", "expires_in": 431999, "refresh_expire": "2020-07-08T17:58:08+00:00", "refresh_token": "{token}", "token_type": "bearer", "userName": "{name}" "JobInfo": "[{\"CompanyId\":\"\",\"EmployeeId\":\"\",\"CompanyLogoPath\":\"\",\"CompanyName\":\"\",\"EmployeeName\":\"\"}]", } ``` ## 打卡 ## request path: https://pt.mayohr.com/api/checkin/punch/locate ``` // request header :authority: pt.mayohr.com accept: */* content-type: application/x-www-form-urlencoded authorization: {token} content-length: 175 user-agent: Apollo HR XE/3.0.41 (iPhone; iOS 13.3; Scale/2.00) accept-language: zh-tw accept-encoding: gzip, deflate, br cookie: _gm_lc=AwcCAwkBBAkCBAIGAgMBAAQDGAEEAAwPUABQHAQJDAAYAAUAAR0NAQFWGAQCBgRZAAQBUAZSUA%3d%3d ``` ```jsonld= // request body { "AttendanceType": 2 "IdentifyCode": "EBA34C9A-A669-47D8-A4EE-C494F8D80E4A" "Latitude": 25.03372 "LocationDetails": "" "Longitude": 121.5648 "PunchesLocationId": "3dc56752-8f13-45d9-9e7e-509ef9e3e531" } ``` ``` response { "Data": { "AttendanceHistoryId": "34ce05a8-561e-4768-b6ee-1b3aa0806079", "LocationName": "思華大門", "Note": "", "punchDate": "2020-07-03T10:33:54+00:00" }, "Meta": { "HttpStatusCode": "200" } } ``` ## 真登入 ## request path: authcommon.mayohr.com /api/auth/checkticket ``` query string code: {code} // 從上面那隻拿 response_type: id_token // 固定的 CompanyId: {company id} // 從上面那隻拿 ``` ## refresh token ## request path: https://authcommon.mayohr.com/api/auth/refreshtoken?response_type=id_token ``` header 記得帶token ``` ``` { "apphash": "1c0091b409062359a7f35babd13ac3e6", "id_token": "{token}" } ```