You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be great to have more information about the parental control API to get a detailed playtime per game. I have a Wireshark recording, but I'll first have to figure out how to strip sensitive information from that before posting.
My current problem is the session_code_verifier for the /connect/1.0.0/api/session_token. It is not the state like with the normal Switch app. In fact it doesn't appear in any form in the initial URL or the redirection URL.
Ok, I got it to run and made an example to print play time per game (see here). As said before, the authentication works as expected up to the token API. After that you have an access_token and an id_token.
First we have to get the user id with
GET /2.0.0/users/me HTTP/1.1
Authorization: Bearer access_token
Host: api.accounts.nintendo.com
HTTP/1.1 200 OK
{
"nickname": "nickname",
"id": "user_id",
...a lot of other stuff...
}
Now the next step is to register the device with the online service. From now on the following headers probably have to be present (I didn't test which you can remove, but the device id should probably be required):
Activity
frozenpandaman commentedon Apr 2, 2020
This would be cool to see!
SolidTux commentedon Apr 2, 2020
My current problem is the
session_code_verifierfor the/connect/1.0.0/api/session_token. It is not the state like with the normal Switch app. In fact it doesn't appear in any form in the initial URL or the redirection URL.SolidTux commentedon Apr 6, 2020
Ok, I can now login, it works like here, but the rest doesn't really work yet as you apparently need to set special "X-Moon-*" headers.
Currently, the backend returns null pointer exceptions :-D
SolidTux commentedon Apr 6, 2020
Ok, I got it to run and made an example to print play time per game (see here). As said before, the authentication works as expected up to the
tokenAPI. After that you have anaccess_tokenand anid_token.First we have to get the user id with
Now the next step is to register the device with the online service. From now on the following headers probably have to be present (I didn't test which you can remove, but the device id should probably be required):
device_idcan be chosen. The device is registered usingThe registration is only needed once. This allows us now to get the ids of the registered devices
For each device we can get the daily summaries
or a list of available monthly summaries
Each montly summary can be obtained with
There are a lot or more endpoints, e.g. for the parental control setting, but I haven't looked at them.