Quick Start
Quick Start
This guide will help you make your first API call in under 5 minutes.
Prerequisites
- A Flow account with an active subscription
- An API key (see Authentication)
- At least one connected social account
Step 1: Install the SDK
npm install @flowdev/sdkOr use the API directly with any HTTP client.
Step 2: Initialize the Client
import { Flow } from '@flowdev/sdk';
const flow = new Flow('flow_sk_live_...');Step 3: Create a Post
// Create and schedule a postconst post = await flow.posts.create({ channel: 'your-channel-id', content: '🚀 Hello from the Flow API!', scheduledFor: new Date(Date.now() + 3600000).toISOString(), // 1 hour from now});
console.log('Post created:', post.id);Step 4: Check Post Status
// Get post detailsconst postDetails = await flow.posts.get(post.id);console.log('Status:', postDetails.status);Using cURL
If you prefer to use cURL:
# Create a postcurl -X POST https://api.flowsocial.app/v1/posts \ -H "Authorization: Bearer flow_sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "channel": "your-channel-id", "content": "🚀 Hello from the Flow API!", "scheduledFor": "2024-01-15T10:00:00Z" }'Next Steps
- Explore the API Reference
- Learn about Channels
- Set up Webhooks for real-time updates
- Browse SDK Examples