AssetSonar API

Introduction

AssetSonar API is made available to all paying clients to allow for custom integrations. Fair usage policy applies. For the API setting to work, Account Owner must be logged in. To get started, go to Settings --> Add Ons --> API Integration --> Select Enabled (disabled by default). Once done, generate an Access Token. The Access Token will be used to authenticate each request. Please ensure that you keep this secret and regenerate if it is compromised. For security purposes, have each request made over SSL i.e. https. The access token should be provided in the http headers for all requests.
For issues and bug reports, email us at info@assetsonar.com.
Following constants are used in the API documentation:


Constants

    <COMPANY_TOKEN>   Access token generated from the Settings Page.
    <SUBDOMAIN>       Company name used in signup, also visible in the URL when logged in, 
                      e.g. https://<SUBDOMAIN>.assetsonar.com/.
    <ASSET_NAME>      Name of an Asset, must be a minimum of 3 characters. 
    <GROUP_NAME>      Name of a Group, must be a minimum of 3 characters.
    <SUBGROUP_NAME>   Name of a Subgroup, must be a minimum of 3 characters.
    <GROUP_ID>        Each Asset belongs to a Group, represented by a Group ID. 
                      Click here to retrieve Groups.
    <SUBGROUP_ID>     Groups may have subgroups, represented by a Subgroup ID.
                      Click here to retrieve subgroups.
    <LOCATION_NAME>   Name of a Location, must be a minimum of 3 characters.
    <LOCATION_ID>     Each Location has a unique Location ID. Click here to retrieve Locations.
    <CITY_NAME>       The name of the city that the Location is in.
    <PAGE_NUM>        Results returned from each API call are limited in number. 
                      To access the subsequent results, go to the relevant page.
    <ASSET#>          Each Asset has a unique Asset#. Click here to retrieve all assets.
    <COMMENTS>        Assets, Services, Groups, etc can have comments added to them. 
    <USER_ID>         Each User in the system has a unique User ID. Click here to retrieve all Users.
    <SALVAGE_VALUE>   Retired Assets require a salvage value for reporting purposes.
    <QUANTITY>        Quantity of Inventory when adding or removing stock.
    <PRICE>           Price of Inventory per stock item when adding or removing stock.
    <EMAIL_ADDRESS>   Email address of a User.
    <USER_FIRST_NAME> Users first name.
    <USER_LAST_NAME>  Users last name.

Fixed Assets

Fixed Assets are long-term Assets that need to be checked out and checked in to Users. Examples include laptops and iPhones.

Create Asset

Specify fixed_asset[name], fixed_asset[group_id] (see how to retrieve Groups) and fixed_asset[purchased_on]. These fields are mandatory. fixed_asset[location_id] in the command below is an optional field (see how to retrieve Locations). To pass custom fields, specify cust_attr[custom field name] (see how to retrieve custom fields).

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "fixed_asset[name]=<ASSET_NAME>" \
      -d "fixed_asset[group_id]=<GROUP_ID>" \
      -d "fixed_asset[sub_group_id]=<SUB_GROUP_ID>" \
      -d "fixed_asset[purchased_on]=mm/dd/yyyy" \
      -d "fixed_asset[location_id]=<LOCATION_ID>" \
      -d "fixed_asset[image_url]=<IMAGE_URL>" \
      -d "fixed_asset[document_urls]=<DOCUMENT_URLS>" \
      https://<SUBDOMAIN>.assetsonar.com/assets.api

You can attach up to 5 documents to an Asset when creating it. To do this, add the 5 document links


Retrieve all Assets

To retrieve all Assets, run the following command. To include item custom fields in the result, pass the optional parameter include_custom_fields

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "include_custom_fields=true" \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      https://<SUBDOMAIN>.assetsonar.com/assets.api?page=<PAGE_NUM | DEFAULT = 1>

Each page has 25 Assets.Specify PAGE_NUM to access subsequent Assets.


Retrieve checked out Assets

To retrieve all currently checked out Assets, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "status=checked_out" \
      https://<SUBDOMAIN>.assetsonar.com/assets/filter.api?page=<PAGE_NUM | DEFAULT = 1>

Each page has 25 Assets. Specify PAGE_NUM to access subsequent Assets. The response also has the total number of pages.


Retrieve details of an Asset

Specify Asset# in the command below to retrieve details of an Asset. To include links in the result, pass show_document_urls. For image links, pass show_image_urls and to include item custom fields in the result, pass include_custom_fields in the optional parameter.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "include_custom_fields=true" \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>.api

