Skip to content

Procedure: Custom Integrations

TODO: Explain when and why to create custom integration (2-3 paragraphs)

TODO: Describe audience:

  • Technical specialists
  • Integrators
  • Developers

TODO: Use cases:

  • App not in catalog
  • Very specific logic
  • Complicated API
  • Complex transformation

TODO: Components:

  1. Trigger (data input)
  2. Transformation (normalization)
  3. Action (data output)
  4. Error handling

Diagram:

TODO: ASCII diagram

TODO: Before coding:

  • Read API documentation
  • Identify endpoints
  • Required authentication
  • Rate limits
  • Input/output formats

Checklist:

  • Auth documented
  • Endpoints identified
  • Rate limits known
  • Payload example

TODO: Methods:

  • API Key
  • OAuth
  • Bearer token
  • Custom headers

Save securely:

  1. Don’t hardcode credentials
  2. Use environment variables
  3. Or store in Gateway Ion credentials

TODO: Base structure:

  1. Trigger: Manual webhook or scheduled
  2. Action: HTTP request
  3. Transformation: Normalize response
  4. Output: Save or notify

Templating:

TODO: Flow template

TODO: Configure request:

  • Endpoint URL
  • Method (GET, POST, etc)
  • Headers (Authorization, Content-Type)
  • Body (JSON)
  • Timeout

Example:

TODO: HTTP config example

TODO: Process response:

  • Extract relevant data
  • Transform formats
  • Validate types
  • Handle errors

Transformation script:

// TODO: Mapping example
const respuesta = JSON.parse(input.body);
return {
id: respuesta.data.id,
nombre: respuesta.data.name.toUpperCase(),
activo: respuesta.data.is_active
};

TODO: Add validations:

  • Correct status code?
  • Complete data?
  • Correct types?
  • Values in range?

Conditions:

TODO: Validation example

TODO: Error cases:

  • 401: Authentication failed
  • 404: Resource not found
  • 429: Rate limit
  • 500: Server error
  • Timeout

Retry logic:

TODO: Retry pattern

TODO: Test integration:

  1. Manual API request
  2. Test flow with real data
  3. Verify transformation
  4. Test error handling
  5. Verify performance

Test checklist:

  • Happy path works
  • Errors are handled
  • Data transformed correctly
  • Acceptable performance

TODO: Once in production:

  • Logs of each integration
  • Failure alerts
  • Success metrics
  • Periodic review

Integration dashboard:

  • Calls per day
  • Error rate
  • Average time
  • Last error

TODO: Document integration:

  • How it works
  • Required configuration
  • Known limitations
  • Troubleshooting

TODO: Table:

ErrorCauseSolution
”401 Unauthorized”Invalid tokenRefresh token
”429 Rate limit”Too many requestsAdd delay
”Timeout”Slow responseIncrease timeout

TODO: Advice:

  • Use webhooks instead of polling when possible
  • Implement caching
  • Batch requests if possible
  • Validate data early

TODO: Patterns:

  1. Pull integration: Gateway Ion requests data
  2. Push integration: App sends to Gateway Ion
  3. Bidirectional: Both directions
  4. Event-driven: Based on events

TODO: Expand:

  • Performance optimization
  • Multi-tenancy support
  • API versioning
  • Automated testing