## Contents * [Docs](https://gist.github.com/blha303/101e0db0bf63ea07b1f55862947c9065#file-docs-md) * [Setting up capture process](https://gist.github.com/blha303/101e0db0bf63ea07b1f55862947c9065#file-revlis-md) * [Automatically generated API documentation (inaccurate)](https://gist.github.com/blha303/101e0db0bf63ea07b1f55862947c9065#file-zgenerateddocs-md) * [Script to generate API documentation](https://gist.github.com/blha303/101e0db0bf63ea07b1f55862947c9065#file-zgeneratedocs-py) In the below documentation, all requests return `{ "d": something }` (except the ones that don't), so everything outside of `something` will be omitted. Necessary headers for each request (may vary, untested): * `Accept: application/json`, otherwise the API returns XML (obviously if you're fine with that you can omit this) * `OS-AuthProvider: 6`, unsure of the purpose of this * `OS-AuthTicketData: [string]`, begins with CAEQ on my copy of the game, unsure if variable * `OS-AuthTicketSize: 44`, the length of the above string * `OS-UID: [string]`, steam user ID, or some other form of identification in standalone versions probably * `OS-Platform: steam`, the user's platform, needs more testing to get options * `OS-System: linux`, ditto Optional headers: * `DataServiceVersion: 2.0` * `MaxDataServiceVersion: 2.0` * `OS-Age: 0` * `OS-Build: localBuild` * `OS-GTime: 84` * `OS-Locale: en,XX,XX,` * `OS-MAC: xx-xx-xx-xx-xx-xx` * `OS-OSVersion: 5.0.22.82369`, unsure what this is, it's not kernel version * `OS-PID: LiS-v1.0.0.397609` * `OS-Progress: 0.00000000000000000`, lol * `OS-SID: [uuid]` * `OS-STime: 5713` * `OS-XYZ: 135.95315551757812500,-130.51196289062500000,97.04180908203125000` * `OS-Zone: E0_Menu`, the game seems to send ingame location with every request ### On game start The game sends several requests in the opening videos. 1. `/game/os_Ping` * Likely confirming that the service is up * Returns `{"os_Ping": 6739}`, different number each time 2. `/game/os_GetServiceInfo` * Returns information about the IP address used for connection and a list of metadata and endpoints. * Example output: https://gist.github.com/blha303/8c5b925f95c23c08197ac3a82e1bee15 3. `/game/os_Ping` again 4. `/game/SEM_Login` * Probably for the Square Enix account login * Query params: `s_type` is 'UID' here; `s_value` is my steam user ID, a long string of digits * Returns `{ "SEM_Login": { "__metadata": { "type": "game.SEMSubmit" }, "b_confirmed": true, "s_SEMID": "string of numbers", "s_email": "email address", "s_facebookID": "probably facebook user identifier", "s_longTermToken": "string of numbers and letters" } }` 5. It sends the above request twice, unclear why 6. `/game/CreateUserProfile` * Square Enix login again? Probably making sure that there's an account for the given steam ID for stats collection even if it isn't linked to a SEM account * Query params: `s_uid` is my steam user ID * Returns `{ "CreateUserProfile": true }` and a header `OS-AuthResponse` containing the new `OS-AuthTicketData` to be used for subsequent requests 7. `/game/GetTodaysInfocast` * Returns a list of messages to be scrolled at the bottom of the main menu * Idling on the menu calls this periodically * Query params: `b_digital`, a boolean, probably whether it's digital or a physical disc; `i16_episode`, the episode number of the current save game; `s_locale`, language code e.g 'en' * Example response: https://gist.github.com/blha303/d00b1c34728cc21101b7fc198bbf3371 8. `/game/SetUserProfileFriends` * Sends list of UIDs for user's friends list * POST requests, `["UID", ...]` * Returns `{"SetUserProfileFriends": 0 }`, friends service probably disabled 9. `/game/GetSeasonPassOfferIdList` * No clue what this is for, you'd think it would show information on the episodes but it just returns the same thing five times. * Query params: `s_region`, mine says 'na', not applicable? * Returns https://gist.github.com/blha303/cba709bc7b9db5e8122c46133fdedbcb ### Occasionally 1. `/game/AddMetrics` * Is called every few minutes regardless of the client configuration returned by `os_GetServiceInfo` * POST request, https://gist.github.com/blha303/b79ba499a2ea61880d3fc8dc812f7eb4 * Returns nothing at all ### On opening the choices screen (from the main menu or after each episode) 1. `/game/CommunityFactsGetEpisode` * Returns a list of choices for a given episode, and the percentage and raw numbers for each choice * Query params: `i16_episode`, the given episode number * Example response for episode 1: https://gist.github.com/blha303/cec90d1d2e351c33d39ddddd880cd252 2. `/game/GetFriendsProfileStats` * Apparently would return the same as `/game/CommunityFactsGetEpisode` with additional info on friend stats, but currently returns nothing * Query params: `i16_episode`, the given episode number; `s_uid`, the steam/other user id * Currently returns `{"results": [] }` ### On finishing an episode Making me listen to Obstacles again >_< 1. `/game/UpdateUserProfileGameSpecific` * POST request, summarizes choices made. Called when credits start * JSON data, https://gist.github.com/blha303/144499eeb67dface9a83371c17f9513b * Returns `0`, maybe means profile isn't updated when the given UID has already completed the given chapter ### Other public endpoints * `/game/CommunityFactsGetAll` * Returns all choice stats * Returns a similar output to CommunityFactsGetEpisode, but with all five episodes * `/game/GetSpecialFlag` * Query param: `i32_episode`, episode number * Returns `{ "__metadata" : {"uri" : "https://lis.os.eidos.com/game/offlinespecialfeatures(1)", "type" : "game.offlinespecialfeature"}, "i32_episode" : 1, "b_lipsync_active" : false }` * `/game/os_GetStatus` * Returns `{ "__metadata" : {"type" : "game.ClientInfo"}, "Host" : "lis.os.eidos.com", "ClientIP" : "", "UserAgent" : "OS/5.0.22/linux/official", "ServerTime" : 1470229891040, "ServletVersion" : "3.0.8" }` * `/game/os_GetChangeLog` * Returns the changelog for the LIS backend. I mean, wow. * Returns https://gist.github.com/blha303/0f53a12d65f8450c4aa522843df922aa * `/game/os_GetChangeLogHTML` * Returns the changelog in HTML * Returns https://ptpb.pw/MTw-.html * `/game/os_GetGeoLocation` * Returns `"os_GetGeoLocation" : { "__metadata" : {"type" : "game.GeoLocation"}, "s_countryCode" : "US", "s_cityName" : "Beverley Hills", "s_region" : "555", "s_zipCode" : "", "f_latitude" : "0.0f", "f_longitude" : "0.0f", "i32_metroCode" : 0, "i32_areaCode" : 0 }` * `/game/Steam_GetUserInfo` * Probably needs additional authentication. * `Returns { "__metadata" : {"uri" : "https://lis.os.eidos.com/game/ossteamresponses('76561197994805502')", "type" : "game.ossteamresponse"}, "s_uid" : "76561197994805502", "i32_errorCode" : 403, "s_errorDesc" : "Forbidden", "s_state" : "", "s_country" : "", "s_currency" : "", "s_status" : "" }` * `/game/GetUserProfileGameSpecific` * Returns a user's friends list and the info of their last UpdateUserProfileGameSpecific submission. Possible privacy hole * Returns https://gist.github.com/blha303/9d4d4429137541be5a8771ac616b4d85 Other endpoints: https://gist.github.com/blha303/101e0db0bf63ea07b1f55862947c9065#file-zgenerateddocs-md