Update Asset

Specify fixed_asset[name], fixed_asset[group_id] (see how to retrieve Groups) and fixed_asset[purchased_on]. You can also pass fixed_asset[location_id] (see how to retrieve Locations) in the command below. To pass custom fields, specify cust_attr[custom field name] (see how to retrieve custom fields).

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
    -d "fixed_asset[name]=<ASSET_NAME>" \
    -d "fixed_asset[group_id]=<GROUP_ID>" \
    -d "fixed_asset[sub_group_id]=<SUB_GROUP_ID>" \
    -d "fixed_asset[purchased_on]=mm/dd/yyyy" \
    -d "fixed_asset[location_id]=<LOCATION_ID>" \
    -d "fixed_asset[image_url]=<IMAGE_URL>" \
    -d "fixed_asset[document_urls]=<DOCUMENT_URLS>" \
    https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>.api

You can attach up to 5 documents to an Asset when updating it. To do this, add the 5 document links.


Delete Asset

Specify the Asset# in the command below to delete an Asset.

curl  -H "token:<COMPANY_TOKEN>" -X DELETE \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>.api

Check in an Asset

Specify the Asset# in the command to check in an Asset (see how to retrieve Locations).

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "checkin_values[location_id]=<LOCATION_ID>" \
      -d "checkin_values[comments]=<COMMENTS>" \ 
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/checkin.api

Check out an Asset

Specify either user_id or user_email in the command for the User that you want to check out the Asset to (see how to retrieve Users). In case you specify both parameters, priority will be given to user_id.

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "checkout_values[location_id]=<LOCATION_ID>" \
      -d "checkout_values[comments]=<COMMENTS>" \ 
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/checkout.api?user_id=<USER_ID>

Retrieve Asset history

Specify the Asset# and Page# in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/history_paginate.api? \
      page=<PAGE_NUM | DEFAULT = 1>

Each page has 5 records. Specify PAGE_NUM to access subsequent records. The response also has the total number of pages.


Extend checkout

Specify the Asset# in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "till=mm/dd/yyyy" -d "till_time=hh:mm" \
  https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/extend_checkout.api

Search

