Skip to main content
POST
/
devices
/
share
Crear enlace compartido
curl --request POST \
  --url https://api.locatebyteli.com/devices/share \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "devices": [
    "<string>"
  ],
  "ttl": 123
}
'
import requests

url = "https://api.locatebyteli.com/devices/share"

payload = {
"devices": ["<string>"],
"ttl": 123
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({devices: ['<string>'], ttl: 123})
};

fetch('https://api.locatebyteli.com/devices/share', 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.locatebyteli.com/devices/share",
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([
'devices' => [
'<string>'
],
'ttl' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.locatebyteli.com/devices/share"

payload := strings.NewReader("{\n \"devices\": [\n \"<string>\"\n ],\n \"ttl\": 123\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<authorization>")
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.locatebyteli.com/devices/share")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"devices\": [\n \"<string>\"\n ],\n \"ttl\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.locatebyteli.com/devices/share")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"devices\": [\n \"<string>\"\n ],\n \"ttl\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "token": "a1b2c3d4e5f6",
  "devices": ["770e8400-e29b-41d4-a716-446655440000", "880e8400-e29b-41d4-a716-446655440000"],
  "expires_at": "2026-03-18T11:00:00Z",
  "original_url": "https://app.locatebyteli.com/share?token=eyJhbGciOiJIUzI1NiJ9...",
  "short_url": "https://locate.link/abc123"
}

Authorization

Authorization
string
default:"Bearer "
required
API Key. Formato: Bearer lbt_•••

Body Parameters

devices
string[]
required
UUIDs de los dispositivos a compartir (mínimo 1)
ttl
integer
required
Tiempo de vida del enlace en segundos (mínimo 60)

Respuesta

id
uuid
ID del enlace creado
token
string
Token aleatorio del enlace
devices
string[]
Lista de IDs de dispositivos compartidos
expires_at
datetime
Fecha de expiración del enlace
original_url
string
URL completa con token de compartición
short_url
string
URL acortada

Comportamiento

  • Valida que todos los dispositivos pertenezcan a los grupos del usuario.
  • Genera un token aleatorio.
  • Calcula la fecha de expiración: now + ttl segundos.
  • Genera URLs larga y corta.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "token": "a1b2c3d4e5f6",
  "devices": ["770e8400-e29b-41d4-a716-446655440000", "880e8400-e29b-41d4-a716-446655440000"],
  "expires_at": "2026-03-18T11:00:00Z",
  "original_url": "https://app.locatebyteli.com/share?token=eyJhbGciOiJIUzI1NiJ9...",
  "short_url": "https://locate.link/abc123"
}

Errores

CódigoDescripción
400Parámetros inválidos
404Dispositivo no encontrado o sin acceso
500Error interno