Complete reference for HTTP status codes, error messages, and troubleshooting guidance for Field Nation API and webhook errors.
Prop
Type
Description
200?OKRequest successful. Response contains requested data.
201?CreatedResource successfully created. Response contains new resource details.
204?No ContentRequest successful but no content to return (e.g., successful DELETE).
When you see these: Your request was processed successfully. No action needed.
These indicate problems with your request that need to be fixed before retrying.
Meaning: The request is malformed or contains invalid parameters.
Common Causes:
Example Error Response:
{
"metadata": {
"timestamp": "2025-01-15T12:00:00Z",
"path": "/api/v1/webhooks"
},
"errors": [
{
"code": 400,
"message": "Invalid request: 'url' must be a valid HTTPS URL"
}
],
"result": {}
}Solution:
Meaning: Authentication failed or access token is invalid/expired.
Common Causes:
Authorization headerExample Error Response:
{
"metadata": {
"timestamp": "2025-01-15T12:00:00Z"
},
"errors": [
{
"code": 401,
"message": "Invalid or expired access token"
}
],
"result": {}
}Solution:
Authorization: Bearer {token} header is includedMeaning: Authentication succeeded but you don't have permission for this resource.
Common Causes:
Solution:
Meaning: The requested resource doesn't exist.
Common Causes:
Example:
# Wrong webhook ID
GET /api/v1/webhooks/wh_invalid
# Returns 404
# Correct
GET /api/v1/webhooks/wh_abc123def456Solution:
Meaning: Request is well-formed but contains semantic errors or fails validation.
Common Causes:
Example Error Response:
{
"metadata": {
"timestamp": "2025-01-15T12:00:00Z"
},
"errors": [
{
"code": 422,
"message": "Validation failed: 'events' must contain at least one valid event name"
}
],
"result": {}
}Solution:
Meaning: You've exceeded the API rate limit.
Common Causes:
Example Error Response:
{
"metadata": {
"timestamp": "2025-01-15T12:00:00Z"
},
"errors": [
{
"code": 429,
"message": "Rate limit exceeded. Retry after 60 seconds."
}
],
"result": {}
}Response Headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1642252800Solution:
X-RateLimit-* headers to track usageX-RateLimit-Reset timestamp before retryingThese indicate problems on Field Nation's side. Implement retry logic for these errors.
Meaning: An unexpected error occurred on Field Nation's servers.
Common Causes:
Solution:
Meaning: Field Nation's gateway received an invalid response from upstream server.
Common Causes:
Solution:
Meaning: Service is temporarily unavailable, usually due to maintenance or overload.
Common Causes:
Solution:
Retry-After header if presentMeaning: Field Nation's gateway didn't receive a response in time.
Common Causes:
Solution:
| Error | Cause | Retry? | Solution |
|---|---|---|---|
| Connection Refused | Endpoint server not running | Yes | Start your server, verify port, check firewall |
| DNS Resolution Failed | Domain doesn't resolve | No | Fix DNS configuration, wait for propagation |
| SSL Certificate Error | Invalid/expired certificate | No | Renew certificate, use valid CA-signed cert |
| Connection Timeout | Endpoint too slow to respond | Yes | Optimize response time, use async processing |
| Signature Verification Failed | Wrong secret or body modified | No | Use correct secret, verify with raw body |
Complete webhook troubleshooting →
Authentication Failure:
Error: OAuth token expired or invalidSolution: Refresh connector authentication in Integration Broker settings.
Field Mapping Error:
Error: Required field 'external_id' is missingSolution: Update field mappings to include all required fields.
Data Type Mismatch:
Error: Cannot convert 'text' to number for field 'priority'Solution: Add data type conversion in field mapping or JSONNET transform.
async function apiRequestWithRetry(url, options, maxRetries = 3) {
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
const response = await fetch(url, options);
// Success
if (response.ok) {
return await response.json();
}
// Client errors - don't retry
if (response.status >= 400 && response.status < 500) {
const error = await response.json();
throw new Error(`Client error: ${JSON.stringify(error.errors)}`);
}
// Server errors - retry with backoff
if (response.status >= 500) {
if (attempt === maxRetries) {
throw new Error(`Max retries exceeded: ${response.status}`);
}
const delay = Math.pow(2, attempt) * 1000; // Exponential backoff
console.log(`Attempt ${attempt} failed, retrying in ${delay}ms...`);
await sleep(delay);
continue;
}
} catch (error) {
if (attempt === maxRetries) throw error;
const delay = Math.pow(2, attempt) * 1000;
await sleep(delay);
}
}
}function logError(error, context) {
console.error('API Error:', {
timestamp: new Date().toISOString(),
error: error.message,
stack: error.stack,
statusCode: error.statusCode,
requestUrl: context.url,
requestMethod: context.method,
requestBody: context.body,
responseBody: context.response
});
}try {
const response = await createWebhook(config);
} catch (error) {
if (error.statusCode === 400) {
// Validation error - fix request
console.error('Invalid request:', error.message);
} else if (error.statusCode === 401) {
// Auth error - refresh token
await refreshAccessToken();
return await createWebhook(config);
} else if (error.statusCode === 429) {
// Rate limit - wait and retry
await sleep(error.retryAfter * 1000);
return await createWebhook(config);
} else if (error.statusCode >= 500) {
// Server error - retry with backoff
return await retryWithBackoff(() => createWebhook(config));
}
}# Verbose curl output
curl -X GET https://api-sandbox.fndev.net/api/v1/webhooks \
-H "Authorization: Bearer YOUR_TOKEN" \
-v
# Save response headers
curl -X GET https://api-sandbox.fndev.net/api/v1/webhooks \
-H "Authorization: Bearer YOUR_TOKEN" \
-D headers.txt
# Follow redirects
curl -X GET https://api-sandbox.fndev.net/api/v1/webhooks \
-H "Authorization: Bearer YOUR_TOKEN" \
-L# Validate JSON syntax
cat payload.json | jq .
# Pretty print
cat payload.json | jq '.'
# Extract specific field
cat payload.json | jq '.errors[0].message'If you encounter errors not covered here:
Last updated on