meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| api [2025/11/28 16:22] – API revision as of 28 NOV 25 47.54.102.121 | api [2026/09/10 16:47] (current) – link to developer.itflow.org wrongecho | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== API ====== | ====== API ====== | ||
| - | + | Use ITFlow' | |
| - | Use ITFlow' | + | |
| The current version of the ITFlow API is v1. It can be accessed at **itflow.example.com/ | The current version of the ITFlow API is v1. It can be accessed at **itflow.example.com/ | ||
| - | ===== Generating an API Key ===== | + | We are in the process |
| - | + | ||
| - | - Login and navigate to the **Admin Settings** page | + | |
| - | - Select **API Keys** | + | |
| - | - Select **Create** to open the New Key modal | + | |
| - | - On Details tab, input the key name and expiration date. Select whether the key will allow access to all clients or a specific client | + | |
| - | - On Keys tab, note down the API key and credential password and select the checkbox to confirm you've made a copy of the keys. You will not see these admin in the admin interface. | + | |
| - | - Select Create to add the key into the database | + | |
| - | + | ||
| - | ===== Modules with API support at present ===== | + | |
| - | + | ||
| - | * assets | + | |
| - | * certificates | + | |
| - | * clients | + | |
| - | * contacts | + | |
| - | * credentials (logins) | + | |
| - | * documents | + | |
| - | * domains | + | |
| - | * expenses | + | |
| - | * invoices | + | |
| - | * locations | + | |
| - | * networks | + | |
| - | * payments | + | |
| - | * products | + | |
| - | * quotes | + | |
| - | * software | + | |
| - | * tickets | + | |
| - | * vendors | + | |
| - | + | ||
| - | + | ||
| - | ===== API Functions ===== | + | |
| - | + | ||
| - | * read | + | |
| - | * create // | + | |
| - | * update // | + | |
| - | * delete // | + | |
| - | + | ||
| - | + | ||
| - | * //We may also add archive// | + | |
| - | + | ||
| - | ===== Request Methods ===== | + | |
| - | + | ||
| - | * GET - Retrieving (READ) data | + | |
| - | * POST - Inserting (CREATE), Updating (UPDATE) or Deleting (DELETE) data | + | |
| - | + | ||
| - | ==== Data Returned ==== | + | |
| - | + | ||
| - | * Success - True/ | + | |
| - | * Message - Failure info / Helpful debug info | + | |
| - | * Count - Count of rows affected/ | + | |
| - | * Data - The data requested/ | + | |
| - | + | ||
| - | + | ||
| - | ==== Notes ==== | + | |
| - | + | ||
| - | * For read requests, 50 records | + | |
| - | * For POST requests, the '' | + | |
| - | * Be sure to check your Apache/PHP error logs if you're running into issues | + | |
| - | + | ||
| - | ==== API Docs/ | + | |
| - | + | ||
| - | Documentation / an example | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | + | ||
| - | ====== API ====== | + | |
| - | + | ||
| - | Use ITFlow' | + | |
| - | + | ||
| - | The current version of the ITFlow API is v1. It can be accessed at **itflow.example.com/ | + | |
| ===== Generating an API Key ===== | ===== Generating an API Key ===== | ||
| Line 100: | Line 27: | ||
| * expenses | * expenses | ||
| * invoices | * invoices | ||
| + | * invoice_items | ||
| * locations | * locations | ||
| * networks | * networks | ||
| Line 136: | Line 64: | ||
| * For POST requests, the '' | * For POST requests, the '' | ||
| * Be sure to check your Apache/PHP error logs if you're running into issues | * Be sure to check your Apache/PHP error logs if you're running into issues | ||
| + | * To prevent your server from accidentally logging API keys, see [[api_apache-logging|here]] | ||
| ---- | ---- | ||
| Line 611: | Line 540: | ||
| ---- | ---- | ||
| + | |||
| + | ===== Invoice Items ''/ | ||
| + | |||
| + | **Purpose**: | ||
| + | |||
| + | **Available Endpoints**: | ||
| + | * '' | ||
| + | |||
| + | ==== Read Parameters (GET) ==== | ||
| + | |||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | invoice_id | integer | Filter items by invoice ID | | ||
| + | | item_id | integer | Get a specific line item by ID | | ||
| + | |||
| + | ==== Response Fields ==== | ||
| + | |||
| + | ^ Field ^ Type ^ Description ^ | ||
| + | | item_id | integer | Unique line item ID | | ||
| + | | item_name | string | Name/title of the line item | | ||
| + | | item_description | string | Description or notes | | ||
| + | | item_quantity | decimal | Quantity billed | | ||
| + | | item_price | decimal | Unit price | | ||
| + | | item_subtotal | decimal | quantity × price | | ||
| + | | item_tax | decimal | Tax amount applied | | ||
| + | | item_total | decimal | subtotal + tax | | ||
| + | | item_order | integer | Display sort order | | ||
| + | | item_tax_id | integer | Associated tax rate ID (0 = no tax) | | ||
| + | | item_product_id | integer | Associated product ID (0 = ad-hoc item) | | ||
| + | | item_invoice_id | integer | Parent invoice ID | | ||
| + | | item_created_at | datetime | Record creation timestamp | | ||
| + | | item_updated_at | datetime | Last update timestamp | | ||
| + | | item_archived_at | datetime | Archive timestamp (null if active) | | ||
| + | |||
| + | ==== Example - Get all items for an invoice ==== | ||
| + | |||
| + | <code bash> | ||
| + | curl " | ||
| + | </ | ||
| + | |||
| + | ==== Example Response ==== | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | </ | ||
| ==== Locations ''/ | ==== Locations ''/ | ||
| Line 971: | Line 966: | ||
| | Expenses | ✓ | - | - | - | - | - | | | Expenses | ✓ | - | - | - | - | - | | ||
| | Invoices | ✓ | - | - | - | - | - | | | Invoices | ✓ | - | - | - | - | - | | ||
| + | | [[# | ||
| | Locations | ✓ | ✓ | - | - | - | - | | | Locations | ✓ | ✓ | - | - | - | - | | ||
| | Networks | ✓ | - | - | - | - | - | | | Networks | ✓ | - | - | - | - | - | | ||