This guide walks you through making your first API call to Publive.
Step 1: Get your API credentials
The Publive API uses HTTP Basic Auth. You need your API Key, API Secret, and Publisher ID.
- Log in to your Publive Dashboard.
- Navigate to configurations > API Developer Hub.
- Click the View API credentials button.
- Copy your API Key and API Secret.
- Note your Publisher ID from the dashboard URL.
If you do not have dashboard access, please reach out via our contact page.
Generate your Base64 token by running:
echo -n 'YOUR_API_KEY:YOUR_API_SECRET' | base64
Important: Keep your API credentials secure. Never expose them in client-side code or public repositories.
Step 2: Make your first API call
Fetch your published posts using the Content Delivery API:
curl -X GET \
'https://cds.thepublive.com/publisher/YOUR_PUBLISHER_ID/posts/?limit=5' \
-H 'Authorization: Basic <BASE64_AUTH_TOKEN>'
Step 3: Understand the response
{
"status": "ok",
"data": [
{
"id": 12345,
"title": "My First Article",
"slug": "my-first-article",
"type": "Article",
"primary_category": {
"id": 1,
"name": "News",
"slug": "news"
},
"contributors": [
{
"id": 1,
"name": "John Doe",
"slug": "john-doe"
}
],
"content_html": "<p>Article content here...</p>",
"absolute_url": "/news/my-first-article-12345"
}
],
"message": "",
"page_no": 1,
"per_page": 5
}
That’s it! You’ve successfully fetched content from Publive. The response includes the full post object with title, content, categories, tags, authors, and metadata.
Step 4: Create content via CMS API
To create a new post programmatically, use the Content Management API:
curl -X POST \
'https://cms.thepublive.com/publisher/YOUR_PUBLISHER_ID/post/' \
-H 'Authorization: Basic <BASE64_AUTH_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"title": "My API-Created Post",
"english_title": "My API-Created Post",
"type": "Article",
"status": "Draft",
"primary_category": 1,
"content": "<p>Hello from the API!</p>"
}'
What’s next?