API e Integração

API Quick Start Guide

96 visualizações

Getting Started with the BlogFlux API

Learn how to integrate BlogFlux into your applications using our REST API.

🔑 Step 1: Get Your API Key

  1. Log in to your BlogFlux dashboard
  2. Go to Settings > API Keys
  3. Click "Generate New API Key"
  4. Copy and save your key securely

⚠️ Security Warning

Never expose your API key in client-side code or public repositories!

📡 Base URL

https://blogflux.ai/api/v1

🔐 Authentication

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

📝 Example: Generate a Post

cURL

curl -X POST https://blogflux.ai/api/v1/posts/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "How to train a golden retriever",
    "ai_model": "gpt-5-mini",
    "language": "en"
  }'

Python

import requests

url = "https://blogflux.ai/api/v1/posts/generate"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "topic": "How to train a golden retriever",
    "ai_model": "gpt-5-mini",
    "language": "en"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

JavaScript (Node.js)

const fetch = require('node-fetch');

const url = 'https://blogflux.ai/api/v1/posts/generate';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    topic: 'How to train a golden retriever',
    ai_model: 'gpt-5-mini',
    language: 'en'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(data => console.log(data));

✅ Response Format

{
  "status": "success",
  "data": {
    "post_id": "abc123",
    "title": "How to Train a Golden Retriever: Complete Guide",
    "content": "...",
    "status": "completed"
  }
}

🔍 Error Codes

Code Meaning Solution
400 Bad Request Check your request parameters
401 Unauthorized Verify your API key
429 Rate Limit Wait before retrying
500 Server Error Contact support

📚 Next Steps

For complete API reference with all available endpoints, parameters, and examples, visit our interactive API documentation:

📖 Full API Documentation (Swagger UI)

Este artigo foi útil?

Artigos Relacionados

Ainda precisa de ajuda?

Não encontrou o que procura? Nossa equipe de suporte está aqui para ajudar.

Contatar Suporte

Preferências de Cookies

Usamos cookies para melhorar sua experiência de navegação, analisar o tráfego do site e personalizar o conteúdo. Ao clicar em "Aceitar Todos", você concorda com o nosso uso de cookies. Saiba mais