GetCollectionById
This endpoint is there to get collection by id
You'll need to replace the {{collectionId}} with the actual collection to fetch the API
GET
https://sandbox.pgecom.com/api/v1/storefront/collection/{{collectionId}}
{
"searchEngineDescription": "desc",
"shopId": "5f56dfa3-a415-4818-8275-44fc63ece3fd",
"searchEngineTitle": "Page Electronics",
"updatedAt": "2023-03-03T23:45:25Z",
"createdAt": "2023-03-03T23:45:25Z",
"description": "Eletronics gadget",
"id": "a20e63c3-47e8-489f-a68e-ca4bfdcefd2d",
"name": "Electronics",
"mainImageUrl": "https://pg-ecommerce-dev.s3.amazonaws.com/collection/c45ea8cc-7767-46f3-86a7-d9c1f576e715/137c797a75baa78dbbfae7f16ccc653e.jpg",
"searchEngineUrl": "undefined",
"products": []
}
{
"message": "Collection with id a20e63c3-47e8-489f-a68e-ca4bfdcefd2 not found",
"status": 404
}
{
"message": "Too many requests, please try again later.",
"status": 429
}
const axios = require('axios');
let config = {
method: 'get',
url: 'https://sandbox.pgecom.com/api/v1/storefront/collection/a20e63c3-47e8-489f-a68e-ca4bfdcefd2',
headers: { }
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
url = "https://sandbox.pgecom.com/api/v1/storefront/collection/a20e63c3-47e8-489f-a68e-ca4bfdcefd2"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "net/http"
url = URI("https://sandbox.pgecom.com/api/v1/storefront/collection/a20e63c3-47e8-489f-a68e-ca4bfdcefd2")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://sandbox.pgecom.com/api/v1/storefront/collection/a20e63c3-47e8-489f-a68e-ca4bfdcefd2');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
curl --location 'https://sandbox.pgecom.com/api/v1/storefront/collection/a20e63c3-47e8-489f-a68e-ca4bfdcefd2
Last updated