Passa al contenuto principale

Elenco richieste post (news/tips/tutorial ecc.)

[baseUrl]/api/sync/v1/crm/posts/list

Descrizione

Elenco delle news/tips/tutorial

Parametri

FieldTypeRequiredDefaultDescriptionNotes
TypologyintnullID della tipologia di post
  1. News
  2. Adv
  3. BestSellers
  4. GiftIdeas
  5. ForYou
  6. TheBrand
  7. Tutorials
Categoriesint[]nullID delle categorie di post

Modelli

Post

FieldTypeDescriptionNotes
IDintID univoco del post
PostTypeintTipo di post
  1. News
  2. Adv
  3. BestSellers
  4. GiftIdeas
  5. ForYou
  6. TheBrand
  7. Tutorials
DateStartstringData inizio validitàFormato: YYYY-MM-DD HH:mm:ss
DateEndstringData fine validitàFormato: YYYY-MM-DD HH:mm:ss
CoverstringURL immagine copertina
BannerstringURL immagine banner
TitlestringTitolo del postFormato HTML
ContentstringContenuto del postFormato HTML
CategoriesCategory[]Elenco categorie associate

Category

FieldTypeDescriptionNotes
IDintID univoco categoria
DescriptionstringNome della categoria

Esempio richiesta

sh
curl --location --request POST '[baseUrl]/api/sync/v1/posts/list' \
--header 'AccessToken: {{token}}'

Esempio richiesta con filtro per categoria

Per ottenere i post filtrati per una o più categorie specifiche, è possibile inviare una richiesta come la seguente:

sh
curl --location '[baseUrl]/api/sync/v1/crm/posts/list' \
--header 'AccessToken: {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"Categories": [1]
}'

Per filtrare per più categorie, è possibile specificare un array con più ID:

sh
curl --location '[baseUrl]/api/sync/v1/crm/posts/list' \
--header 'AccessToken: {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"Categories": [1, 2, 3]
}'

Esempio richiesta con filtro per tipologia

Per ottenere i post filtrati per una tipologia specifica, è possibile inviare una richiesta come la seguente:

sh
curl --location '[baseUrl]/api/sync/v1/crm/posts/list' \
--header 'AccessToken: {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"Typology": 1
}'

Esempio richiesta con filtri combinati

È possibile combinare i filtri per tipologia e categorie:

sh
curl --location '[baseUrl]/api/sync/v1/crm/posts/list' \
--header 'AccessToken: {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"Typology": 1,
"Categories": [1, 2]
}'

Risposta

JSON
{
"statusCode": 200,
"errorCode": null,
"message": null,
"result": {
"totalCount": 1,
"totalPages": 1,
"page": 1,
"count": 1,
"records": [
{
"ID": 1,
"PostType": 1,
"DateStart": "2024-10-23 15:14:13",
"DateEnd": "2025-10-23 15:14:13",
"Cover": "{baseUrl}/base/image/1546",
"Banner": "{baseUrl}/base/image/1547",
"Title": "<h1>News title</h1>",
"Content": "<p>News description</p>",
"Categories": [
{
"ID": 2,
"Description": "Gioielli"
}
]
},
{
"ID": 2,
"PostType": 2,
"DateStart": "2024-10-23 15:14:13",
"DateEnd": "2025-10-23 15:14:13",
"Cover": "{baseUrl}/base/image/1548",
"Banner": "{baseUrl}/base/image/1549",
"Title": "<h1>Adv title</h1>",
"Content": "<p>Adv description</p>",
"Categories": [
{
"ID": 1,
"Description": "Orologi"
},
{
"ID": 2,
"Description": "Gioielli"
}
]
}
],
"record": null
},
"debug": {
"requestTime": "2024-10-23 18:22:21",
"responseTime": "2024-10-23 18:22:24",
"duration": "00:00:03.6306416",
"clientIP": "::1"
}
}