Configuration - API

Created: 2022-02-26 07:52:34 || Updated: 2022-04-19 16:45:18

Use ITFlow's API to work with ITFlow in scripts and (eventually) third-party apps.

The current version of the ITFlow API is v1. It can be accessed at /api/v1/{module}/{function}.php

Modules with API support at present

  • assets
  • certificates
  • contacts
  • domains
  • networks
  • software
  • tickets

API Functions

  • read
  • create (partial)
  • update (partial)

Generating an API Key

  • Navigate to the Admin panel
  • Click on API
  • Click on New Key to generate a new key

Request Methods

  • GET - Retrieving (READ) data
  • POST - Inserting (CREATE), Updating (UPDATE) or Deleting (DELETE) data

Data Returned

  • Success - True/False
  • Message - Failure info / Helpful debug info
  • Count - Count of rows affected/returned
  • Data - The data requested/created/changed

Notes

  • For read requests, 50 records are shown by default. This can be adjusted by supplying the limit and offset parameters.
  • For POST requests, the client_id parameter is always required if the API key used has scope/access to all clients

API Docs/Examples

Documentation / an example of how to use a module API endpoint is shown on that module's doc page. Additional examples are available here.



Old API

The legacy ITFlow API is accessed at /api.php. We are working on moving all functionality into the new API at /api/. The legacy API has the following features:

  • Caller ID lookup (Great for integrating with your phone system like FreePBX, and having your VOIP phone return the client's name thats calling in) - /api.php?api_key=[API_KEY]&cid=[PHONE_NUMBER] - Returns a name
  • XML Phonebook Download - /api.php?api_key=[API_KEY]&phonebook
  • Client Email (great for mailing lists) - /api.php?api_key=[API_KEY]&client_emails - Returns Client Name - Email Address
  • Account Balance for Client (can be integrated into multiple places for example in FreePBX Press 3 to check account balance, please enter your client ID your balance is) - /api.php?api_key=[API_KEY]&client_id=[CLIENT_ID] - Returns Account Balance
  • Add new asset for a client - /api.php?api_key=[API_KEY]&client_id=ClientID&add_asset=Name&type=[Desktop|Laptop|Server]&make=Make&model=Model&serial=Serial&os=OS
    • Required: api_key, client_id, add_asset (name)