Postman Collection
The FWURL Postman collection provides a convenient way to explore and test our API endpoints.
What is Postman?
Postman is a popular API development tool that makes it easy to:
- Test API endpoints
- Organize requests
- Save responses
- Share collections with teams
- Generate code snippets
If you don't have Postman, download it here.
Importing the Collection
Method 1: Direct Import
- Open Postman
- Click Import in the top left
- Select Link tab
- Paste the collection URL:
https://api.fwurl.com/postman/collection.json - Click Continue and then Import
Method 2: Manual Download
- Download the collection: FWURL API Collection
- Open Postman
- Click Import
- Drag and drop the downloaded file
- Click Import
Setting Up
Configure Environment
- In Postman, click Environments in the sidebar
- Click Create Environment
- Name it "FWURL API"
- Add these variables:
| Variable | Initial Value | Current Value |
|---|---|---|
baseUrl | https://api.fwurl.com/v1 | https://api.fwurl.com/v1 |
apiKey | your_api_key_here | your_api_key_here |
- Click Save
- Select "FWURL API" from the environment dropdown
Get Your API Key
- Log in to FWURL Dashboard
- Go to Settings > API
- Click Generate API Key
- Copy the key
- Paste it in the
apiKeyenvironment variable
Collection Structure
The collection is organized into folders:
Links
- Create Link
- Get Link
- Update Link
- Delete Link
- List Links
Analytics
- Get Link Analytics
- Get Account Analytics
Domains
- List Domains
- Add Domain
- Verify Domain
- Delete Domain
QR Codes
- Generate QR Code
Using the Collection
Making Your First Request
- Expand the Links folder
- Click Create Link
- In the Body tab, you'll see:
{
"url": "https://example.com",
"customSlug": "test-link"
}- Modify the URL to your desired destination
- Click Send
- View the response in the bottom panel
Understanding Requests
Each request includes:
Headers:
- Authorization (automatically includes your API key)
- Content-Type (application/json)
Body:
- Pre-filled with example data
- Modify as needed for your use case
Tests:
- Automatic validation of responses
- Extracts data for use in other requests
Variables
The collection uses variables for reusability:
Environment Variables:
{{baseUrl}}- API base URL{{apiKey}}- Your API key
Collection Variables:
{{linkId}}- Auto-populated after creating a link{{domainId}}- Auto-populated after adding a domain
Example Workflows
Create and Analyze a Link
-
Create Link
- Run:
POST /links - Note the
idin the response
- Run:
-
Get Link Analytics
- The
linkIdis automatically set - Run:
GET /analytics/:linkId - View click statistics
- The
Add Custom Domain
-
Add Domain
- Run:
POST /domains - Copy DNS records from response
- Run:
-
Configure DNS
- Add records to your domain
- Wait for propagation
-
Verify Domain
- Run:
POST /domains/:domainId/verify - Check verification status
- Run:
Code Generation
Postman can generate code in various languages:
-
Click on any request
-
Click the Code icon (
</>symbol) in the top right -
Select your language:
- JavaScript (Fetch/Axios)
- Python (Requests)
- cURL
- PHP
- Ruby
- And many more
-
Copy the code snippet
-
Use in your application
Example Generated Code
JavaScript (Fetch):
const response = await fetch('https://api.fwurl.com/v1/links', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com',
customSlug: 'my-link'
})
});
const data = await response.json();
console.log(data);Python (Requests):
import requests
url = "https://api.fwurl.com/v1/links"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"url": "https://example.com",
"customSlug": "my-link"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())Testing and Validation
Each request includes automated tests:
Response Tests
// Status code validation
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
// Response structure validation
pm.test("Response has success field", function () {
pm.expect(pm.response.json()).to.have.property('success');
});
// Save link ID for later use
pm.test("Save link ID", function () {
const response = pm.response.json();
pm.environment.set("linkId", response.data.id);
});Running Tests
- Select a folder or the entire collection
- Click Run in the top right
- Choose requests to run
- Click Run [Collection Name]
- View test results
Troubleshooting
Authentication Errors
If you receive 401 Unauthorized:
- Check that your API key is correct
- Ensure the
apiKeyenvironment variable is set - Verify the environment is selected
- Try generating a new API key
Connection Errors
If requests fail to connect:
- Check your internet connection
- Verify the
baseUrlis correct - Check for firewall/proxy issues
- Try disabling SSL verification (for testing only)
Rate Limit Errors
If you receive 429 Too Many Requests:
- Wait for the rate limit to reset
- Check the
X-RateLimit-Resetheader - Consider upgrading your plan
- Implement request throttling
Sharing with Team
Export Collection
- Right-click the collection
- Select Export
- Choose Collection v2.1
- Share the JSON file
Publish to Workspace
- Right-click the collection
- Select Share
- Choose your workspace
- Set permissions (View/Edit)
Keep Collection Updated
The FWURL API evolves over time. To get updates:
- Watch for collection update notifications
- Re-import the collection periodically
- Follow our Changelog
- Join our Developer Community
Next Steps
- Explore all API Endpoints
- Read about Authentication
- Check out Code Examples