Training Day

API

API's are a foundation of most but not all integrations.

Application Programming Interfaces (APIs) provide the foundational communication layer for most modern integrations. Understanding APIs is essential for building robust, scalable, and maintainable integration solutions.

What is an API?

An API (Application Programming Interface) defines the methods and data structures that applications use to communicate with each other. In integration contexts:

  • APIs provide structured access to system functionality and data
  • They establish contracts between systems about how they will interact
  • They enable decoupling of systems while maintaining communication

API Types Common in Integrations

REST APIs

Representational State Transfer (REST) APIs are the most common type used in modern integrations.

Key characteristics:

  • Uses standard HTTP methods (GET, POST, PUT, DELETE)
  • Typically returns data in JSON or XML format
  • Resource-oriented with URLs representing entities
  • Stateless design where each request contains all needed information

When to use REST APIs:

  • For most web and cloud service integrations
  • When working with modern SaaS platforms
  • When simplicity and broad compatibility are important

SOAP APIs

Simple Object Access Protocol (SOAP) is an older but still common protocol, especially in enterprise systems.

Key characteristics:

  • XML-based messaging protocol
  • Includes built-in error handling
  • More rigid structure with formal contracts (WSDL)
  • Protocol-independent (can work over HTTP, SMTP, etc.)

When to use SOAP APIs:

  • When integrating with legacy enterprise systems
  • When formal contracts and type safety are required
  • When working with systems that mandate SOAP

GraphQL APIs

A newer query language for APIs that allows clients to request exactly the data they need.

Key characteristics:

  • Single endpoint that accepts complex queries
  • Client specifies exactly what data to return
  • Reduces over-fetching and under-fetching of data
  • Strongly typed schema

When to use GraphQL:

  • When clients need to request varying data structures
  • To reduce network overhead by combining multiple requests
  • For more complex data requirements

Webhooks

Event-based messaging where an API sends data to your system when certain events occur.

Key characteristics:

  • "Reversed" API calls initiated by the sender
  • Event-driven architecture
  • Real-time updates without polling

When to use Webhooks:

  • For real-time notifications and updates
  • To avoid constant polling for changes
  • When building event-driven architectures

API Design Considerations for Integration

Versioning Strategy

How you manage changes to your APIs over time:

  • URL-based versioning (/api/v1/users)
  • Header-based versioning (Accept: application/vnd.company.v2+json)
  • Parameter-based versioning (?version=2)

Good versioning strategies are critical for maintaining compatibility as systems evolve.

API Styles

Different architectural approaches to API design:

  • Resource-oriented - Focused on entities and CRUD operations
  • Action-oriented - Focused on operations and procedures
  • Hypermedia-driven - Includes navigation links in responses

The style you choose affects how easily systems can be integrated and maintained.

Request/Response Format

Common formats include:

  • JSON (most common for modern APIs)
  • XML (common in legacy systems)
  • Protocol Buffers (for high-performance APIs)

Error Handling

Establishing consistent error responses with:

  • Status codes that clearly indicate the issue
  • Error messages that guide resolution
  • Error codes for programmatic handling

APIs and Other Integration Fundamentals

APIs are interrelated with many other fundamental integration concepts:

APIs in FileMaker Integration

FileMaker can both consume external APIs and expose functionality as an API:

Consuming APIs from FileMaker

FileMaker provides methods for consuming external APIs:

  • Insert from URL script step for simple HTTP requests
  • Plug-ins for SOAP and other less common protocols

Exposing FileMaker as an API

FileMaker can expose its functionality through:

  • Data API - REST API for accessing FileMaker data
  • OData API - Standards-based API following the Open Data Protocol for interoperability
  • Custom API endpoints using the Data API with custom scripts

API Best Practices for Integration

  • Design for change - APIs will evolve; plan for it from the start
  • Documentation - Clear, comprehensive documentation is essential
  • Consistency - Follow consistent patterns in your API design
  • Security - Implement proper authentication and authorization
  • Rate limiting - Protect systems from excessive traffic
  • Monitoring - Track API usage, performance, and errors
  • Testing - Automated testing ensures reliable operation

Conclusion

APIs form the backbone of most integration projects, providing the structured interfaces through which systems communicate. Understanding API types, design principles, and best practices is essential for creating robust, maintainable integrations that can evolve with your business needs.