Creating Your First API
This guide walks you through creating your first API using the FG API platform.
Before You Start
Make sure you have:
- ✅ An approved FG API account
- ✅ Access to the platform dashboard
- ✅ A clear idea of what data you want to collect
Step-by-Step Guide
Step 1: Access the Flow Builder
- Log into your FG API account
- Click "Flow" in the sidebar navigation
- You'll see the Flow Builder interface
Step 2: Name Your Endpoint
In Section 1: Endpoint Setup
Enter a descriptive name for your API endpoint
- Example:
user-feedback,contact-form,product-inquiry
- Example:
Click "Create" to create the endpoint
You'll see a confirmation that your endpoint is ready
Step 3: Configure Fields
Move to Section 2: Field Configuration
Click "Add Field" to add data fields
For each field, configure:
- Field Name: The parameter name (e.g.,
name,email,message) - Data Type: Choose from string, number, boolean, array, or object
- Field Type: Choose from text, single_select, multi_select, date, or object
- Required: Check if this field is mandatory
- Active: Check to enable the field
- Field Name: The parameter name (e.g.,
Step 4: Test Your Configuration
- Review your endpoint and fields
- Make sure all required fields are marked
- Verify field types match your data needs
Step 5: Deploy Your API
- Click "Complete Setup"
- Your API is now live and ready to use
- You'll receive the API endpoint URL
Example: Contact Form API
Let's create a simple contact form API:
Endpoint Setup
Name:
contact-formDescription: Collect contact form submissions
Field Configuration
Name Field
Field Name:
nameData Type:
stringField Type:
textRequired: ✅ Yes
Active: ✅ Yes
Email Field
Field Name:
emailData Type:
stringField Type:
textRequired: ✅ Yes
Active: ✅ Yes
Message Field
Field Name:
messageData Type:
stringField Type:
textRequired: ✅ Yes
Active: ✅ Yes
Subject Field
Field Name:
subjectData Type:
stringField Type:
single_selectOptions:
General Inquiry,Support,Sales,OtherRequired: ✅ Yes
Active: ✅ Yes
Using Your API
Once created, your API is available at:
POST https://your-api-domain.com/api/contact-formExample Request
{
"name": "John Doe",
"email": "john@example.com",
"message": "I'd like to learn more about your services",
"subject": "General Inquiry"
}Example Response
{
"success": true,
"message": "Contact form submitted successfully",
"data": {
"id": "cmf1234567890",
"name": "John Doe",
"email": "john@example.com",
"message": "I'd like to learn more about your services",
"subject": "General Inquiry",
"created_at": "2024-01-15T10:30:00Z"
}
}Field Types Explained
Text Fields
Use for: Names, emails, messages, descriptions
Data Type:
stringField Type:
text
Select Fields
Single Select: Choose one option from a list
Multi Select: Choose multiple options from a list
Data Type:
stringorarrayField Type:
single_selectormulti_select
Date Fields
Use for: Birthdays, event dates, deadlines
Data Type:
stringField Type:
date
Number Fields
Use for: Ages, quantities, prices
Data Type:
numberField Type:
text(with number validation)
Boolean Fields
Use for: Yes/No questions, checkboxes
Data Type:
booleanField Type:
text
Best Practices
Naming Conventions
Use lowercase with hyphens for endpoint names:
user-profile,order-trackingUse descriptive field names:
first_name,email_address,phone_numberKeep names consistent across your APIs
Field Configuration Help
Mark essential fields as required
Use appropriate data types for validation
Provide clear field names that users understand
Testing
Test your API with sample data
Verify all required fields work correctly
Check that optional fields are truly optional
Next Steps
Need Help?
Check the API Reference
Contact support through the platform
Review the API Reference for technical details