Get Connection Status
curl --request GET \
--url https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connectionimport requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection', 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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "<string>",
"type": "<string>",
"connectionId": "<string>",
"createdAt": "<string>",
"connectedAt": "<string>",
"requestedAt": "<string>",
"respondedAt": "<string>"
}User Connection Operations
Get Connection Status
Check the connection status between the authenticated user and another user
GET
/
:projectId
/
api
/
v7
/
users
/
:userId
/
connection
Get Connection Status
curl --request GET \
--url https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connectionimport requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection', 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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "<string>",
"type": "<string>",
"connectionId": "<string>",
"createdAt": "<string>",
"connectedAt": "<string>",
"requestedAt": "<string>",
"respondedAt": "<string>"
}Returns the connection status between the authenticated user and the specified user. The response shape varies depending on whether there is no connection, a pending request, an accepted connection, or a declined request.
Pending request:
Accepted (connected):
Declined:
Path Parameters
string
required
The Sublay user ID (UUID) of the other user.
Response
On success, returns HTTP200. The shape depends on the connection state:
No connection:
string
"none".string
"pending".string
"sent" if the authenticated user sent the request; "received" if they received it.string
ID of the connection record.
string
ISO timestamp of when the request was sent.
string
"connected".string
ID of the connection record.
string
ISO timestamp of when the connection was accepted.
string
ISO timestamp of the original request.
string
"declined".string
"sent" or "received" — perspective of the authenticated user.string
ID of the connection record.
string
ISO timestamp of when the request was declined.
Error Responses
Self-Check — 400
Self-Check — 400
{
"error": "Cannot check connection status with yourself",
"code": "connection/self-check"
}

