General - Assets

Created: 2022-01-09 11:12:39 || Updated: 2022-04-28 16:48:18

Manage your client's laptops, servers and networking gear with the assets module.


Asset Information

The following information can be recorded for each asset:

  • Name
  • Type (Desktop/Laptop/Server/Mobile, etc)
  • Make/Manufacturer
  • Model
  • Serial Number
  • OS
  • IP & MAC addresses
  • Vendor
  • Purchase, install, and warranty dates
  • Notes

Assets can also be associated with other data in ITFlow, such as:

  • Clients
  • Locations
  • Networks
  • Logins
  • Referenced in tickets
  • Services

Asset Export to CSV

  • You can easily export assets for a client using the Export button when viewing assets for a particular client
  • Assets are exported in a CSV in the format:
    • Name, Type, Make, Model, Serial Number, OS, Purchase Date, Warranty Expire, Install Date, Assigned To, Location, Notes

Asset Import via CSV

  • You can import a list of assets for a client using the Import button and uploading a CSV
  • The CSV must be in the following format (with headings):
    • Name, Type, Make, Model, Serial Number, OS



    API

    /api/v1/assets

    Read - Retrieve asset information (/read.php)

    • Default / No params - Returns all assets
    • asset_id - Specific asset ID from the ITFlow database
    • asset_name - Asset Name
    • asset_type - Type of asset (e.g. Laptop, Desktop, Server, etc)
    • asset_serial - Asset Serial Number
    • client_id - Returns all assets for a specific client

    Invoke-RestMethod -Uri "http://127.0.0.1/itflow/api/v1/assets/read.php?api_key=XetQjoZiti5Opg7y&asset_id=7" | ConvertTo-Json

    {
        "success":  "True",
        "count":  1,
        "data":  [
                     {
                         "0":  "7",
                         "asset_id":  "7",
                         "1":  "Laptop",
                         "asset_type":  "Laptop",
                         "2":  "Sample Laptop",
                         "asset_name":  "Sample Laptop",

    [...]


    Create - Create a new asset (/create.php)

    Specify parameters as below. The new asset ID will be returned.

    $uri = "http://127.0.0.1/itflow/api/v1/assets/create.php"

    $body = @"
    {
        "api_key" : "XetQjoZiti5Opg7y",
        "asset_name" : "Sample Laptop",
        "asset_type" : "Laptop",
        "asset_make" : "Dell",
        "asset_model" : "Optiplex",
        "asset_serial" : "XYZ",
        "asset_os" : "Win 10",
        "asset_ip" : "",
        "asset_mac" : "",
        "asset_purchase_date" : "",
        "asset_warranty_expire" : "",
        "install_date" : "",
        "asset_notes" : "",
        "asset_vendor_id" : "",
        "asset_location_id" : "",
        "asset_contact_id" : "",
        "asset_network_id" : "",
        "client_id" : "1"
    }
    "@

    Invoke-RestMethod -Method Post -Uri $uri -Body $body

    success count data             
    ------- ----- ----             
    True    1     {@{insert_id=41}}


    Update - Update attributes of an existing asset (/update.php)

    Only parameters specified are changed, remove parameters you don't want to modify. Client ID is required if the API key has access to all clients. True/False is returned.

    $uri = "http://127.0.0.1/itflow/api/v1/assets/update.php"

    $body = @"
    {
        "api_key" : "XetQjoZiti5Opg7y",
        "asset_name" : "Sample Changed Laptop",
        "asset_type" : "Laptop",
        "asset_make" : "Dell",
        "asset_model" : "Optiplex",
        "asset_serial" : "XYZ",
        "asset_os" : "Win 10",
        "asset_ip" : "",
        "asset_mac" : "",
        "asset_purchase_date" : "",
        "asset_warranty_expire" : "",
        "install_date" : "",
        "asset_notes" : "",
        "asset_vendor_id" : "",
        "asset_location_id" : "",
        "asset_contact_id" : "",
        "asset_network_id" : "",
        "client_id" : "1"
    }
    "@

    Invoke-RestMethod -Method Post -Uri $uri -Body $body

    success count
    ------- -----
    True        1




    Deprecated - Asset Add via API

    • Assets can also be added/imported via the API
    • The API query to /api.php must include the following information
      • api_key - You can find this at /settings-general.php
      • client_id - Client to relate the asset with
      • add_asset - Name of the asset
      • type - Asset type. Accepted values are: Laptop, Desktop, Server, Phone, Mobile Phone, Tablet, Firewall/Router, Switch, Access Point, Printer, Camera, TV, Virtual Machine, Other
      • make - Manufacturer of the asset
      • model - Model of the asset
      • serial - S/N of the asset
      • os - Operating System
    • Example:
      • > Invoke-RestMethod -Uri "http://127.0.0.1/itflow/api.php?api_key=IhgiLuryNAdwZs7&client_id=1&add_asset=MyAssetName&type=Desktop&make=Dell&model=XPS&serial=XXYYY&os=Win10"
        • Response: Asset added!