List Posts
curl --request GET \
--url https://api.centralcart.io/v1/webstore/post \
--header 'x-store-domain: <x-store-domain>'import requests
url = "https://api.centralcart.io/v1/webstore/post"
headers = {"x-store-domain": "<x-store-domain>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-store-domain': '<x-store-domain>'}};
fetch('https://api.centralcart.io/v1/webstore/post', 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.centralcart.io/v1/webstore/post",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-store-domain: <x-store-domain>"
],
]);
$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.centralcart.io/v1/webstore/post"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-store-domain", "<x-store-domain>")
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.centralcart.io/v1/webstore/post")
.header("x-store-domain", "<x-store-domain>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-store-domain"] = '<x-store-domain>'
response = http.request(request)
puts response.read_body{
"meta": {
"total": 2,
"per_page": 15,
"current_page": 1,
"last_page": 1
},
"data": [
{
"id": 1,
"store_id": 1,
"title": "Bem-vindo à CentralCart",
"content": "<p>Conteúdo do post</p>",
"author": "Equipe CentralCart",
"image": "https://cdn.centralcart.io/stores/1/posts/cover.png",
"slug": "bem-vindo-a-centralcart",
"published_at": "03 mar. 2024",
"path": "/post/bem-vindo-a-centralcart",
"created_at": "2024-03-03T23:43:12.000-03:00",
"updated_at": "2024-03-03T23:43:12.000-03:00"
}
]
}{
"errors": [
{
"message": "Store not found."
}
]
}Catálogo
List Posts
Lista posts recentes do blog da loja, do mais novo para o mais antigo.
Posts marcados como privados não aparecem aqui, mas continuam acessíveis por link direto em
GET /webstore/post/{slug}.GET
/
webstore
/
post
List Posts
curl --request GET \
--url https://api.centralcart.io/v1/webstore/post \
--header 'x-store-domain: <x-store-domain>'import requests
url = "https://api.centralcart.io/v1/webstore/post"
headers = {"x-store-domain": "<x-store-domain>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-store-domain': '<x-store-domain>'}};
fetch('https://api.centralcart.io/v1/webstore/post', 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.centralcart.io/v1/webstore/post",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-store-domain: <x-store-domain>"
],
]);
$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.centralcart.io/v1/webstore/post"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-store-domain", "<x-store-domain>")
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.centralcart.io/v1/webstore/post")
.header("x-store-domain", "<x-store-domain>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-store-domain"] = '<x-store-domain>'
response = http.request(request)
puts response.read_body{
"meta": {
"total": 2,
"per_page": 15,
"current_page": 1,
"last_page": 1
},
"data": [
{
"id": 1,
"store_id": 1,
"title": "Bem-vindo à CentralCart",
"content": "<p>Conteúdo do post</p>",
"author": "Equipe CentralCart",
"image": "https://cdn.centralcart.io/stores/1/posts/cover.png",
"slug": "bem-vindo-a-centralcart",
"published_at": "03 mar. 2024",
"path": "/post/bem-vindo-a-centralcart",
"created_at": "2024-03-03T23:43:12.000-03:00",
"updated_at": "2024-03-03T23:43:12.000-03:00"
}
]
}{
"errors": [
{
"message": "Store not found."
}
]
}⌘I