Onoff icon

Onoff

Onoff API

Overview

This node integrates with the Onoff API to manage telephony-related tasks such as retrieving call records, managing contacts, sending SMS messages, and downloading call recordings. It is useful in scenarios where users want to automate communication workflows, analyze call data, or maintain contact lists programmatically.

Practical examples include:

  • Fetching recent calls within a date range for reporting.
  • Downloading specific call recordings for quality assurance.
  • Sending SMS notifications or alerts automatically.
  • Creating or updating contact information in bulk from other systems.

Properties

Name Meaning
Action The operation to perform. Options: "Download Call Recording", "Fetch Calls", "Fetch Contacts", "Send SMS", "Upsert Contact".
Phone Number (For Send SMS) The recipient phone number to send the SMS to.
Content (For Send SMS) The text content of the SMS message.
Call ID (For Download Call Recording) The unique identifier of the call whose recording to download.
Firstname (For Upsert Contact) The first name of the contact to create or update.
Lastname (For Upsert Contact) The last name of the contact to create or update.
Email (For Upsert Contact) The email address of the contact.
Filter For Calls (For Fetch Calls) Collection of filters to narrow down call records: Caller Number, Callee Number, Date From, Date To.

Output

The node outputs JSON data structured according to the selected action:

  • Fetch Calls: Outputs an object with a calls array containing call record objects filtered by the specified criteria.
  • Fetch Contacts: Outputs an object with a contacts array listing contact details.
  • Download Call Recording: Outputs JSON with a filename field and binary data under binary.mp3 containing the MP3 audio of the call recording.
  • Send SMS: No direct output JSON; the action sends an SMS message.
  • Upsert Contact: No direct output JSON; the action creates or updates a contact.

If binary data is present (in the case of downloading call recordings), it represents the audio file of the call in MP3 format.

Dependencies

  • Requires an active connection to the Onoff API via an API authentication token.
  • Needs appropriate credentials configured in n8n to authenticate requests.
  • Uses an internal helper library (libs/onoff) to interact with the Onoff API endpoints.

Troubleshooting

  • Authentication Errors: Ensure the API token credential is correctly set up and has not expired.
  • Invalid Call ID: When downloading recordings, verify that the provided Call ID exists and is accessible.
  • Missing Required Fields: Actions like sending SMS or upserting contacts require mandatory fields (e.g., phone number, firstname, lastname). Missing these will cause errors.
  • Filtering Issues: When fetching calls, incorrect date formats or invalid phone numbers in filters may result in empty results or errors.
  • API Rate Limits: Excessive requests might be throttled by the Onoff API; consider adding delays or handling retries.

Error messages typically indicate which input parameter caused the failure or if there was an issue communicating with the API. Reviewing the error context and ensuring all required inputs are valid usually resolves common problems.

Links and References

Discussion