Get Follow Status
curl --request GET \
--url https://api.sublay.io/v8/:projectId/users/:userId/follow \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/users/:userId/follow"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/users/:userId/follow', 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/v8/:projectId/users/:userId/follow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/v8/:projectId/users/:userId/follow"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/v8/:projectId/users/:userId/follow")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/users/:userId/follow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"isFollowing": true,
"followId": "<string>",
"followedAt": "<string>"
}User Follow Operations
Get Follow Status
Check whether the authenticated user follows a specific user
Get Follow Status
curl --request GET \
--url https://api.sublay.io/v8/:projectId/users/:userId/follow \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/users/:userId/follow"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/users/:userId/follow', 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/v8/:projectId/users/:userId/follow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/v8/:projectId/users/:userId/follow"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/v8/:projectId/users/:userId/follow")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/users/:userId/follow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"isFollowing": true,
"followId": "<string>",
"followedAt": "<string>"
}Returns the follow status between the authenticated user and the specified user. If the authenticated user is following, the response includes the follow record ID and timestamp.
When not following:
Requires the
follows bundle. A project without the follows bundle returns 403 database/tables-not-available. See Bundles.Path Parameters
string
required
The Sublay user ID (UUID) of the user to check follow status for.
Query Parameters
string
Service key only, and required with one: the user this request acts as, whose follow of the user in the path is checked. A user token always acts as its own user and must not send it (
400 follow/acting-user-not-allowed).Response
On success, returns HTTP200. The shape differs based on follow status:
When following:
boolean
true — the authenticated user follows this user.string
ID of the follow record.
string
ISO timestamp of when the follow was created.
boolean
false.Error Responses
Missing User — 400
Missing User — 400
A service key sent no
actingUserId.{
"error": "A service key must send actingUserId: the user this request acts as.",
"code": "follow/missing-user-id"
}
Acting User Not Allowed — 400
Acting User Not Allowed — 400
A user token sent
actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.{
"error": "actingUserId is only accepted with a service key. A user's own token always acts as that user.",
"code": "follow/acting-user-not-allowed"
}
User Not Found — 404
User Not Found — 404
Returned when a service key names an
actingUserId that isn’t a user in this project.{ "error": "No user with this actingUserId exists in this project.", "code": "follow/user-not-found" }

