API documentation for ProductFlo - AI powered engineering platform for hardware product development
// Login const response = await fetch('https://api.productflo.io/auth/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'user@example.com', password: 'your-password' }) }); const { session } = await response.json(); const token = session.access_token; // Authenticated request const profileResponse = await fetch('https://api.productflo.io/profile', { headers: { 'Authorization': `Bearer ${token}`, 'X-Tenant-ID': 'tenant-123' } });
// Connect to WebSocket const socket = new WebSocket('wss://api.productflo.io/ws?token=' + token); // Send a message socket.send(JSON.stringify({ type: 'chat', room_id: 'conversation_123', data: { message: 'Hello team, I've updated the design.', sender: 'user_456' } })); // Listen for messages socket.onmessage = (event) => { const data = JSON.parse(event.data); console.log('Received:', data); };
const response = await fetch('https://api.productflo.io/image-generation-openai', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'A photorealistic smart thermostat with a touch screen interface', nbr_images: 3 }) }); const { generated_images } = await response.json();