Make your first API request
Use the REST API to connect your software to Social Champ. You can list social accounts, schedule posts, manage your queue, and work with calendars.
Want to connect an AI assistant instead? Start with Connect an AI assistant.
1. Get an API key
Create an API key in Social Champ. Your account needs API-key access enabled. If creation is unavailable, check your account's access with Social Champ support.
Choose your terminal below. Replace YOUR_API_KEY with your key. Keep it private and do not include it in shared scripts.
- Bash
- PowerShell
export SOCIALCHAMP_TOKEN='YOUR_API_KEY'
$env:SOCIALCHAMP_TOKEN = 'YOUR_API_KEY'
2. Find a social account
- Bash
- PowerShell
curl 'https://api.socialchamp.com/v1/rest/channels' \
-H "Authorization: Bearer $SOCIALCHAMP_TOKEN"
curl.exe 'https://api.socialchamp.com/v1/rest/channels' `
-H "Authorization: Bearer $env:SOCIALCHAMP_TOKEN"
Example response:
{
"data": [
{
"id": "6512f0a1b2c3d4e5f6a7b8c9",
"name": "My Facebook Page",
"type": "FB_PAGE",
"profileImg": null,
"workspaceId": "6512f0a1b2c3d4e5f6a7b8d0"
}
]
}
A channel is a connected social account, such as a Facebook Page. Copy its id for the next request. The IDs in these examples are placeholders.
3. Schedule a post
Replace the channel ID and choose a future time in UTC. This request creates a real scheduled post.
- Bash
- PowerShell
curl -X POST 'https://api.socialchamp.com/v1/rest/posts' \
-H "Authorization: Bearer $SOCIALCHAMP_TOKEN" \
-H 'Content-Type: application/json' \
--data '{
"text": "Hello from my integration!",
"channelIds": ["6512f0a1b2c3d4e5f6a7b8c9"],
"isScheduled": true,
"dateTime": "2030-01-15T10:00:00Z"
}'
$body = @'
{
"text": "Hello from my integration!",
"channelIds": ["6512f0a1b2c3d4e5f6a7b8c9"],
"isScheduled": true,
"dateTime": "2030-01-15T10:00:00Z"
}
'@
Invoke-RestMethod -Method Post -Uri 'https://api.socialchamp.com/v1/rest/posts' `
-Headers @{Authorization = "Bearer $env:SOCIALCHAMP_TOKEN"} `
-ContentType 'application/json' -Body $body
Read the response before sending another request. A multi-channel request can succeed on some channels and fail on others. Check scheduled, failed, and data.result rather than relying on HTTP 200 alone. See Responses and retries.
4. Check the schedule
- Bash
- PowerShell
curl 'https://api.socialchamp.com/v1/rest/posts/scheduled?limit=25' \
-H "Authorization: Bearer $SOCIALCHAMP_TOKEN"
curl.exe 'https://api.socialchamp.com/v1/rest/posts/scheduled?limit=25' `
-H "Authorization: Bearer $env:SOCIALCHAMP_TOKEN"
Next steps
- Add images, video, or a first comment.
- Preview and delete scheduled posts.
- Browse every REST endpoint.
- Build an integration for other users with OAuth.
Use POST /posts for new integrations. The older POST /post remains available with a different request format.