API reference

Preview Content (V2)

API referencehttps://api.contit.cloud

Preview Content (V2)

Draft/preview content endpoints using the V2 flat-dictionary model with separate translations.

POST /v2/preview-contents/{contentTypeKey}/ids V2

Get preview content IDs only (V2)

Returns only the IDs of matching draft/preview content items.

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
filter object — Filter tree
page integer — Page number
pageSize integer — Items per page

Risposte

200Success
idsstring[]Array of content item IDs
totalintegerTotal matching items
401Unauthorized

Esempi di codice

curl -X POST "https://api.contit.cloud/v2/preview-contents/{contentTypeKey}/ids" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "filter": "filter_value",
  "page": 1,
  "pageSize": 1
}'
Esempio di richiesta
{
  "filter": null,
  "page": 1,
  "pageSize": 50
}
Esempio di risposta 200
{
  "ids": [
    "d4e5f6a7-b8c9-0123-defg-456789012345"
  ],
  "total": 1
}
Prova Live
GET /v2/preview-contents/{contentTypeKey}/{id} V2

Get single preview content (V2)

Retrieve a single draft/preview content item using the V2 model.

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key
idstringThe content item ID (GUID)

Risposte

200Success
idstringContent item ID
fieldsobjectFlat dictionary of field key to value
translationsobjectDictionary of field key to locale-value pairs
401Unauthorized
404Not Found

Esempi di codice

curl -X GET "https://api.contit.cloud/v2/preview-contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di risposta 200
{
  "id": "d4e5f6a7-b8c9-0123-defg-456789012345",
  "fields": {
    "title": "Draft Article",
    "body": "<p>Work in progress...</p>",
    "status": "draft"
  },
  "translations": {
    "title": {
      "en": "Draft Article",
      "it": "Bozza Articolo"
    }
  }
}
Prova Live
PUT /v2/preview-contents/{contentTypeKey} V2

Create or update preview content (V2)

Create or update a draft content item using the V2 flat-dictionary model.

Richiede la policy WriteAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
id string — Content item ID. Omit to create.
fields object Flat dictionary of field key to value
translations object — Translations dictionary
clientInfo string — Optional client identifier

Risposte

200Success
idstringContent item ID
fieldsobjectFlat field dictionary
translationsobjectTranslations dictionary
401Unauthorized

Esempi di codice

curl -X PUT "https://api.contit.cloud/v2/preview-contents/{contentTypeKey}" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "id_value",
  "fields": "fields_value",
  "translations": "translations_value",
  "clientInfo": "clientInfo_value"
}'
Esempio di richiesta
{
  "fields": {
    "title": "New Draft",
    "body": "<p>Draft content</p>"
  },
  "translations": {
    "title": {
      "en": "New Draft",
      "it": "Nuova Bozza"
    }
  },
  "clientInfo": "cms-editor-v2"
}
Esempio di risposta 200
{
  "id": "a7b8c9d0-e1f2-3456-hijk-234567890123",
  "fields": {
    "title": "New Draft",
    "body": "<p>Draft content</p>"
  },
  "translations": {
    "title": {
      "en": "New Draft",
      "it": "Nuova Bozza"
    }
  }
}
Prova Live