Get meta information about live pages - Fabric
Get meta information about live pages
cURL
curl --request GET \
--url 'https://cdn.xm.fabric.inc/api/v2/pages/metadata?channels=12&size=10'
import requests
url = "https://cdn.xm.fabric.inc/api/v2/pages/metadata?channels=12&size=10"
response = requests.get(url)
print(response.text)
const options = {method: 'GET'};
fetch('https://cdn.xm.fabric.inc/api/v2/pages/metadata?channels=12&size=10', 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://cdn.xm.fabric.inc/api/v2/pages/metadata?channels=12&size=10",
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://cdn.xm.fabric.inc/api/v2/pages/metadata?channels=12&size=10"
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://cdn.xm.fabric.inc/api/v2/pages/metadata?channels=12&size=10")
.asString();
require 'uri'
require 'net/http'
url = URI("https://cdn.xm.fabric.inc/api/v2/pages/metadata?channels=12&size=10")
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
Example Response
{
"size": 10,
"nextCursor": "H796HJHGANLSADS",
"data": [
{
"id": "5f328bf0b7c15700071233b9",
"name": "HomePage",
"updatedAt": "2021-09-09T21:03:29.617Z",
"publishedAt": "2021-09-09T21:03:29.617Z",
"metadata": {
"url": "/home",
"channels": [
"00SZAU",
"02SZCA"
],
"seoFields": {
"title": "SEO",
"description": "SEO description",
"metadata": [
{
"name": "background-color",
"content": "white"
}
]
}
}
}
]
}
{
"code": "INTERNAL_SERVER_ERROR",
"message": "An internal error occurred. If the issue persists please contact support@fabric.inc."
}
Query Parameters
channels: string (default: 12)
- Comma-separated list of channel IDs
size: integer
(default: 10) - Number of records to be returned. Required range:
1 <= x <= 100
- Number of records to be returned. Required range:
startCursor: string
- Record pointer to get items after the specified record. Required string length:
15 - Example:
"H796HJHGANLSADS"
- Record pointer to get items after the specified record. Required string length:
Response
- 200: application/json
- Successful operation
- size: integer
(default: 10) - Number of records to be returned. Required range: 1 <= x <= 100 - nextCursor: string - Record pointer to get items in the next data set. Required string length:
15 - data: object[] - Showchild attributes.