Onoff
AI-generatedSummary
Perform various actions with the Onoff API such as retrieving call records, fetching contacts, downloading call recordings as MP3 files, sending SMS messages, and creating or updating contacts.
Inputs
- Action (required) — Select the action to perform: 'Fetch Calls' to retrieve call records with optional filters (caller number, callee number, date range); 'Fetch Contacts' to retrieve the contact list; 'Download Call Recording' to download a call's recording by providing the call ID; 'Send SMS' to send a text message to a specified phone number with given content; 'Upsert Contact' to create or update a contact with first name, last name, phone number, and optionally email.
- Phone Number — The phone number to use for sending SMS or upserting a contact (required for 'Send SMS' and 'Upsert Contact').
- Content — The text content of the SMS to send (required for 'Send SMS').
- Call ID — The identifier of the call to download the recording for (required for 'Download Call Recording').
- Firstname — The contact's first name (required for 'Upsert Contact').
- Lastname — The contact's last name (required for 'Upsert Contact').
- Email — The email address of the contact (optional for 'Upsert Contact').
- Filter For Calls — Optional filters to apply when fetching calls: caller number, callee number, date from, and date to.
Output shape
A list of call records, contact list, or a single call recording file in binary form, or no output for send SMS and upsert contact actions.
- 'Fetch Calls' returns JSON with a 'calls' array filtered as specified.
- 'Fetch Contacts' returns JSON with a 'contacts' array.
- 'Download Call Recording' outputs binary data under the key 'mp3' with filename and MIME type for an MP3.
- 'Send SMS' and 'Upsert Contact' do not emit output data but perform the respective action.
- Errors during execution are raised per item unless Continue On Fail is enabled, in which case error information is appended to the output items.
Examples
Example 1: Fetch calls between two dates for a specific callee number.
Set Action to 'Fetch Calls', specify 'Callee Number', 'Date From', and 'Date To' filters.
Example 2: Send an SMS message to a phone number.
Set Action to 'Send SMS', enter recipient 'Phone Number' and 'Content' of the SMS.
Example 3: Download the recording of a specific call.
Set Action to 'Download Call Recording', provide the corresponding 'Call ID'.