Get social posts
curl --request GET \
--url https://admin.snagsolutions.io/api/loyalty/postsimport requests
url = "https://admin.snagsolutions.io/api/loyalty/posts"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://admin.snagsolutions.io/api/loyalty/posts', 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://admin.snagsolutions.io/api/loyalty/posts",
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://admin.snagsolutions.io/api/loyalty/posts"
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://admin.snagsolutions.io/api/loyalty/posts")
.asString();require 'uri'
require 'net/http'
url = URI("https://admin.snagsolutions.io/api/loyalty/posts")
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{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"loyaltyCurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userMetadata": {
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"twitterUser": "<string>",
"twitterUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"twitterUserFollowersCount": 123,
"twitterVerifiedAccount": true,
"logoUrl": "<string>"
},
"mediaType": "image",
"platform": "twitter",
"postType": "post",
"loyaltyRuleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isSeen": true,
"authorId": "<string>",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"text": "<string>",
"mediaUrl": "<string>",
"previewUrl": "<string>",
"externalIdentifier": "<string>",
"latestReward": 123,
"parentPostId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"likeCount": 123,
"commentCount": 123,
"repostCount": 123,
"viewCount": 123,
"manualRank": 123,
"dynamicScore": 123,
"rank": 123,
"contentQualityScore": 123,
"sentimentScore": 50,
"postedAt": "2023-11-07T05:31:56Z"
}
],
"hasNextPage": true
}"Forbidden, Could not validate api key"{
"success": false,
"message": "Internal server error",
"debugInfo": "Stack trace or additional error details"
}Social Posts
Get social posts
Fetch social posts with pagination and filtering options. Note: Rank is calculated for top 20,000 posts only. Posts beyond this threshold will have a null rank.
GET
/
api
/
loyalty
/
posts
Get social posts
curl --request GET \
--url https://admin.snagsolutions.io/api/loyalty/postsimport requests
url = "https://admin.snagsolutions.io/api/loyalty/posts"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://admin.snagsolutions.io/api/loyalty/posts', 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://admin.snagsolutions.io/api/loyalty/posts",
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://admin.snagsolutions.io/api/loyalty/posts"
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://admin.snagsolutions.io/api/loyalty/posts")
.asString();require 'uri'
require 'net/http'
url = URI("https://admin.snagsolutions.io/api/loyalty/posts")
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{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"loyaltyCurrencyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userMetadata": {
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"twitterUser": "<string>",
"twitterUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"twitterUserFollowersCount": 123,
"twitterVerifiedAccount": true,
"logoUrl": "<string>"
},
"mediaType": "image",
"platform": "twitter",
"postType": "post",
"loyaltyRuleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isSeen": true,
"authorId": "<string>",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"text": "<string>",
"mediaUrl": "<string>",
"previewUrl": "<string>",
"externalIdentifier": "<string>",
"latestReward": 123,
"parentPostId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"likeCount": 123,
"commentCount": 123,
"repostCount": 123,
"viewCount": 123,
"manualRank": 123,
"dynamicScore": 123,
"rank": 123,
"contentQualityScore": 123,
"sentimentScore": 50,
"postedAt": "2023-11-07T05:31:56Z"
}
],
"hasNextPage": true
}"Forbidden, Could not validate api key"{
"success": false,
"message": "Internal server error",
"debugInfo": "Stack trace or additional error details"
}Query Parameters
UUID of the website to fetch social posts for
Example:
"123e4567-e89b-12d3-a456-426614174000"
UUID of the organization to fetch social posts for
Example:
"123e4567-e89b-12d3-a456-426614174001"
Optional UUID of the user group to filter posts
Example:
"123e4567-e89b-12d3-a456-426614174004"
Optional UUID of the user to filter posts
Example:
"123e4567-e89b-12d3-a456-426614174003"
Optional UUID of the loyalty post to filter posts
Example:
"123e4567-e89b-12d3-a456-426614174003"
Cursor for pagination
Example:
"123e4567-e89b-12d3-a456-426614174003"
Number of posts to fetch per page
Required range:
1 <= x <= 100Example:
10
Sort posts by createdAt or rank
Available options:
rank, createdAt Example:
"rank"
Was this page helpful?