Network: Difference between revisions

 
(4 intermediate revisions by the same user not shown)
Line 274: Line 274:
** The json response is parsed as the following (HTTP status must be 201):
** 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>
*** <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 created_at. <status_str> must match one of various strings, such as "started".
*** 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 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":
* "/%lld/%s":
** The POST data is empty.
** The POST data is empty.
** The json response is parsed as the following (HTTP status must be 200):
** 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 response is parsed as follows (HTTP status must be 200):
*** This is base64 decoded. The output is then later used with [[Filesystem_services#ISaveDataTransferManagerWithDivision|ISaveDataTransferManagerWithDivision SetKeySeedPackage]].


== Others ==
== Others ==