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/06/09 15:26] – added "API Reference Guide" dalton | api [2025/11/28 16:22] (current) – API revision as of 28 NOV 25 47.54.102.121 | ||
|---|---|---|---|
| Line 22: | Line 22: | ||
| * contacts | * contacts | ||
| * credentials (logins) | * credentials (logins) | ||
| + | * documents | ||
| * domains | * domains | ||
| + | * expenses | ||
| + | * invoices | ||
| + | * locations | ||
| * networks | * networks | ||
| + | * payments | ||
| + | * products | ||
| + | * quotes | ||
| * software | * software | ||
| * tickets | * tickets | ||
| + | * vendors | ||
| Line 65: | Line 73: | ||
| ---- | ---- | ||
| + | |||
| + | ====== API ====== | ||
| + | |||
| + | Use ITFlow' | ||
| + | |||
| + | The current version of the ITFlow API is v1. It can be accessed at **itflow.example.com/ | ||
| + | |||
| + | ===== Generating an API Key ===== | ||
| + | |||
| + | - 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 again in the admin interface. | ||
| + | - Select Create to add the key into the database | ||
| + | |||
| + | ===== Modules with API support ===== | ||
| + | |||
| + | * assets | ||
| + | * certificates | ||
| + | * clients | ||
| + | * contacts | ||
| + | * credentials (logins) | ||
| + | * documents | ||
| + | * domains | ||
| + | * expenses | ||
| + | * invoices | ||
| + | * locations | ||
| + | * networks | ||
| + | * payments | ||
| + | * products | ||
| + | * quotes | ||
| + | * software | ||
| + | * tickets | ||
| + | * vendors | ||
| + | |||
| + | ===== API Functions ===== | ||
| + | |||
| + | * read | ||
| + | * create //(partial - see module details)// | ||
| + | * update //(partial - see module details)// | ||
| + | * delete //(partial - see module details)// | ||
| + | * archive //(clients and contacts only)// | ||
| + | * unarchive //(clients and contacts only)// | ||
| + | * resolve //(tickets only)// | ||
| + | |||
| + | ===== Request Methods ===== | ||
| + | |||
| + | * GET - Retrieving (READ) data | ||
| + | * POST - Inserting (CREATE), Updating (UPDATE), Deleting (DELETE), or Archiving data | ||
| + | |||
| + | ==== Data Returned ==== | ||
| + | |||
| + | * Success - True/False | ||
| + | * Message - Failure info / Helpful debug info | ||
| + | * Count - Count of rows affected/ | ||
| + | * Data - The data requested/ | ||
| + | |||
| + | ==== Notes ==== | ||
| + | |||
| + | * For read requests, 50 records are shown by default. This can be adjusted by supplying the '' | ||
| + | * For POST requests, the '' | ||
| + | * Be sure to check your Apache/PHP error logs if you're running into issues | ||
| + | |||
| + | ---- | ||
| ====== API Reference Guide ====== | ====== API Reference Guide ====== | ||
| Line 96: | Line 169: | ||
| ===== API Overview ===== | ===== API Overview ===== | ||
| - | |||
| - | **Source**: ITFlow official documentation at docs.itflow.org/ | ||
| * **Base URL**: ''/ | * **Base URL**: ''/ | ||
| Line 108: | Line 179: | ||
| ==== Standard Response Format ==== | ==== Standard Response Format ==== | ||
| - | |||
| - | **Source**: ITFlow official API documentation | ||
| <code json> | <code json> | ||
| Line 120: | Line 189: | ||
| " | " | ||
| " | " | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Create Response Format ==== | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| } | } | ||
| ] | ] | ||
| Line 131: | Line 214: | ||
| * **Generation**: | * **Generation**: | ||
| * **Scoping Options**: | * **Scoping Options**: | ||
| - | * **All Clients**: Full access to all client data | + | * **All Clients** |
| - | * **Specific Client**: Limited to single client | + | * **Specific Client**: Limited to single client |
| - | * **Usage**: Query parameter ''? | + | * **Usage**: Query parameter ''? |
| - | * **Security**: | + | * **Security**: |
| ==== Best Practices ==== | ==== Best Practices ==== | ||
| - | |||
| - | **Source**: MSP community recommendations and security standards | ||
| * **Rotate keys** regularly (monthly recommended) | * **Rotate keys** regularly (monthly recommended) | ||
| Line 146: | Line 227: | ||
| * **Use HTTPS only** for all API calls | * **Use HTTPS only** for all API calls | ||
| - | ===== Currently Available Modules ===== | + | ---- |
| - | **Source**: ITFlow official API documentation confirms these modules have API support: | + | ===== Module Reference ===== |
| ==== Assets ''/ | ==== Assets ''/ | ||
| Line 154: | Line 235: | ||
| **Purpose**: | **Purpose**: | ||
| - | **Source**: [[https:// | + | **Available Endpoints**: |
| * '' | * '' | ||
| Line 161: | Line 242: | ||
| * '' | * '' | ||
| - | **Complete Fields** | + | **Read Parameters |
| - | <code json> | + | ^ Parameter ^ Type ^ Description ^ |
| - | { | + | | asset_id | integer | Get specific asset by ID | |
| - | " | + | | asset_type | string | Filter by asset type (auto-capitalized) | |
| - | " | + | | asset_name | string | Filter by exact asset name | |
| - | " | + | | asset_serial | string | Filter by serial number | |
| - | " | + | | asset_mac | string | Filter by MAC address (searches primary interface) | |
| - | " | + | | asset_uri | string | Filter by URI | |
| - | " | + | |
| - | " | + | **Create/ |
| - | "asset_os" | + | |
| - | "asset_ip": "", | + | ^ Parameter ^ Type ^ Required (Create) ^ Description ^ |
| - | "asset_mac": | + | | api_key | string | Yes | API authentication key | |
| - | "asset_status": "Deployed", | + | | client_id |
| - | "asset_purchase_date": "0000-00-00", | + | | asset_name |
| - | "asset_warranty_expire": "0000-00-00", | + | | asset_description | string | No | Asset description | |
| - | "install_date": "0000-00-00", | + | | asset_type |
| - | "asset_notes": "", | + | | asset_make |
| - | "asset_vendor_id": "", | + | | asset_model |
| - | "asset_location_id": "", | + | | asset_serial | string | No | Serial number | |
| - | "asset_contact_id": "", | + | | asset_os | string | No | Operating system | |
| - | "asset_network_id": "" | + | | asset_ip | string | No | IP address (stored in primary interface) | |
| - | } | + | | asset_mac | string | No | MAC address (stored in primary interface) | |
| + | | asset_uri | string | No | Management URL | | ||
| + | | asset_status | string | No | Status (Deployed, Spare, etc.) | | ||
| + | | asset_purchase_date | date | No | Purchase date (YYYY-MM-DD) | | ||
| + | | asset_warranty_expire | date | No | Warranty expiration date | | ||
| + | | asset_install_date | date | No | Installation date | | ||
| + | | asset_notes | string | No | Notes | | ||
| + | | asset_vendor_id | integer | No | Associated vendor ID | | ||
| + | | asset_location_id | integer | No | Associated location ID | | ||
| + | | asset_contact_id | integer | No | Associated contact ID | | ||
| + | | asset_network_id | integer | No | Network ID for primary interface | | ||
| + | |||
| + | **Update Additional Parameters**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | asset_id | integer | Yes | ID of asset to update | | ||
| + | |||
| + | **Delete Parameters**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | asset_id | integer | Yes | ID of asset to delete | | ||
| + | |||
| + | <wrap em>Note: Deleting an asset also removes all associated network interfaces.</ | ||
| + | |||
| + | **Example - Create Asset**: | ||
| + | |||
| + | <code bash> | ||
| + | curl -X POST "https:// | ||
| + | | ||
| + | | ||
| + | | ||
| + | "client_id": | ||
| + | "asset_name": "DESKTOP-001", | ||
| + | "asset_type": "Desktop", | ||
| + | "asset_make": "Dell", | ||
| + | "asset_model": "OptiPlex 7090", | ||
| + | "asset_serial": "ABC123XYZ", | ||
| + | "asset_os": "Windows 11 Pro", | ||
| + | "asset_ip": "192.168.1.100", | ||
| + | "asset_mac": "00: | ||
| + | "asset_status": "Deployed" | ||
| + | }' | ||
| </ | </ | ||
| + | |||
| + | ---- | ||
| ==== Certificates ''/ | ==== Certificates ''/ | ||
| Line 191: | Line 315: | ||
| **Purpose**: | **Purpose**: | ||
| - | **Source**: [[https:// | + | **Available Endpoints**: |
| * '' | * '' | ||
| * '' | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | **Complete Fields** (from ITFlow Certificates API Documentation): | + | <wrap em>Note: Update and delete endpoints are not implemented.</ |
| - | <code json> | + | **Read Parameters (GET)**: |
| - | { | + | |
| - | " | + | ^ Parameter ^ Type ^ Description ^ |
| - | " | + | | certificate_id |
| - | " | + | | certificate_name | string | Filter by certificate name | |
| - | " | + | |
| - | " | + | **Create Parameters (POST)**: |
| - | " | + | |
| - | " | + | ^ Parameter ^ Type ^ Required ^ Description ^ |
| - | " | + | | api_key | string | Yes | API authentication key | |
| - | " | + | | client_id |
| - | } | + | | certificate_name |
| - | </ | + | | certificate_domain |
| + | | certificate_description | string | No | Description | | ||
| + | | certificate_issued_by | string | No | Issuing authority (e.g., Let's Encrypt) | | ||
| + | | certificate_expire | date | No | Expiration date (YYYY-MM-DD) | | ||
| + | | certificate_public_key | ||
| + | | certificate_notes | ||
| + | | certificate_domain_id | integer | No | Link to domains table | | ||
| + | |||
| + | ---- | ||
| ==== Clients ''/ | ==== Clients ''/ | ||
| Line 218: | Line 348: | ||
| **Purpose**: | **Purpose**: | ||
| - | **Source**: [[https:// | + | **Available Endpoints**: |
| * '' | * '' | ||
| * '' | * '' | ||
| * '' | * '' | ||
| - | * '' | + | * '' |
| + | * '' | ||
| - | **Complete Fields** (from ITFlow Clients API Documentation): | + | <wrap em>Note: Delete endpoint is not implemented. Use archive instead.</ |
| - | <code json> | + | **Read Parameters (GET)**: |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | </ | + | |
| - | <wrap em>Note: Full field list is partially documented. The API returns numbered keys alongside named keys in the response format.</ | + | ^ Parameter ^ Type ^ Description ^ |
| + | | client_name | string | Get specific client by exact name | | ||
| + | |||
| + | **Create Parameters (POST)**: | ||
| + | |||
| + | <wrap em>Important: Creating clients requires an API key with "All Clients" | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | api_key | string | Yes | API authentication key (must be all-client scope) | | ||
| + | | client_name | string | Yes | Client/ | ||
| + | | client_type | string | No | Business type/ | ||
| + | | client_website | string | No | Website URL (https:// prefix auto-removed) | | ||
| + | | client_referral | string | No | Referral source | | ||
| + | | client_rate | decimal | No | Hourly rate | | ||
| + | | client_currency_code | string | No | Currency code (e.g., USD) | | ||
| + | | client_net_terms | integer | No | Payment terms in days | | ||
| + | | client_tax_id_number | string | No | Tax ID/EIN | | ||
| + | | client_abbreviation | string | No | Short code (max 6 chars) | | ||
| + | | client_is_lead | integer | No | Lead flag (0 or 1) | | ||
| + | | client_notes | string | No | Additional notes | | ||
| + | |||
| + | **Update Additional Parameters**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | client_id | integer | Yes | ID of client to update | | ||
| + | |||
| + | **Archive/ | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | client_id | integer | Yes | ID of client (from API key scope) | | ||
| + | |||
| + | <wrap em>Note: Archiving a client automatically stops all recurring invoices for that client.</ | ||
| + | |||
| + | ---- | ||
| ==== Contacts ''/ | ==== Contacts ''/ | ||
| Line 243: | Line 399: | ||
| **Purpose**: | **Purpose**: | ||
| - | **Source**: ITFlow official API documentation lists contacts as supported module | + | **Available Endpoints**: |
| * '' | * '' | ||
| Line 249: | Line 405: | ||
| * '' | * '' | ||
| * '' | * '' | ||
| + | * '' | ||
| + | * '' | ||
| - | **Available Fields**: Contact table structure includes fields like '' | + | **Read Parameters (GET)**: |
| + | |||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | contact_id | integer | Get specific contact | ||
| + | | contact_email | string | Get contact by email address | | ||
| + | | contact_phone_or_mobile | string | Get contact by phone or mobile number | | ||
| + | |||
| + | **Create Parameters (POST)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | api_key | string | Yes | API authentication key | | ||
| + | | client_id | integer | Yes* | Required if API key has all-client access | | ||
| + | | contact_name | string | Yes | Full name | | ||
| + | | contact_email | string | Yes | Email address (must be unique per client) | | ||
| + | | contact_title | string | No | Job title | | ||
| + | | contact_department | string | No | Department | | ||
| + | | contact_phone | string | No | Phone number (non-digits stripped) | | ||
| + | | contact_extension | string | No | Phone extension | | ||
| + | | contact_mobile | string | No | Mobile number (non-digits stripped) | | ||
| + | | contact_notes | string | No | Notes | | ||
| + | | contact_primary | integer | No | Primary contact flag (0 or 1) | | ||
| + | | contact_important | integer | No | Important flag (0 or 1) | | ||
| + | | contact_billing | integer | No | Billing contact flag (0 or 1) | | ||
| + | | contact_technical | integer | No | Technical contact flag (0 or 1) | | ||
| + | | contact_location_id | integer | No | Associated location ID | | ||
| + | |||
| + | <wrap em>Note: Setting contact_primary = 1 will remove primary flag from other contacts for that client.</ | ||
| + | |||
| + | **Update Additional Parameters**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | contact_id | integer | Yes | ID of contact to update | | ||
| + | |||
| + | **Delete Parameters**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | contact_id | integer | Yes | ID of contact to delete | | ||
| + | |||
| + | **Archive/ | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | contact_id | integer | Yes | ID of contact to archive/ | ||
| + | |||
| + | <wrap em>Note: Archiving a contact also archives their associated user account if one exists.</ | ||
| + | |||
| + | ---- | ||
| ==== Credentials ''/ | ==== Credentials ''/ | ||
| Line 256: | Line 459: | ||
| **Purpose**: | **Purpose**: | ||
| - | **Source**: ITFlow official API documentation lists credentials (logins) as supported module | + | **Available Endpoints**: |
| * '' | * '' | ||
| * '' | * '' | ||
| * '' | * '' | ||
| - | * '' | ||
| - | **Available Fields**: Database migration scripts confirm | + | <wrap em>Note: Delete endpoint is not implemented.</ |
| + | |||
| + | <wrap em> | ||
| + | |||
| + | **Read Parameters (GET)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | api_key_decrypt_password | string | Yes | Decryption password for the API key | | ||
| + | | credential_id | integer | No | Get specific credential by ID | | ||
| + | |||
| + | **Create Parameters (POST)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | api_key | string | Yes | API authentication key | | ||
| + | | api_key_decrypt_password | string | Yes | Decryption password | | ||
| + | | client_id | integer | Yes* | Required if API key has all-client access | | ||
| + | | credential_name | string | Yes | Credential name/label | | ||
| + | | credential_password | string | Yes | Password (will be encrypted) | | ||
| + | | credential_description | string | No | Description | | ||
| + | | credential_uri | string | No | Login URL | | ||
| + | | credential_uri_2 | string | No | Secondary URL | | ||
| + | | credential_username | string | No | Username (will be encrypted) | | ||
| + | | credential_otp_secret | string | No | TOTP/2FA secret | | ||
| + | | credential_note | string | No | Additional notes | | ||
| + | | credential_important | integer | No | Important flag (0 or 1) | | ||
| + | | credential_contact_id | integer | No | Associated contact ID | | ||
| + | | credential_vendor_id | integer | No | Associated vendor ID | | ||
| + | | credential_asset_id | integer | No | Associated asset ID | | ||
| + | | credential_software_id | integer | No | Associated software ID | | ||
| + | |||
| + | **Update Additional Parameters**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | credential_id | integer | Yes | ID of credential to update | | ||
| + | | api_key_decrypt_password | string | Yes | Decryption password | | ||
| + | |||
| + | <wrap em>Note: Updating the password field automatically updates the password_changed_at timestamp.</ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Documents | ||
| + | |||
| + | **Purpose**: | ||
| + | |||
| + | **Available Endpoints**: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | <wrap em>Note: Delete endpoint is not implemented.</ | ||
| + | |||
| + | **Read Parameters (GET)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | document_id | integer | Get specific document by ID | | ||
| + | |||
| + | **Create Parameters (POST)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | api_key | string | Yes | API authentication key | | ||
| + | | client_id | integer | Yes* | Required if API key has all-client access | | ||
| + | | document_name | string | Yes | Document title | | ||
| + | | document_content | string | Yes | Document content (HTML supported) | | ||
| + | | document_description | string | No | Brief description | | ||
| + | | document_folder_id | integer | No | Folder ID for organization | | ||
| + | |||
| + | **Update Additional Parameters**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | document_id | integer | Yes | ID of document to update | | ||
| + | |||
| + | ---- | ||
| ==== Domains ''/ | ==== Domains ''/ | ||
| Line 269: | Line 543: | ||
| **Purpose**: | **Purpose**: | ||
| - | **Source**: [[https:// | + | **Available Endpoints**: |
| * '' | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | **Complete Fields** (from ITFlow Domains API Documentation): | + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</ |
| - | <code json> | + | **Read Parameters (GET)**: |
| - | { | + | |
| - | " | + | ^ Parameter ^ Type ^ Description ^ |
| - | " | + | | domain_id |
| - | " | + | | domain_name | string | Get domain by exact name | |
| - | " | + | |
| - | | + | **Response Fields**: |
| - | "domain_expire": | + | |
| - | " | + | ^ Field ^ Type ^ Description ^ |
| - | " | + | | domain_id | integer | Primary key | |
| - | | + | | domain_name |
| - | " | + | | domain_description | string | Description | |
| - | } | + | | domain_expire | date | Expiration date | |
| - | </code> | + | | domain_ip | string | IP address(es) | |
| + | | domain_name_servers | string | Name servers | | ||
| + | | domain_mail_servers | string | MX records | | ||
| + | | domain_txt | string | TXT records | | ||
| + | | domain_raw_whois | string | Raw WHOIS data | | ||
| + | | domain_notes | string | Notes | | ||
| + | | domain_registrar | ||
| + | | domain_webhost | integer | Web host vendor ID | | ||
| + | | domain_dnshost | integer | DNS host vendor ID | | ||
| + | | domain_mailhost | integer | Mail host vendor ID | | ||
| + | | domain_client_id | integer | Client ID | | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Expenses ''/ | ||
| + | |||
| + | **Purpose**: Track business expenses | ||
| + | |||
| + | **Available Endpoints**: | ||
| + | |||
| + | | ||
| + | |||
| + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</ | ||
| + | |||
| + | <wrap em> | ||
| + | |||
| + | **Read Parameters (GET)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | expense_id | integer | Get specific expense by ID | | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Invoices ''/ | ||
| + | |||
| + | **Purpose**: Access invoice records | ||
| + | |||
| + | **Available Endpoints**: | ||
| + | |||
| + | * '' | ||
| + | |||
| + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</ | ||
| + | |||
| + | **Read Parameters (GET)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | invoice_id | integer | Get specific invoice by ID | | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Locations ''/ | ||
| + | |||
| + | **Purpose**: | ||
| + | |||
| + | **Available Endpoints**: | ||
| + | |||
| + | * '' | ||
| + | | ||
| + | |||
| + | <wrap em>Note: Update and delete endpoints are not implemented.</ | ||
| + | |||
| + | **Read Parameters (GET)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Description ^ | ||
| + | | location_id | integer | Get specific location by ID | | ||
| + | |||
| + | **Create Parameters (POST)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | api_key | string | Yes | API authentication key | | ||
| + | | client_id | integer | Yes* | Required if API key has all-client access | | ||
| + | | location_name | string | Yes | Location name | | ||
| + | | location_description | string | No | Description | | ||
| + | | location_country | string | No | Country | | ||
| + | | location_address | string | No | Street address | | ||
| + | | location_city | string | No | City | | ||
| + | | location_state | string | No | State/ | ||
| + | | location_zip | string | No | ZIP/postal | ||
| + | | location_hours | string | No | Business hours | | ||
| + | | location_notes | string | No | Notes | | ||
| + | | location_primary | integer | No | Primary location flag (0 or 1) | | ||
| + | |||
| + | <wrap em>Note: Setting location_primary = 1 will remove primary flag from other locations for that client.</ | ||
| + | |||
| + | ---- | ||
| ==== Networks ''/ | ==== Networks ''/ | ||
| Line 297: | Line 652: | ||
| **Purpose**: | **Purpose**: | ||
| - | **Source**: ITFlow official API documentation lists networks as supported module | + | **Available Endpoints**: |
| * '' | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | **Available Fields**: Database migration scripts show network interface relationships, but complete API field specification requires further documentation. | + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</ |
| - | ==== Software ''/ | + | **Read Parameters (GET)**: |
| - | **Purpose**: | + | ^ Parameter ^ Type ^ Description ^ |
| + | | network_id | integer | Get specific network by ID | | ||
| + | | network_name | string | Get network by exact name | | ||
| - | **Source**: ITFlow official API documentation lists software as supported module | + | ---- |
| - | * '' | + | ==== Payments |
| - | * '' | + | |
| - | * '' | + | |
| - | * '' | + | |
| - | **Status**: Module confirmed as available but dedicated documentation page not found. Database includes software table as confirmed by installation scripts. | + | **Purpose**: Access payment records |
| - | ==== Tickets ''/ | + | **Available Endpoints**: |
| - | **Purpose**: Help desk and issue tracking | + | |
| - | **Source**: [[https:// | + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</wrap> |
| - | * '' | + | <wrap em> |
| - | * '' | + | |
| - | * '' | + | |
| - | * '' | + | |
| - | **Complete Fields** | + | **Read Parameters |
| - | <code json> | + | ^ Parameter ^ Type ^ Description ^ |
| - | { | + | | payment_id | integer | Get specific payment by ID | |
| - | " | + | | payment_invoice_id | integer | Get all payments for an invoice | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | </ | + | |
| - | <wrap em>Note: Full field list is partially documented. The API returns numbered keys alongside named keys in the response format.</ | + | ---- |
| - | ===== Current API Capabilities ===== | + | ==== Products ''/ |
| - | ==== Standard Operations (All Modules) ==== | + | **Purpose**: |
| - | | + | **Available Endpoints**: |
| - | * **CREATE**: Add new records with validation (partial support) | + | |
| - | * **UPDATE**: Modify existing records (partial support) | + | |
| - | * **DELETE**: Remove records (partial support) | + | |
| - | ==== Query Parameters (read.php | + | * '' |
| - | * '' | + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</ |
| - | * '' | + | |
| - | * '' | + | |
| - | * API key required on all requests | + | |
| - | ==== Response Format (Standardized) ==== | + | <wrap em> |
| - | <code json> | + | **Read Parameters (GET)**: |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | { | + | |
| - | // Record data with both numbered and named keys | + | |
| - | } | + | |
| - | ] | + | |
| - | } | + | |
| - | </ | + | |
| - | ===== Current Authentication ===== | + | ^ Parameter ^ Type ^ Description ^ |
| + | | product_id | integer | Get specific product by ID | | ||
| - | ==== API Key Generation ==== | + | ---- |
| - | - Navigate to Admin panel in ITFlow | + | ==== Quotes ''/ |
| - | - Click on API section | + | |
| - | - Click **New Key** to generate | + | |
| - | - Choose scope: specific client or all clients | + | |
| - | - Copy generated key for use | + | |
| - | ==== API Key Usage ==== | + | **Purpose**: |
| - | | + | **Available Endpoints**: |
| - | * **Format**: ''? | + | |
| - | * **Scope**: Can be limited to specific client or all clients | + | |
| - | * **Access**: Currently all-or-nothing permissions | + | |
| - | ==== Security Features ==== | + | * '' |
| - | * **Encrypted Storage**: API keys stored securely | + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</ |
| - | * **Client Scoping**: Keys can be limited to specific clients | + | |
| - | * **Access Logging**: API usage tracked in logs | + | |
| - | ===== Current Limitations ===== | + | **Read Parameters (GET)**: |
| - | ==== Missing CRUD Operations ==== | + | ^ Parameter ^ Type ^ Description ^ |
| + | | quote_id | integer | Get specific quote by ID | | ||
| - | * **UPDATE**: Limited support across modules | + | ---- |
| - | * **DELETE**: Limited support across modules | + | |
| - | * **ARCHIVE**: | + | |
| - | ==== Missing Advanced Features | + | ==== Software ''/ |
| - | | + | **Purpose**: Software license and application tracking |
| - | * **Advanced Search**: No full-text search or complex filtering | + | |
| - | * **Webhooks**: | + | |
| - | * **File Upload**: No direct file management API | + | |
| - | * **Relationships**: Limited cross-module data retrieval | + | |
| - | ==== Missing Business Modules ==== | + | **Available Endpoints**: |
| - | * **Invoices/Billing**: No financial transaction APIs | + | * '' |
| - | * **Quotes**: No sales proposal management | + | |
| - | * **Time Tracking**: No billable hour recording | + | |
| - | * **Calendar**: | + | |
| - | * **Reports**: | + | |
| - | ==== Authentication Limitations ==== | + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</ |
| - | | + | **Read Parameters (GET)**: |
| - | * **OAuth**: Only API key authentication available | + | |
| - | ===== API Usage Examples ===== | + | ^ Parameter ^ Type ^ Description ^ |
| + | | software_id | integer | Get specific software by ID | | ||
| + | | software_name | string | Get by exact name | | ||
| + | | software_type | string | Filter by type | | ||
| - | ==== Get All Clients ==== | + | ---- |
| - | <code bash> | + | ==== Tickets '' |
| - | GET /api/v1/clients/read.php? | + | |
| - | </ | + | |
| - | ==== Get Specific Asset ==== | + | **Purpose**: |
| - | <code bash> | + | **Available Endpoints**: |
| - | GET / | + | |
| - | </ | + | |
| - | ==== Create | + | * '' |
| + | * '' | ||
| + | * '' | ||
| - | <code bash> | + | <wrap em>Note: Update and delete endpoints are not implemented.</wrap> |
| - | POST / | + | |
| - | Content-Type: | + | |
| - | { | + | **Read Parameters (GET)**: |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | </ | + | |
| - | ==== List Client | + | ^ Parameter ^ Type ^ Description ^ |
| + | | ticket_id | integer | Get specific ticket by ID (includes status information) | | ||
| + | |||
| + | **Create Parameters (POST)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | api_key | string | Yes | API authentication key | | ||
| + | | client_id | integer | No | Client | ||
| + | | ticket_subject | string | Yes | Ticket subject/ | ||
| + | | ticket_details | string | No | Ticket description | | ||
| + | | ticket_priority | string | No | Priority (Low, Medium, High) - defaults to " | ||
| + | | ticket_contact_id | integer | No | Contact ID (auto-selects primary contact if not provided) | | ||
| + | | ticket_asset_id | integer | No | Related asset ID | | ||
| + | | ticket_vendor_id | integer | No | Escalation vendor ID | | ||
| + | | ticket_vendor_ticket_id | integer | No | Vendor' | ||
| + | | ticket_assigned_to | integer | No | Assigned user ID | | ||
| + | | ticket_billable | integer | No | Billable flag (0 or 1) | | ||
| + | |||
| + | <wrap em>Note: Ticket number is auto-generated based on system settings. Ticket source is set to " | ||
| + | |||
| + | **Resolve Parameters (POST)**: | ||
| + | |||
| + | ^ Parameter ^ Type ^ Required ^ Description ^ | ||
| + | | ticket_id | integer | Yes | ID of ticket to resolve | | ||
| + | |||
| + | <wrap em>Note: Resolving sets status to Resolved and records the resolution timestamp. Also sets first response time if not already set.</ | ||
| + | |||
| + | **Example - Create Ticket**: | ||
| <code bash> | <code bash> | ||
| - | GET /api/v1/assets/read.php?api_key=YOUR_KEY& | + | curl -X POST " |
| + | -H " | ||
| + | -d '{ | ||
| + | "api_key": " | ||
| + | "client_id": | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }' | ||
| </ | </ | ||
| - | ===== Integration Capabilities ===== | + | ---- |
| - | ==== What Works Today ==== | + | ==== Vendors ''/ |
| - | | + | **Purpose**: Manage vendor/supplier records |
| - | * **Client Management**: | + | |
| - | * **Asset Tracking**: Computer and equipment inventory | + | |
| - | * **Ticket Creation**: Help desk ticket automation | + | |
| - | * **Documentation**: | + | |
| - | ==== What's Missing for Full Automation ==== | + | **Available Endpoints**: |
| - | * **Financial Operations**: | + | * '' |
| - | * **Real-time Events**: No webhook triggers for automation | + | |
| - | * **Bulk Data Sync**: No efficient mass data operations | + | |
| - | * **File Management**: | + | |
| - | * **Advanced Workflows**: | + | |
| - | ===== Error Handling & Troubleshooting ===== | + | <wrap em>Note: Create, update, and delete endpoints are not implemented.</ |
| - | ==== Standard Error Codes ==== | + | **Read Parameters (GET)**: |
| - | **Source**: HTTP standard codes - ITFlow API observed behavior | + | ^ Parameter ^ Type ^ Description ^ |
| + | | vendor_id | integer | Get specific vendor by ID | | ||
| - | * **200**: Success | + | ---- |
| - | * **400**: Bad Request | + | |
| - | * **401**: Unauthorized | + | |
| - | * **403**: Forbidden | + | |
| - | * **404**: Not Found - Endpoint or record doesn' | + | |
| - | * **500**: Server Error - Internal ITFlow error | + | |
| - | ==== Common Error Messages | + | ===== Custom API Extensions ===== |
| - | **Source**: Observed API responses | + | **Location**: ''/ |
| - | <code json> | + | ITFlow supports custom |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | </ | + | |
| - | ==== Troubleshooting Steps ==== | + | ---- |
| - | **Source**: Community experience | + | ===== Error Handling & Troubleshooting ===== |
| + | |||
| + | ==== HTTP Status Codes ==== | ||
| + | |||
| + | ^ Code ^ Description ^ | ||
| + | | 200 | Success - Request completed successfully | | ||
| + | | 401 | Unauthorized - Invalid or missing API key | | ||
| + | | 405 | Method Not Allowed - Only GET and POST supported | | ||
| + | |||
| + | ==== Common Error Messages ==== | ||
| + | |||
| + | ^ Message ^ Cause ^ | ||
| + | | " | ||
| + | | "No resource (for this client and company) with the specified parameter(s)." | ||
| + | | "Auth success but insert query failed..." | ||
| + | | "Auth success but update query failed..." | ||
| + | | "Auth success but delete query failed..." | ||
| + | |||
| + | ==== Troubleshooting Steps ==== | ||
| - **API Key Issues** | - **API Key Issues** | ||
| * Verify key is correct (copy/paste errors common) | * Verify key is correct (copy/paste errors common) | ||
| * Check key scope (client-specific vs all clients) | * Check key scope (client-specific vs all clients) | ||
| - | * Confirm key hasn' | + | * Confirm key hasn' |
| - **Permission Errors** | - **Permission Errors** | ||
| Line 528: | Line 861: | ||
| * Check data types (strings, integers, dates) | * Check data types (strings, integers, dates) | ||
| * Verify foreign key relationships exist | * Verify foreign key relationships exist | ||
| + | * Ensure unique constraints aren't violated (e.g., contact email per client) | ||
| - | ==== Debug Mode ==== | + | ---- |
| - | + | ||
| - | **Source**: ITFlow admin settings and [[https:// | + | |
| - | + | ||
| - | Enable PHP error reporting in ITFlow settings for detailed error messages during development. | + | |
| ===== Integration Examples ===== | ===== Integration Examples ===== | ||
| - | ==== PowerShell | + | ==== PowerShell ==== |
| - | + | ||
| - | **Source**: [[https:// | + | |
| **List All Clients**: | **List All Clients**: | ||
| Line 560: | Line 888: | ||
| " | " | ||
| " | " | ||
| - | " | + | " |
| " | " | ||
| } | ConvertTo-Json | } | ConvertTo-Json | ||
| Line 567: | Line 895: | ||
| </ | </ | ||
| - | ==== PHP Examples ==== | + | ==== Python ==== |
| - | + | ||
| - | <code php> | + | |
| - | <?php | + | |
| - | $api_key = ' | + | |
| - | $base_url = ' | + | |
| - | + | ||
| - | // Get clients | + | |
| - | $url = $base_url . ' | + | |
| - | $response = file_get_contents($url); | + | |
| - | $data = json_decode($response, | + | |
| - | + | ||
| - | print_r($data); | + | |
| - | ?> | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Python | + | |
| <code python> | <code python> | ||
| Line 609: | Line 921: | ||
| print(result) | print(result) | ||
| </ | </ | ||
| + | |||
| + | ==== PHP ==== | ||
| + | |||
| + | <code php> | ||
| + | <?php | ||
| + | $api_key = ' | ||
| + | $base_url = ' | ||
| + | |||
| + | // Get clients | ||
| + | $url = $base_url . ' | ||
| + | $response = file_get_contents($url); | ||
| + | $data = json_decode($response, | ||
| + | |||
| + | print_r($data); | ||
| + | ?> | ||
| + | </ | ||
| + | |||
| + | ==== cURL ==== | ||
| + | |||
| + | <code bash> | ||
| + | # Get all assets for a client | ||
| + | curl " | ||
| + | |||
| + | # Create a contact | ||
| + | curl -X POST " | ||
| + | -H " | ||
| + | -d '{ | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }' | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== API Module Summary ===== | ||
| + | |||
| + | ^ Module ^ Read ^ Create ^ Update ^ Delete ^ Archive ^ Other ^ | ||
| + | | Assets | ✓ | ✓ | ✓ | ✓ | - | - | | ||
| + | | Certificates | ✓ | ✓ | - | - | - | - | | ||
| + | | Clients | ✓ | ✓ | ✓ | - | ✓ | unarchive | | ||
| + | | Contacts | ✓ | ✓ | ✓ | ✓ | ✓ | unarchive | | ||
| + | | Credentials | ✓ | ✓ | ✓ | - | - | - | | ||
| + | | Documents | ✓ | ✓ | ✓ | - | - | - | | ||
| + | | Domains | ✓ | - | - | - | - | - | | ||
| + | | Expenses | ✓ | - | - | - | - | - | | ||
| + | | Invoices | ✓ | - | - | - | - | - | | ||
| + | | Locations | ✓ | ✓ | - | - | - | - | | ||
| + | | Networks | ✓ | - | - | - | - | - | | ||
| + | | Payments | ✓ | - | - | - | - | - | | ||
| + | | Products | ✓ | - | - | - | - | - | | ||
| + | | Quotes | ✓ | - | - | - | - | - | | ||
| + | | Software | ✓ | - | - | - | - | - | | ||
| + | | Tickets | ✓ | ✓ | - | - | - | resolve | | ||
| + | | Vendors | ✓ | - | - | - | - | - | | ||