EN IT

Quickstart

This guide gets you from zero to your first API call in under 5 minutes.

Prerequisites

  • A Contit account at app.contit.cloud
  • A workspace with at least one Content Type
  • API credentials (Client ID + Secret, or an API Key)

Step 1 — Get an access token

curl -X POST https://idp.contit.cloud/connect/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"

Copy the access_token from the response.


Step 2 — List your content types

curl https://api.contit.cloud/content-types \
  -H "Authorization: Bearer YOUR_TOKEN"

You'll get back an array of Content Type definitions. Note the id field — that's the key you'll use in all content operations.


Step 3 — Fetch content

Replace myContentType with a key from the previous step:

curl -X POST https://api.contit.cloud/v2/contents/myContentType \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page": 1, "pageSize": 10}'

Step 4 — Create content (V2)

curl -X PUT https://api.contit.cloud/v2/contents/myContentType \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "title": "My first item",
      "body": "Hello from the Contit API!"
    }
  }'

The response includes the full content item with its assigned id.


Using the .NET SDK

If you're using .NET, install the official SDK:

dotnet add package ContitApi
var client = new ContitClient(
    new ClientContitConfiguration("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET"));

// Fetch content
var result = await client.Content.Get<MyModel>("myContentType",
    new ContentsRequest { Page = 1, PageSize = 10 });

// Create content
await client.Content.AddOrUpdate("myContentType", new ContentModel
{
    Fields = [
        new TextContentField { Key = "title", Value = "My first item" }
    ]
});

See the SDK on NuGet for full reference.


Next steps