Create a shared link
curl --request POST \
--url https://api.aiyoticloud.com/Assets/CreateSharing \
--header 'AccessKey: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"AssetID": "00000000000000000000000000000003"
}
'import requests
url = "https://api.aiyoticloud.com/Assets/CreateSharing"
payload = { "AssetID": "00000000000000000000000000000003" }
headers = {
"AccessKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {AccessKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({AssetID: '00000000000000000000000000000003'})
};
fetch('https://api.aiyoticloud.com/Assets/CreateSharing', 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.aiyoticloud.com/Assets/CreateSharing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AssetID' => '00000000000000000000000000000003'
]),
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aiyoticloud.com/Assets/CreateSharing"
payload := strings.NewReader("{\n \"AssetID\": \"00000000000000000000000000000003\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("AccessKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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.aiyoticloud.com/Assets/CreateSharing")
.header("AccessKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"AssetID\": \"00000000000000000000000000000003\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiyoticloud.com/Assets/CreateSharing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"AssetID\": \"00000000000000000000000000000003\"\n}"
response = http.request(request)
puts response.read_body{
"Code": 200,
"Message": "Success",
"AssetShareID": "00000000000000000000000000000006"
}Create a shared link
Creates a new sharing record for an asset you have permission to access. The response returns AssetShareID, not a complete URL. Each successful call creates a new identifier; avoid automatically retrying an ambiguous creation result. See the shared links guide for the visitor URL format. Anyone with the identifier can retrieve the shared data without an AccessKey.
Create a shared link
curl --request POST \
--url https://api.aiyoticloud.com/Assets/CreateSharing \
--header 'AccessKey: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"AssetID": "00000000000000000000000000000003"
}
'import requests
url = "https://api.aiyoticloud.com/Assets/CreateSharing"
payload = { "AssetID": "00000000000000000000000000000003" }
headers = {
"AccessKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {AccessKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({AssetID: '00000000000000000000000000000003'})
};
fetch('https://api.aiyoticloud.com/Assets/CreateSharing', 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.aiyoticloud.com/Assets/CreateSharing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AssetID' => '00000000000000000000000000000003'
]),
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aiyoticloud.com/Assets/CreateSharing"
payload := strings.NewReader("{\n \"AssetID\": \"00000000000000000000000000000003\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("AccessKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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.aiyoticloud.com/Assets/CreateSharing")
.header("AccessKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"AssetID\": \"00000000000000000000000000000003\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiyoticloud.com/Assets/CreateSharing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"AssetID\": \"00000000000000000000000000000003\"\n}"
response = http.request(request)
puts response.read_body{
"Code": 200,
"Message": "Success",
"AssetShareID": "00000000000000000000000000000006"
}Authorizations
Send the access token returned by Login. Both access and refresh tokens are accepted; reserve refresh for credential renewal.
Body
application/json
Unique identifier of the asset.
Response
Shared link created successfully.

