Create Mobile Handoff Session
curl --request POST \
--url https://api.kiriku.app/v1/mobile-handoff/sessionimport requests
url = "https://api.kiriku.app/v1/mobile-handoff/session"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.kiriku.app/v1/mobile-handoff/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kiriku.app/v1/mobile-handoff/session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kiriku.app/v1/mobile-handoff/session"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kiriku.app/v1/mobile-handoff/session")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kiriku.app/v1/mobile-handoff/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"sessionId": "<string>",
"status": "pending",
"file": {
"originalName": "<string>",
"mimeType": "<string>",
"size": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"uploadUrl": "<string>",
"consumeUrl": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}Mobile Handoff
Create session
Create a new mobile handoff session for file transfer. The session is valid for 15 minutes.
POST
/
v1
/
mobile-handoff
/
session
Create Mobile Handoff Session
curl --request POST \
--url https://api.kiriku.app/v1/mobile-handoff/sessionimport requests
url = "https://api.kiriku.app/v1/mobile-handoff/session"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.kiriku.app/v1/mobile-handoff/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kiriku.app/v1/mobile-handoff/session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kiriku.app/v1/mobile-handoff/session"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kiriku.app/v1/mobile-handoff/session")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kiriku.app/v1/mobile-handoff/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"sessionId": "<string>",
"status": "pending",
"file": {
"originalName": "<string>",
"mimeType": "<string>",
"size": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"uploadUrl": "<string>",
"consumeUrl": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}Create a new mobile handoff session.
Response
{
"sessionId": "abc123def456",
"uploadUrl": "https://api.kiriku.app/v1/mobile-handoff/upload/abc123def456",
"consumeUrl": "https://api.kiriku.app/v1/mobile-handoff/consume/abc123def456",
"status": "created",
"expiresAt": "2024-03-13T12:00:00Z"
}
Notes
- Le sessionId est valide pendant 30 minutes
- Vous pouvez partager l’uploadUrl avec votre application mobile
Example
curl -X POST https://api.kiriku.app/v1/mobile-handoff/session
Response
200 - application/json
Session created successfully
Unique session identifier
Session status
Available options:
pending, uploaded, consumed File metadata (only present when uploaded)
Show child attributes
Show child attributes
URL to upload file to this session
URL to consume the uploaded file
Session expiration time (15 minutes after creation)