Specify the name of the Asset in the 'search' parameter (or use the # symbol followed by the Item Number, or the @ symbol followed by the Identification Number) to bring up its details. To include item custom fields in the result, pass the optional parameter include_custom_fields. Results are paginated.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "search=<ASSET_NAME>" \
      -d "facet=FixedAsset" \
      -d "include_custom_fields=true" \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "page=<PAGE_NUM | DEFAULT = 1>" \
      https://<SUBDOMAIN>.assetsonar.com/search.api

Audit

To send an Audit Request to the custodian of an Asset, run the following command specifying the Asset#.

curl  -H "token:<COMPANY_TOKEN>" -X POST  \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/audits.api

To acknowledge possession of an Asset, specify User ID of the custodian and Asset# of the checked out Asset. To get user_id (see how to retrieve Users).

curl  -H "token:<COMPANY_TOKEN>" -X POST  \
      -d "user_id=<USER_ID>" \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/verify_possession.api

Retire Asset

The fixed_asset[retired_on] and fixed_asset[retire_reason_id] (learn how to retrieve all retire reasons) fields are mandatory; the fixed_asset[salvage_value] is an optional parameter.

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "fixed_asset[salvage_value]=<SALVAGE_VALUE>" \
      -d "fixed_asset[retired_on]=mm/dd/yyyy" \
      -d "fixed_asset[retire_reason_id]=<RETIRE_REASON_ID>"
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/retire.api

Filters

Filters can be applied to retrieve Fixed Assets. Specify the filter_param_val and status in the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      "https://<SUBDOMAIN>.assetsonar.com/assets/filter.api?&status=<FILTER_OPTION>filter_param_val=<FILTER_PARAM_VALUE>&page=<PAGE_NUM | DEFAULT = 1>"

Each page has 25 Assets. Specify PAGE_NUM to access subsequent Assets. The response also has the total number of pages.

Options for status include:

        
available, assets_being_serviced, availability_range, checked_out, checkin_overdue,
checkin_due_today, due_today, group, items_in_order, location, my_pending_audit,
my_possessions, my_user_listing, outside_user_listing, overdue, pending audit,
possessions_of, product_model_number, reservation_starting_today, retired and update_time.

For filter options like available, filter_param_val is not required. For example, the command for retrieving available Asets is:

        
curl  -H "token:<COMPANY_TOKEN>" -X GET \
    "https://<SUBDOMAIN>.assetsonar.com/assets/filter.api? \
    status=available&page=<PAGE_NUM | DEFAULT = 1>"  

However, for filter options like possessions_of where extra information is required, you need to specify the filter_param_val as well. For example, in the case of possessions_of, filter_param_val will be the ID for the User whose Assets you want to retrieve. So the command will be:

        
curl  -H "token:<COMPANY_TOKEN>" -X GET \
      "https://<SUBDOMAIN>.assetsonar.com/assets/filter.api? \
      status=possessions_of&filter_param_val=<USER_ID> \
      &page=<PAGE_NUM | DEFAULT = 1>"

Example

The command to check availability of Assets will be:

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "status=availability_range"" \
      -d "filter_param_val=<START_DATE>~<END_DATE>" \
      https://<SUBDOMAIN>.assetsonar.com/assets/filter.api

Filter by Subgroup

To filter details by a specific Subgroup, run the following command:

API command here:

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "status=<FILTER_OPTION>" \
      -d "filter_param_val=<GROUP_ID>" \
      -d "sub_group_param_val=<SUB_GROUP_ID>" \
      -d "page=<PAGE_NUM | DEFAULT = 1>" \
      https://<SUBDOMAIN>.assetsonar.com/assets/filter.api

Define the parameters mentioned below in the above command:

  1. FILTER_OPTION: Choose "group" from the above list of "Options for Status".
  2. GROUP_ID: Specify the <group_ID> of the Group associated with the Subgroup details you are retrieving.
  3. SUBGROUP_ID: Specify the <subgroup_ID> of the Subgroup details you are retrieving.

Custom Filters

Applying custom filters to fixed assets is a two-step process:

Step 1: Retrieve IDs of all the custom filters for the given asset type i.e. fixed assets in this case using the command below

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "assets_type=fixed_assets" \
      https://<SUBDOMAIN>.assetsonar.com/custom_filters.api

Step 2: To apply the custom filter, specify the preferred ID in custom_filter_id, and enter it in status and filter param val for the command below. Moreover specifying assets_type is mandatory.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "assets_type=fixed_assets" \
      "https://<SUBDOMAIN>.assetsonar.com/assets/filter.api? \
      status=<custom_filter_id>&filter_param_val=<custom_filter_id> \
      &page=<PAGE_NUM | DEFAULT = 1>"

Inventory

Inventory is fast moving and consumable. It's added or removed in terms of stock. Examples include printer paper and pens that are consumed rather than assigned for possession. Inventory items are also referred to as Volatile Assets.

Create Inventory

Specify volatile_asset[name] and volatile_asset[group_id] (see how to retrieve Groups). These fields are mandatory.

You can also pass volatile_asset[location_id] (see how to retrieve Locations) in the command below. To pass custom fields, specify cust_attr[custom field name] (see how to retrieve custom fields).
curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "volatile_asset[name]=<ASSET_NAME>"" \
      -d "volatile_asset[group_id]=<GROUP_ID>" \
      -d "volatile_asset[location_id]=<LOCATION_ID>" \ 
      -d "volatile_asset[image_url]=<IMAGE_URL>" \
      -d "volatile_asset[document_urls]=<DOCUMENT_URLS>" \
      https://<SUBDOMAIN>.assetsonar.com/inventory.api

You can attach up to 5 documents to an Inventory item when creating it. To do this, add the 5 document links.


Retrieve all Inventory items

To retrieve all inventory items, run the following command. To include item custom fields in the result, pass the optional parameter include_custom_fields.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "include_custom_fields=true" \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      https://<SUBDOMAIN>.assetsonar.com/inventory.api?page=<PAGE_NUM | DEFAULT = 1>

Each page has 25 Inventory items. Specify PAGE_NUM to access subsequent Inventory items. The response also has the total number of pages.


Retrieve details of an Asset

Specify Asset# in the command below to retrieve details of an Asset.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>.api

Retrieve Inventory details

Specify the Inventory# in the command below to retrieve details of an Inventory item. To include document links in the result, pass show_document_urls. For image link, pass show_image_urls and to include item's custom fields in the result, pass include_custom_fields in the optional parameter.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "include_custom_fields=true" \
      https://<SUBDOMAIN>.assetsonar.com/inventory/<ASSET#>.api

Update Inventory

Specify volatile_asset[name] and volatile_asset[group_id] (see how to retrieve Groups).

You can also pass volatile_asset[location_id] (see how to retrieve Locations) in the command below.
curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "volatile_asset[name]=<ASSET_NAME>"" \
      -d "volatile_asset[group_id]=<GROUP_ID>" \
      -d "volatile_asset[location_id]=<LOCATION_ID>" \
      -d "volatile_asset[image_url]=<IMAGE_URL>" \
      -d "volatile_asset[document_urls]=<DOCUMENT_URLS>" \
      https://<SUBDOMAIN>.assetsonar.com/inventory/<ASSET#>.api

You can attach up to 5 documents to an Inventory when updating it. To do this, add the 5 document links.


Delete Inventory

Specify the Inventory# in the command below to delete an Inventory item.

curl  -H "token:<COMPANY_TOKEN>" -X DELETE \
      https://<SUBDOMAIN>.assetsonar.com/inventory/<ASSET#>.api

Add Stock

Specify the line_item[quantity] and line_item[price] in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "line_item[quantity]=<QUANTITY>" \
      -d "line_item[price]=<PRICE>" \
      -d "order_type=add stock" \
      https://<SUBDOMAIN>.assetsonar.com/inventory/<ASSET#>/order.api

New Sale

Specify the line_item[quantity] and line_item[price] in the command below (see how to retrieve locations).

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "line_item[quantity]=<QUANTITY>" \
      -d "line_item[price]=<PRICE>" \
      -d "line_item[comments]=<COMMENTS"> \
      -d "line_item[location_id]=<LOCATION_ID>" \
      -d "order_type=new sale" \
      https://<SUBDOMAIN>.assetsonar.com/inventory/<ASSET#>/order.api

Retrieve Inventory history

Specify the Inventory# and Page# in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/inventory/<ASSET#>/history.api? \
      page=<PAGE_NUM | DEFAULT = 1>

Each page has 25 Inventory items. Specify PAGE_NUM to access subsequent Inventory items. The response also has the total number of pages.


Search

Specify the name of the Inventory item in the 'search' parameter (or use the # symbol followed by the Inventory Number, or the @ symbol followed by the Identification Number) to bring up its details. To include item custom fields in the result, pass optional parameter include_custom_fields. Results are paginated.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "search=<INVENTORY_NAME>"
      -d "facet=VolatileAsset"
      -d "include_custom_fields=true" \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "page=<PAGE_NUM | DEFAULT = 1>" 
      https://<SUBDOMAIN>.assetsonar.com/search.api

Filters

Filters can be applied to retrieve Volatile Assets. Specify the filter_param_val and status in the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      "https://<SUBDOMAIN>.assetsonar.com/assets/filter.api? \
      status=<FILTER_OPTION>&filter_param_val=<FILTER_PARAM_VALUE> \
      &page=<PAGE_NUM | DEFAULT = 1>"

Each page has 25 Inventory items. Specify PAGE_NUM to access subsequent Inventory items. The response also has the total number of pages.

Options for status include:

        
group, items_in_order, location, low_stock, quantity_range and update_time.

For filter options like low_stock, filter_param_val is not required. For example, the command for retrieving available Inventory is:

        
curl  -H "token:<COMPANY_TOKEN>" -X GET \
      "https://<SUBDOMAIN>.assetsonar.com/assets/filter.api? \
      status=available&page=<PAGE_NUM | DEFAULT = 1>"  

However, for filter options like quantity_range where extra information is required, you need to specify the filter_param_val as well. For example, in the case of quantity_range, filter_param_val will be the range for the quantity. So the command will be:

        
curl  -H "token:<COMPANY_TOKEN>" -X GET \
      "https://<SUBDOMAIN>.assetsonar.com/assets/filter.api? \
      status=quantity_range&filter_param_val=<RANGE_BEGIN,RANGE_END> \
      &page=<PAGE_NUM | DEFAULT = 1>"

Filter by Subgroup

To filter details by a specific Subgroup, run the following command:

API command here:

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "status=<FILTER_OPTION>" \
      -d "filter_param_val=<GROUP_ID>" \
      -d "sub_group_param_val=<SUB_GROUP_ID>" \
      -d "page=<PAGE_NUM | DEFAULT = 1>" \
      https://<SUBDOMAIN>.assetsonar.com/inventory/filter.api

Define the parameters mentioned below in the above command:

  1. FILTER_OPTION: Choose "group" from the above list of "Options for Status".
  2. GROUP_ID: Specify the <group_ID> of the Group associated with the Subgroup details you are retrieving.
  3. SUBGROUP_ID: Specify the <subgroup_ID> of the Subgroup details you are retrieving.

Custom Filters

Applying custom filters to inventory is a two-step process:

Step 1: Retrieve IDs of all the custom filters for the given asset type i.e. volatile assets in this case using the command below

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "assets_type=volatile_assets" \
      https://<SUBDOMAIN>.assetsonar.com/custom_filters.api

Step 2: To apply the custom filter, specify the preferred ID in custom_filter_id, and enter it in status and filter param val for the command below. Moreover specifying assets_type is mandatory.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "assets_type=volatile_assets" \
      "https://<SUBDOMAIN>.assetsonar.com/assets/filter.api? \
      status=<custom_filter_id>&filter_param_val=<custom_filter_id> \
      &page=<PAGE_NUM | DEFAULT = 1>"

Asset Stock

Asset stock is tracked in bulk with quantities that can be added or moved between Locations. Examples include bits of hardware or furniture that you'd like to track the custodianship of, but without needing to know which specific item is with which person.

Create Asset Stock

Specify stock_asset[name] and stock_asset[group_id] (see how to retrieve Groups). These fields are mandatory.

You can also pass stock_asset[location_id] (see how to retrieve Locations) in the command below. To pass custom fields, specify cust_attr[custom field name] (see how to retrieve custom fields).
curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "stock_asset[name]=<ASSET_NAME>"" \
      -d "stock_asset[group_id]=<GROUP_ID>" \
      -d "stock_asset[location_id]=<LOCATION_ID>" \ 
      -d "stock_asset[image_url]=<IMAGE_URL>" \
      -d "stock_asset[document_urls]=<DOCUMENT_URLS>" \
      https://<SUBDOMAIN>.assetsonar.com/stock_assets.api

You can attach up to 5 documents to an Asset Stock item when creating it. To do this, add the 5 document links.


Retrieve all Asset Stock

To retrieve all Asset Stock, run the following command. To include item custom fields in the result, pass the optional parameter include_custom_fields.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "include_custom_fields=true" \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      https://<SUBDOMAIN>.assetsonar.com/stock_assets.api?page=<PAGE_NUM | DEFAULT = 1>

Each page has 25 Asset Stock items. Specify PAGE_NUM to access subsequent items. The response also has the total number of pages.


Retrieve Asset Stock details

Specify the Asset Stock# in the command below to retrieve details of the Asset Stock. For document links in the result, pass show_document_urls. For image links, pass show_image_urls and to include item's custom fields in the result, pass include_custom_fields in optional parameter.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "include_custom_fields=true" \
      https://<SUBDOMAIN>.assetsonar.com/stock_assets/<AssetStock#>.api

Update Asset Stock

Specify stock_asset[name] and stock_asset[group_id] (see how to retrieve Groups).

You can also pass stock_asset[location_id] (see how to retrieve Locations) in the command below.
curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "stock_asset[name]=<ASSET_NAME>"" \
      -d "stock_asset[group_id]=<GROUP_ID>" \
      -d "stock_asset[location_id]=<LOCATION_ID>" \
      -d "stock_asset[image_url]=<IMAGE_URL>" \
      -d "stock_asset[document_urls]=<DOCUMENT_URLS>" \
      https://<SUBDOMAIN>.assetsonar.com/stock_assets/<ASSET#>.api

You can attach up to 5 documents to an Asset Stock when updating it. To do this, add the 5 document links.


Delete Asset Stock

Specify the Asset Stock# in the command below to delete an Asset Stock item.

curl  -H "token:<COMPANY_TOKEN>" -X DELETE \
      https://<SUBDOMAIN>.assetsonar.com/stock_assets/<ASSET#>.api

Add Stock

Specify the line_item[quantity] and line_item[price] in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "line_item[quantity]=<QUANTITY>" \
      -d "line_item[price]=<PRICE>" \
      -d "order_type=add stock" \
      https://<SUBDOMAIN>.assetsonar.com/stock_assets/<ASSET#>/order.api

Check out

Specify the line_item[quantity] and line_item[price] in the command below (see how to retrieve Locations).

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "line_item[quantity]=<QUANTITY>" \
      -d "line_item[price]=<PRICE>" \
      -d "line_item[location_id]=<LOCATION_ID>" \
      -d "till=<Date>"
      -d "till_time=<Time>"
      -d "user={ "id" = <USERID> }
      -d "order_type=checkout" \
      https://<SUBDOMAIN>.assetsonar.com/stock_assets/<ASSET#>/order.api

Retrieve Asset Stock history

Specify the Asset Stock# and Page# in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/stock_assets/<ASSET#>/history.api? \
      page=<PAGE_NUM | DEFAULT = 1>

Each page has 5 records. Specify PAGE_NUM to access subsequent records. The response also has the total number of pages.


Search

Specify the name of the Asset Stock in the 'search' parameter (or use the # symbol followed by the Item Number, or the @ symbol followed by the Identification Number) to bring up its details. To include item's custom fields in the result, pass the optional parameter include_custom_fields. Results are paginated.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "search=<ASSET_STOCK_NAME>"
      -d "facet=StockAsset"
      -d "include_custom_fields=true" \
      -d "show_document_urls=true" \
      -d "show_image_urls=true" \
      -d "show_document_details=true" \
      -d "page=<PAGE_NUM | DEFAULT = 1>" 
      https://<SUBDOMAIN>.assetsonar.com/search.api

Members


Create a Member

Specify user[email], user[first_name], user[last_name] and user[role_id]. These are mandatory fields. *user[email] is optional if login_enabled = false

  • For creating Administrator, use role_id = 1
  • For creating Staff User, use role_id = 2
curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "user[email]=<EMAIL_ADDRESS>" \
      -d "user[role_id]=<ROLE_ID>" \
      -d "user[user_listing_id]=<USER_LISTING_ID>" \
      -d "user[first_name]=<USER_FIRST_NAME>" \
      -d "user[last_name]=<USER_LAST_NAME>" \
      -d "user[address_name]=<ADDRESS_NAME>" \
      -d "user[address]=<ADDRESS LINE 1>" \
      -d "user[address_line_2]=<ADDRESS LINE 2>" \
      -d "user[city]=<CITY>" \
      -d "user[state]=<STATE>" \
      -d "user[country]=<TWO_LETTER_COUNTRY_CODE>" \
      -d "user[phone_number]=<PHONE NUMBER>" \
      -d "user[fax]=<FAX>" \
      -d "user[login_enabled]=true" \
      -d "user[subscribed_to_emails]=false" \
      -d "skip_confirmation_email=true" \
      -d "user[custom_attributes][CUSTOM_ATTRIBUTE_NAME]=<CUSTOM_ATTRIBUTE_VALUE>" \
      https://<SUBDOMAIN>.assetsonar.com/members.api

Retrieve all Members

To retrieve all Members of the company, run the command below. To include item's custom fields in the result, pass the optional parameter include_custom_fields

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "include_custom_fields=true" \
      https://<SUBDOMAIN>.assetsonar.com/members.api?page=<PAGE_NUM>

Each page has 25 Members. Specify PAGE_NUM to access subsequent Members. Specify all in 'page' parameter to retrieve all Members. This parameter is optional.


Retrieve details of a Member

Specify the <USER_ID> in the command below to retrieve details of a member. To include item's custom fields in the result, pass the optional parameter include_custom_fields.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "include_custom_fields=true" \
      https://<SUBDOMAIN>.assetsonar.com/members/<USER_ID>.api?

Update Members

Specify user[email], user[first_name], user[last_name], user[role_id] and <USER_ID> in the command below. You cannot update the details of the account owner.

  • For updating Admin User, pass role_id = 1
  • For updating Staff User, pass role_id = 2
curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "user[email]=<EMAIL_ADDRESS>" \
      -d "user[role_id]=<ROLE_ID>" \
      -d "user[user_listing_id]=<USER_LISTING_ID>" \
      -d "user[first_name]=<USER_FIRST_NAME>" \
      -d "user[last_name]=<USER_LAST_NAME>" \
      -d "user[phone_number]=<PHONE NUMBER>" \
      -d "user[fax]=<FAX>" \
      https://<SUBDOMAIN>.assetsonar.com/members/<USER_ID>.api

Activate Member

Specify the <USER_ID> in the command below to activate a Member.

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      https://<SUBDOMAIN>.assetsonar.com/members/<USER_ID>/activate.api

Deactivate Member

Specify the <USER_ID> to deactivate Member. If some Items are checked out to the Member, they shall be set to a Non-login state.

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      https://<SUBDOMAIN>.assetsonar.com/members/<USER_ID>/deactivate.api

Filters

Members can be filtered either by email address or by employee identification number. Specify email or employee identification number as the filter_val to retrieve the concerned member.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/members.api? \
      -d "filter=email" \
      --data-urlencode "filter_val=<EMAIL>"
curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/members.api? \
      -d "filter=employee_identification_number" \
      --data-urlencode "filter_val=<EMPLOYEE_IDENTIFICATION_NUMBER>"

Reservation Requests


Create reservation request

Specify reservation_request[from], reservation_request[to] and reservation_request[note] in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "reservation_request[from]=mm/dd/yyyy" \
      -d "reservation_request[to]=mm/dd/yyyy" \
      -d "reservation_request[note]=<COMMENTS>" \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/reservation_requests.api

Retrieve reservation requests of an Asset

Specify Asset# in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/reservation_requests.api

Retrieve reservation requests starting today

To retrieve all the reservation requests for Assets, Inventory, Asset Stock and Carts that are starting today, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/checkout_requests/filter.api? \
      all=true&start_date=mm/dd/yyyy&page=<PAGE_NUM | DEFAULT = 1>

Each page has 25 reservation requests. Specify PAGE_NUM to access subsequent requests.


Update status of reservation request

Specify Asset# and <RESERVATION_ID> in the command below.

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "request_action=<ACTION>"
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/reservation_requests \
      /<RESERVATION_ID>/update_status.api
Valid values for ACTION are
deny
to deny a reservation request and
approve_request
to approve a reservation request.

Locations


Create Location

Specify location[name] in the command below. Its a mandatory field. You can also pass location[city], location[state], location[zipcode], location[street1], location[street2], location[status] and location[description] (optional).

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "location[name]=<LOCATION_NAME>" \
      -d "location[city]=<CITY_NAME>" \
      -d "location[status]=<active>" \ 
      https://<SUBDOMAIN>.assetsonar.com/locations.api

Retrieve Locations

To retrieve all Locations, run the command below.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/locations/get_line_item_locations.api

Update Location

Specify location[name] and <LOCATION_ID> in the command below. location[name] is a mandatory field. You can also pass location[city], location[state], location[zipcode], location[street1], location[street2] and location[description] (optional).

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "location[name]=<LOCATION_NAME>" \
      -d "location[city]=<CITY_NAME>" \
      https://<SUBDOMAIN>.assetsonar.com/locations/<LOCATION#>.api

Activate Location

Specify <LOCATION_ID> in the command below to activate the location. To activate all child locations along with the location, pass activate_all_children_locations=1.

curl  -H "token:<COMPANY_TOKEN>" -X PATCH \
      https://<SUBDOMAIN>.assetsonar.com/locations/<LOCATION#>/activate.api
curl  -H "token:<COMPANY_TOKEN>" -X PATCH \
      -d "activate_all_children_locations=<0/1>" \
      https://<SUBDOMAIN>.assetsonar.com/locations/<LOCATION#>/activate.api

Deactivate Location

Specify <LOCATION_ID> in the command below to deactivate specified location and its child locations.

curl  -H "token:<COMPANY_TOKEN>" -X PATCH \
      https://<SUBDOMAIN>.assetsonar.com/locations/<LOCATION#>/deactivate.api

Bundles


Retrieve Bundles

To retrieve all Bundles, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/bundles.api?page=<PAGE_NUM>

Each page has 25 Bundles. Specify PAGE_NUM to access subsequent Bundles. This parameter is optional.


Retrieve Bundle details

Specify Bundle# in the command below to retrieve its details.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/bundles/<BUNDLE_ID>.api

Filters

Filter can be applied to retrieve specified Bundle(s). Specify the filter in the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "filter=<filter_value>" \
      -d "location=<LOCATION>" \
      -d "page=<PAGE_NUM>" \
      "https://<SUBDOMAIN>.assetsonar.com/bundles.api?"

Each page has 25 Bundles. Specify PAGE_NUM to access subsequent Bundles. This parameter is optional.
For filter options like available and retired, location is not required.

Options for filter_value include:

        
active, retired, location, available_during

For example, the command for retrieving Bundle(s) available in a specified duration is:

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "filter=available_during" \
      -d "start_date=<MM/DD/YYYY HH:MM>" \
      -d "end_date=<MM/DD/YYYY HH:MM>" \
      -d "page=<PAGE_NUM>" \
      "https://<SUBDOMAIN>.assetsonar.com/bundles.api?" 

Groups


Create Group

Specify group[name] in the command below. It's a mandatory field. You can also pass group[description] and group[depreciation_rate](optional).

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "group[name]=<GROUP_NAME>" \
      -d "group[description]=<DESCRIPTION>" \
      -d "group[depreciation_rate]=<DEPRECIATION_RATE>" \
      https://<SUBDOMAIN>.assetsonar.com/groups.api

Retrieve Groups

To retrieve all the Groups, run the command below.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "show_document_details=true" \
      https://<SUBDOMAIN>.assetsonar.com/assets/classification_view.api?page=<PAGE_NUM>

Each page has 25 Groups. Specify PAGE_NUM to access subsequent Groups. This parameter is optional.


Subgroups


Create Subgroups

Specify sub_group[name] in the command below. It's a mandatory field. You can also pass sub_group[description](optional).

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "sub_group[name]=<SUBGROUP_NAME>" \
      -d "sub_group[description]=<DESCRIPTION>" \
      https://<SUBDOMAIN>.assetsonar.com/groups/<GROUP_ID>/sub_groups.api

Retrieve Subgroups

To retrieve all Subgroups, run the following command. To retrieve Subgroups of a specific Group, pass the optional parameter group_id.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "group_id=<GROUP_ID>" \
      https://<SUBDOMAIN>.assetsonar.com/groups/get_sub_groups.api

Retrieve details of a Subgroup.

To retrieve details of a specific Subgroup, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      http://<SUBDOMAIN>.assetsonar.com/groups/<GROUP_ID>/sub_groups/<SUBGROUP_ID>.api

Vendors


Create Vendors

Specify vendor[name]. This is a mandatory field.

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "vendor[name]=<NAME>" \
      -d "vendor[description]=<DESCRIPTION>" \
      -d "vendor[website]=<WEBSITE>" \
      -d "vendor[address]=<ADDRESS>" \
      -d "vendor[contact_person_name]=<CONTACT_PERSON_NAME>" \
      -d "vendor[email]=<EMAIL>" \
      -d "vendor[phone_number]=<PHONE NUMBER>" \
      -d "vendor[fax]=<FAX>" \
      -d "vendor[custom_attributes][CUSTOM_ATTRIBUTE_NAME]=<CUSTOM_ATTRIBUTE_VALUE>" \
      https://<SUBDOMAIN>.assetsonar.com/vendors.api

Retrieve Vendors

Retrieve all the Vendors using the following command. To include item custom fields in the result, pass the optional parameter include_custom_fields.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "include_custom_fields=true" \
      https://<SUBDOMAIN>.assetsonar.com/assets/vendors.api?page=<PAGE_NUM>

Each page has details of 25 Vendors. Specify PAGE_NUM to access subsequent Vendors. This parameter is optional.

Retrieve Vendors

To retrieve a Vendor, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "include_custom_fields=true" \
      https://<SUBDOMAIN>.assetsonar.com/vendors/<VENDOR_ID>.api

Update Vendors

To update a Vendor, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X PUT \
      -d "vendor[name]=<NAME>" \
      -d "vendor[description]=<DESCRIPTION>" \
      -d "vendor[website]=<WEBSITE>" \
      -d "vendor[address]=<ADDRESS>" \
      -d "vendor[contact_person_name]=<CONTACT_PERSON_NAME>" \
      -d "vendor[email]=<EMAIL>" \
      -d "vendor[phone_number]=<PHONE NUMBER>" \
      -d "vendor[fax]=<FAX>" \
      -d "vendor[custom_attributes][CUSTOM_ATTRIBUTE_NAME]=<CUSTOM_ATTRIBUTE_VALUE>" \
      https://<SUBDOMAIN>.assetsonar.com/vendors/<VENDOR_ID>.api

Custom Fields


Retrieve custom fields

To retrieve all custom fields, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/assets/custom_attributes.api

Custom fields history

To retrieve history of an Asset's custom field, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      http://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/custom_attribute_history.api?custom_attribute_id=<CUSTOM_FIELD_ID>

User Listings


Retrieve User Listings

To retrieve all User Listings, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/user_listings.api?page=<PAGE_NUM | DEFAULT = 1>

Comments


Create Comments

Specify comment[content]. This field is mandatory.

curl  -H "token:<COMPANY_TOKEN>" -X POST \
      -d "comment[content]=<CONTENT>" \
      -d "created_by_id=<USER_ID>" \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/comments.api

Retrieve all comments

To retrieve all comments for a specific item, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      -d "created_by_id=<USER_ID>" \
      https://<SUBDOMAIN>.assetsonar.com/assets/<ASSET#>/comments.api?page=<PAGE_NUM | DEFAULT = 1>

Each page has 25 comments. Specify PAGE_NUM to access subsequent comments. This parameter is optional. The response also has the total number of pages. To retrieve all the comments of a specific User, include created_by_id in optional parameters.


Retire Reasons


Retrieve all retire reasons

To retrieve all retire reasons, run the following command.

curl  -H "token:<COMPANY_TOKEN>" -X GET \
      https://<SUBDOMAIN>.assetsonar.com/retire_reasons.api