curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X GET https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID
const API_KEY = "API_KEY";
const PROFILE_KEY = "PROFILE_KEY";
const SESSION_ID = "SESSION_ID";
fetch(`https://api.ayrshare.com/api/profiles/link-sessions/${SESSION_ID}`, {
headers: {
Authorization: `Bearer ${API_KEY}`,
"Profile-Key": PROFILE_KEY,
},
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY',
'Profile-Key': 'PROFILE_KEY'}
response = requests.get(
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
headers=headers)
print(response.json())
<?php
require 'vendor/autoload.php'; // Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html
$client = new GuzzleHttp\Client();
$res = $client->request(
'GET',
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
[
'headers' => [
'Authorization' => 'Bearer API_KEY',
'Profile-Key' => 'PROFILE_KEY'
]
]
);
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace GetLinkSession_csharp
{
class GetLinkSession
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string PROFILE_KEY = "PROFILE_KEY";
string url = "https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID";
try
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Add("Profile-Key", PROFILE_KEY);
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"HTTP request error: {e.Message}");
}
}
}
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "active", // pending | active | expired | revoked - see Link States above.
"createdAt": "2026-09-01T08:03:26.838Z", // When the link was created, as an ISO 8601 timestamp.
"expiresAt": "2026-09-02T08:03:26.838Z", // When the link stops working.
"firstUsedAt": "2026-09-01T08:14:02.104Z", // When the link was first opened. Absent if it never has been.
"lastUsedAt": "2026-09-01T08:14:02.104Z", // When the link was most recently opened. Absent if it never has been.
"useCount": 1, // How many times the link has been opened. A reload or an OAuth retry increments this.
"completedAt": "2026-09-01T08:15:44.870Z", // When the first account was connected. Absent until one is.
"lastCompletedAt": "2026-09-01T08:16:20.412Z", // When the most recent was connected. Absent until one is.
"completedNetworks": ["reddit", "bluesky"] // Every network connected on this link, append-only. Absent until one is.
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "pending", // Created but never opened, so firstUsedAt and lastUsedAt are absent.
"createdAt": "2026-09-01T08:03:26.838Z",
"expiresAt": "2026-09-02T08:03:26.838Z",
"useCount": 0
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}
Profiles
Eine Link Session abrufen
Prüfen Sie, ob eine Social-Linking-URL geöffnet wurde, noch gültig ist oder widerrufen wurde.
GET
/
profiles
/
link-sessions
/
{sessionId}
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X GET https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID
const API_KEY = "API_KEY";
const PROFILE_KEY = "PROFILE_KEY";
const SESSION_ID = "SESSION_ID";
fetch(`https://api.ayrshare.com/api/profiles/link-sessions/${SESSION_ID}`, {
headers: {
Authorization: `Bearer ${API_KEY}`,
"Profile-Key": PROFILE_KEY,
},
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY',
'Profile-Key': 'PROFILE_KEY'}
response = requests.get(
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
headers=headers)
print(response.json())
<?php
require 'vendor/autoload.php'; // Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html
$client = new GuzzleHttp\Client();
$res = $client->request(
'GET',
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
[
'headers' => [
'Authorization' => 'Bearer API_KEY',
'Profile-Key' => 'PROFILE_KEY'
]
]
);
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace GetLinkSession_csharp
{
class GetLinkSession
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string PROFILE_KEY = "PROFILE_KEY";
string url = "https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID";
try
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Add("Profile-Key", PROFILE_KEY);
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"HTTP request error: {e.Message}");
}
}
}
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "active", // pending | active | expired | revoked - see Link States above.
"createdAt": "2026-09-01T08:03:26.838Z", // When the link was created, as an ISO 8601 timestamp.
"expiresAt": "2026-09-02T08:03:26.838Z", // When the link stops working.
"firstUsedAt": "2026-09-01T08:14:02.104Z", // When the link was first opened. Absent if it never has been.
"lastUsedAt": "2026-09-01T08:14:02.104Z", // When the link was most recently opened. Absent if it never has been.
"useCount": 1, // How many times the link has been opened. A reload or an OAuth retry increments this.
"completedAt": "2026-09-01T08:15:44.870Z", // When the first account was connected. Absent until one is.
"lastCompletedAt": "2026-09-01T08:16:20.412Z", // When the most recent was connected. Absent until one is.
"completedNetworks": ["reddit", "bluesky"] // Every network connected on this link, append-only. Absent until one is.
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "pending", // Created but never opened, so firstUsedAt and lastUsedAt are absent.
"createdAt": "2026-09-01T08:03:26.838Z",
"expiresAt": "2026-09-02T08:03:26.838Z",
"useCount": 0
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}
Prüfen Sie den Status einer Linking-URL, die Sie mit
Eine Link Session erstellen erstellt haben — ob Ihr
Nutzer sie geöffnet hat, ob sie noch gültig ist und wie oft sie verwendet wurde.
Nützlich, wenn Sie wissen möchten, ob ein Nutzer mit dem Verbinden seiner Konten begonnen
hat, ohne ihn zu fragen, oder um zu bestätigen, dass ein Link tot ist, bevor Sie einen
Ersatz erstellen.
Eine
sessionId, die nicht existiert oder zu einem anderen Account gehört, gibt
dieselbe not found-Antwort zurück. Das ist beabsichtigt, damit der Endpunkt nicht dazu
verwendet werden kann herauszufinden, ob ein Identifier echt ist.Header-Parameter
Pfad-Parameter
string
erforderlich
Die
sessionId, die beim Erstellen des Links zurückgegeben wurde.Link-Status
Das Feldstate hat einen der folgenden Werte:
pending: erstellt, nie geöffnet.active: mindestens einmal geöffnet, noch innerhalb des Zeitfensters.expired:expiresAtist überschritten.revoked: mit Eine Link Session widerrufen beendet.
revoked, da dies die
nützlichere Antwort ist.
Verbundene Konten
Wenn Ihr Nutzer ein Konto verbindet, zeichnet der Link das auf. Drei Felder erscheinen, sobald etwas verbunden wurde, und fehlen bis dahin:completedAt: wann das erste Konto verbunden wurde.lastCompletedAt: wann das letzte verbunden wurde.completedNetworks: jedes über diesen Link verbundene Netzwerk.
state getrennt, und beide beantworten echte Fragen: Ein Link kann active
sein und noch nichts verbunden haben, oder expired sein und vor seinem Ablauf drei Konten
verbunden haben. Das Pollen von completedNetworks ist der Weg, auf dem eine servergerenderte App
oder eine mobile App erfährt, dass eine Verbindung abgeschlossen ist — und das einzige Signal für
Telegram, das außerhalb des Browsers abgeschlossen wird.
completedNetworks ist eine Historie dieser Link Session, nicht der aktuelle Zustand des
Profils. Es ist append-only: Ein Netzwerk wird hinzugefügt, wenn es über diese Session
verbunden wird, und nie entfernt — es bleibt also gelistet, nachdem die Verknüpfung des Kontos
aufgehoben, das Konto über eine andere Session neu verknüpft oder auf Seiten des Netzwerks
getrennt wurde. Um zu sehen, welche Netzwerke jetzt gerade mit dem User Profile verknüpft
sind, rufen Sie User Profiles abrufen mit include=state auf.curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X GET https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID
const API_KEY = "API_KEY";
const PROFILE_KEY = "PROFILE_KEY";
const SESSION_ID = "SESSION_ID";
fetch(`https://api.ayrshare.com/api/profiles/link-sessions/${SESSION_ID}`, {
headers: {
Authorization: `Bearer ${API_KEY}`,
"Profile-Key": PROFILE_KEY,
},
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY',
'Profile-Key': 'PROFILE_KEY'}
response = requests.get(
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
headers=headers)
print(response.json())
<?php
require 'vendor/autoload.php'; // Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html
$client = new GuzzleHttp\Client();
$res = $client->request(
'GET',
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
[
'headers' => [
'Authorization' => 'Bearer API_KEY',
'Profile-Key' => 'PROFILE_KEY'
]
]
);
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace GetLinkSession_csharp
{
class GetLinkSession
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string PROFILE_KEY = "PROFILE_KEY";
string url = "https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID";
try
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Add("Profile-Key", PROFILE_KEY);
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"HTTP request error: {e.Message}");
}
}
}
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "active", // pending | active | expired | revoked - see Link States above.
"createdAt": "2026-09-01T08:03:26.838Z", // When the link was created, as an ISO 8601 timestamp.
"expiresAt": "2026-09-02T08:03:26.838Z", // When the link stops working.
"firstUsedAt": "2026-09-01T08:14:02.104Z", // When the link was first opened. Absent if it never has been.
"lastUsedAt": "2026-09-01T08:14:02.104Z", // When the link was most recently opened. Absent if it never has been.
"useCount": 1, // How many times the link has been opened. A reload or an OAuth retry increments this.
"completedAt": "2026-09-01T08:15:44.870Z", // When the first account was connected. Absent until one is.
"lastCompletedAt": "2026-09-01T08:16:20.412Z", // When the most recent was connected. Absent until one is.
"completedNetworks": ["reddit", "bluesky"] // Every network connected on this link, append-only. Absent until one is.
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "pending", // Created but never opened, so firstUsedAt and lastUsedAt are absent.
"createdAt": "2026-09-01T08:03:26.838Z",
"expiresAt": "2026-09-02T08:03:26.838Z",
"useCount": 0
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}