Get post by slug
curl --request GET \
--url https://api.identityhub.app/blog/{slug}import requests
url = "https://api.identityhub.app/blog/{slug}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.identityhub.app/blog/{slug}', 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.identityhub.app/blog/{slug}",
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.identityhub.app/blog/{slug}"
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.identityhub.app/blog/{slug}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.identityhub.app/blog/{slug}")
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{
"success": true,
"data": {
"id": "post_001",
"slug": "introducing-identity-hub",
"title": "Introducing Identity Hub",
"excerpt": "The trust layer of the TON ecosystem",
"coverImageUrl": "https://cdn.identityhub.app/blog/cover.webp",
"content": "# Introducing Identity Hub\n\n...",
"contentImageUrls": [],
"status": "PUBLISHED",
"author": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"username": "admin",
"displayName": "Admin User",
"avatar": null,
"bio": null,
"status": "ACTIVATED",
"tags": []
},
"publishedAt": "2025-01-01T00:00:00.000Z",
"clapCount": 128
}
}{
"success": false,
"error": "User not found",
"code": "NOT_FOUND"
}Blog
Get post by slug
Returns a single published blog post with content and clap counts.
Error codes:
NOT_FOUND(404) — post with given slug does not exist or is not published
GET
/
blog
/
{slug}
Get post by slug
curl --request GET \
--url https://api.identityhub.app/blog/{slug}import requests
url = "https://api.identityhub.app/blog/{slug}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.identityhub.app/blog/{slug}', 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.identityhub.app/blog/{slug}",
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.identityhub.app/blog/{slug}"
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.identityhub.app/blog/{slug}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.identityhub.app/blog/{slug}")
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{
"success": true,
"data": {
"id": "post_001",
"slug": "introducing-identity-hub",
"title": "Introducing Identity Hub",
"excerpt": "The trust layer of the TON ecosystem",
"coverImageUrl": "https://cdn.identityhub.app/blog/cover.webp",
"content": "# Introducing Identity Hub\n\n...",
"contentImageUrls": [],
"status": "PUBLISHED",
"author": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"username": "admin",
"displayName": "Admin User",
"avatar": null,
"bio": null,
"status": "ACTIVATED",
"tags": []
},
"publishedAt": "2025-01-01T00:00:00.000Z",
"clapCount": 128
}
}{
"success": false,
"error": "User not found",
"code": "NOT_FOUND"
}Path Parameters
Blog post URL slug
Response
Success
Available options:
true Show child attributes
Show child attributes
Example:
{
"id": "post_001",
"slug": "introducing-identity-hub",
"title": "Introducing Identity Hub",
"excerpt": "The trust layer of the TON ecosystem",
"coverImageUrl": "https://cdn.identityhub.app/blog/cover.webp",
"content": "# Introducing Identity Hub\n\n...",
"contentImageUrls": [],
"status": "PUBLISHED",
"author": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"username": "admin",
"displayName": "Admin User",
"avatar": null,
"bio": null,
"status": "ACTIVATED",
"tags": []
},
"publishedAt": "2025-01-01T00:00:00.000Z",
"clapCount": 128
}