End-to-end guide for setting up REST Connector integration from OpenAPI spec to production deployment.
Sources:
/docs)Direct URLs to Check:
https://your-api.com/swagger.json
https://your-api.com/api-docs
https://your-api.com/openapi.yaml
https://your-api.com/v1/openapi.jsonUse online or CLI tools:
# Swagger Editor (online)
https://editor.swagger.io/
# CLI Validation
npm install -g swagger-cli
swagger-cli validate openapi.json
# Or using Docker
docker run --rm -v $(pwd):/spec openapitools/openapi-generator-cli validate -i /spec/openapi.jsonCheck For:
Map your business flow to API endpoints:
| Field Nation Event | External API Endpoint | Purpose |
|---|---|---|
| Work order created | POST /tickets | Create record |
| Work order updated | PATCH /tickets/{id} | Update record |
| Need field schema | GET /tickets/metadata | Get fields |
| Query record data | GET /tickets/{id} | Fetch record |
| Attachment added | POST /tickets/{id}/files | Upload file |
In your external system:
Store securely:
Username: api_integration_user
Password: [secure password]
Format for Field Nation: username:password
Base URL: https://api.example.com/v1Verify with curl:
# Test authentication
curl -u "username:password" \
https://api.example.com/v1/metadata
# Test endpoint access
curl -u "username:password" \
https://api.example.com/v1/tickets
# Test record creation (optional)
curl -u "username:password" \
-X POST \
-H "Content-Type: application/json" \
-d '{"title":"Test","description":"Integration test"}' \
https://api.example.com/v1/ticketsNavigate to Integration Broker:
Select "REST Connector"
.json or .yaml)Record Metadata:
GET /api/v1/metadataRecord Fetch:
GET /api/v1/tickets/{id}Record Create:
POST /api/v1/ticketsRecord Update:
PATCH /api/v1/tickets/{id}Attachments Upload (optional):
POST /api/v1/tickets/{id}/filesFormat: username:password
Example: integration_user:securePass123!
Click "Test Connection" button
External System → Field Nation
Configure how external records become FN work orders:
Required Fields:
External Field → FN Field Action
──────────────────────────────────────────────────────────
ticket_title → title Sync
ticket_description → description Sync
customer_name → location.company.name Sync
scheduled_date → schedule.start Date Convert
priority_code → priority Array MapOptional Fields:
contact_email → contact.email Sync
service_address → location.address1 Sync
special_instructions → instructions Sync
estimated_duration → time_estimate SyncField Nation → External System
Configure how FN events update external records:
Status Updates:
FN Field → External Field Action
──────────────────────────────────────────────────────────
status.name → ticket_status Array Map
assignee.user.name → technician_name Sync
completion_notes → resolution Sync
completion_date → completed_at Date ConvertStatus Mapping (Array Map):
{
"source": "status_code",
"target": "priority",
"action": "array_map",
"mappings": [
{ "compare": "1", "value": "Low" },
{ "compare": "2", "value": "Medium" },
{ "compare": "3", "value": "High" },
{ "compare": "4", "value": "Critical" }
],
"default": "Medium"
}Date Conversion:
{
"source": "created_date",
"target": "schedule.start",
"action": "date_convert",
"input_format": "YYYY-MM-DD",
"output_format": "YYYY-MM-DD HH:mm:ss",
"timezone_in": "UTC",
"timezone_out": "America/New_York"
}Custom Logic (JSONNET):
{
"target": "custom_priority",
"action": "custom",
"script": |||
local status = $.util.lookup_field($.input, 'status', '');
local amount = $.util.lookup_field($.input, 'amount', 0);
if status == 'urgent' && amount > 500 then
"P1-Critical"
else if status == 'urgent' then
"P2-High"
else if amount > 1000 then
"P2-High"
else
"P3-Normal"
|||
}Click "Save" to persist field mapping configuration
Scenario 1: Basic Work Order Creation
Expected Result:
Scenario 2: Bidirectional Sync
Expected Result:
Scenario 3: External → Field Nation
Expected Result:
Scenario 4: Error Handling
Check:
Field Nation → Integrations → Logs
Set range covering your test period
Success Logs:
Error Logs:
401 Unauthorized:
Error: Authentication failed
Solution: Verify credentials correct400 Bad Request:
Error: Invalid field value for 'priority'
Solution: Check Array Map values match API expectations404 Not Found:
Error: Endpoint /api/v1/ticket not found
Solution: Verify endpoint URL, check for typosIf tested in sandbox:
If using webhooks:
Start Small:
After successful soft launch:
Last updated on