Elenco richieste post (news/tips/tutorial ecc.)
[baseUrl]/api/sync/v1/crm/posts/list
Descrizione
Elenco delle news/tips/tutorial
Parametri
| Field | Type | Required | Default | Description | Notes |
|---|---|---|---|---|---|
Typology | int | null | ID della tipologia di post |
| |
Categories | int[] | null | ID delle categorie di post |
Modelli
Post
| Field | Type | Description | Notes |
|---|---|---|---|
ID | int | ID univoco del post | |
PostType | int | Tipo di post |
|
DateStart | string | Data inizio validità | Formato: YYYY-MM-DD HH:mm:ss |
DateEnd | string | Data fine validità | Formato: YYYY-MM-DD HH:mm:ss |
Cover | string | URL immagine copertina | |
Banner | string | URL immagine banner | |
Title | string | Titolo del post | Formato HTML |
Content | string | Contenuto del post | Formato HTML |
Categories | Category[] | Elenco categorie associate |
Category
| Field | Type | Description | Notes |
|---|---|---|---|
ID | int | ID univoco categoria | |
Description | string | Nome 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"
}
}