Network: Difference between revisions

 
(15 intermediate revisions by the same user not shown)
Line 201: Line 201:
==== migration ====
==== migration ====
[[Migration_services|Migration]] service storage.
[[Migration_services|Migration]] service storage.
[20.0.0+] The below save_data_migrations URLs were moved elsewhere under [[#transfer|transfer]].
URLs:
  <nowiki>https://migration.%.scsi.srv.nintendo.net/api/nx/v1/account_migrations/gen_key
  https://migration.%.scsi.srv.nintendo.net/api/nx/v1/account_migrations/get_key
  https://migration.%.scsi.srv.nintendo.net/api/nx/v1/save_data_migrations/gen_key
  https://migration.%.scsi.srv.nintendo.net/api/nx/v1/save_data_migrations/get_key</nowiki>


==== storage ====
==== storage ====
Line 225: Line 233:


   /start
   /start
   /%lld/%s
   /%lld/%s (where %s is one of the following as selected by an input param: "finish_transfer", "finish_upload", "finish_download", "abort_transfer", "abort_upload")
   /%lld
   /%lld
   /%lld/rollback
   /%lld/rollback
   /%lld/register_destination
   /%lld/register_destination
   ?type=%d
   ?type=%d
  "/%lld/save_datas/%lld/generate_key_seed_package" / "/%lld/generate_key_seed_package", depending on an input param (the former is only used by [[Migration_services|IDownloader]] cmd400)
  /%lld/save_datas/start_upload
  /%lld/save_datas/%lld/finish_upload
  /%lld/save_datas/%lld
  /%lld/save_datas/%lld/component_files/start_upload
  /%lld/save_datas/%lld/component_files/%lld/finish_upload
  /%lld/save_datas/%lld/component_files
  /%lld/save_datas
  /%lld/save_datas/%lld/start_download
  /%lld/save_datas/%lld/finish_download
  /%lld/save_datas/%lld/component_files
  /%lld/album_data_archives/start_upload
  /%lld/album_data_archives/%lld/finish_upload
  /%lld/album_data_archives/%lld
  /%lld/album_data_archives/%lld/start_download
  /%lld/album_data_archives/%lld
  /%lld/album_data_archives/%lld/finish_download
  /%lld/album_data_archives
These use the following request headers:
  User-Agent: libcurl (nnHttp; {...})
  Accept: */*
  Content-Type: application/json
  Authorization: Bearer {token}
  {Content-Length as needed}
The above token is from using [[Account_services|IManagerForSystemService EnsureIdTokenCacheAsync]], with the output from [[Account_services|IManagerForSystemService LoadIdTokenCache]] being used as the token.
* "/start":
** The json POST data contains the following:
*** <code>{"type":<type>,"scope":<scope>,"src_device_appearance_main":"<str0>","src_device_appearance_controller":"<str1>"}</code>
*** <type> is 0 for local (nn::migration::device::IServer and nn::migration::savedata::IServer), 1 for Uploader (nn::migration::device::IUploader).
*** <scope> is 0 for device (nn::migration::device::IServer and nn::migration::device::IUploader), 1 for savedata (nn::migration::savedata::IServer).
*** <str0> is the output from [[NS_services|ns]] IApplicationManagerInterface cmd4063, <str1> is from cmd4064.
** The json response is parsed as the following (HTTP status must be 201):
*** <code>{"transfer_event":{"transfer_event_id":<number>,"status":<status_str>,"error":<str>,"src_device_serial":<str>,"src_device_appearance_main":<str>,"dst_device_serial":<str>,"src_device_type":<unknown>,"created_at":<timestamp>,"expires_at":<timestamp>}}</code>
*** The minimum required fields are status and expires_at. <status_str> must match one of various strings, such as "started".
*** The output transfer_event_id is then used as the first "%lld" in the above URIs.
*** The rest of the fields are likely only used with "nn::migration::device::*" (?).
* "/%lld/%s":
** The POST data is empty.
** The json response is parsed as the following (HTTP status must be 200):
*** This is parsed similar to /start above. The minimum required fields are the same as /start. The rest of the output is unused.
* "/%lld":
** This is used following certain network requests which failed, depending on the Result. In one case it's used without a prior network request.
** No POST data (?).
** The json response is parsed as the following (HTTP status must be 200):
*** This is parsed similar to /start above. The minimum required fields are the same as /start.
*** Most usage of this will return 0 instead of the Result from the request which failed, when status is the expected value and expires_at>0.
* "/%lld/register_destination":
** The json POST data contains the following:
*** <code>{"dst_device_appearance_main":"<str0>","dst_device_appearance_controller":"<str1>"}</code>
*** <str0>/<str1> are the same as with "/start".
** The json response is parsed as the following (HTTP status must be 200):
*** This is parsed similar to /start above. The minimum required fields are the same as /start. The rest of the output is unused.
* "/%lld/save_datas/%lld/generate_key_seed_package" / "/%lld/generate_key_seed_package":
** The json POST data contains the following:
*** <code>{"challenge":"%s"}</code>
*** Where %s is the 0x10-byte challenge ([[Filesystem_services#ISaveDataTransferManagerWithDivision|ISaveDataTransferManagerWithDivision GetChallenge]]) printed with "%02x" for each byte.
** The json response is parsed as the following:
*** <code>{"key_seed_package":<str>,"error":<...>,"code":<str>}</code>
*** When the HTTP status is 200, the key_seed_package string is base64 decoded. The output is then later used with [[Filesystem_services#ISaveDataTransferManagerWithDivision|ISaveDataTransferManagerWithDivision SetKeySeedPackage]].
*** Otherwise, the value of the "code" string is compared against a table, to determine the Result to return. ("error" is unused?)


== Others ==
== Others ==
Line 241: Line 316:
* "c-%.accounts.nintendo.com"
* "c-%.accounts.nintendo.com"
* "capi.%.op2.nintendo.net"
* "capi.%.op2.nintendo.net"
[[NIM_services|nim]]:
* "bvc-hac-%.cdn.nintendo.net"


News, friends and game content:
News, friends and game content:
Line 262: Line 340:
* "problems.dragons.nintendo.net"
* "problems.dragons.nintendo.net"
* "moon.nintendo.com"
* "moon.nintendo.com"
==== bvc ====
Used by nim [[NIM_services#RequestCheckSafeSystemVersion|RequestCheckSafeSystemVersion]].
URLs:
  <nowiki>"https://bvc-hac-%.cdn.nintendo.net/%d-%d-%d"</nowiki>
The data for each "%d" is the first 3-bytes from the [[System_Version_Title|SystemVersion]].


==== scsi-policy ====
==== scsi-policy ====
Used by [[OLSC_services|OLSC]] and [[Migration_services|migration]].
Used by [[OLSC_services|OLSC]] and [[Migration_services|migration]].


URLs:
[20.0.0+] This is no longer used by [[Migration_services|migration]].
 
Migration URL:
   <nowiki>"https://scsi-policy-%.cdn.nintendo.net/api/nx/v1/save_data_migration_policy/%016llx/%05u?dtoken="</nowiki>
   <nowiki>"https://scsi-policy-%.cdn.nintendo.net/api/nx/v1/save_data_migration_policy/%016llx/%05u?dtoken="</nowiki>