REST API - View an asset

Last modified on 2022/11/08 13:22

GET  /assets/{asset_id}

  • This method allows information about a specified asset to be obtained (an asset includes equipment, license and contract).
           example   /assets/9479

Notes

       Open url.png  See Service Manager REST API Conventions.

  • If successful, an HTTP status code 200 is returned.
    • A URL link (HREF) to the resource is provided.
    • All fields are provided, including e_field_name and available_field_x, except for certain sensitive fields reserved for EasyVista.
       

List of parameters / fields

Mandatory parameters

You must use the parameter below in the URL.
 

Parameter Type Description / Example
asset_id string or integer Asset identifier

Optional parameters

You can use the parameters detailed below in the HTTP request string.

Minimum version Parameter Type Description / Example
fields string Select fields to display.
  • example /assets/9479?fields=asset_guid,asset_id
Oxygen 1.7 - Build 2018.1.131.0 formatDate string Format display of Date fields in the HTTP request result.   Open url.png See Description of the options.
  • example
    • /assets/9479?fields=last_update&formatDate=l/M/Y ==> "last_update_format": "Friday/Nov/2018"
    • /assets/9479?fields=last_update&formatDate=l jS \of F Y h:i:s A ==> "last_update_format": "Friday 16th of November 2018 12:00:00 AM"

Fields that could be used in optional parameters

You can use all the fields from the AM_ASSET table.

HTTP status codes for the method

StatusHeader

Note: A Timeout error code will be returned if the server does not respond to the REST Web service request within a given time (by default 60 seconds).

Code Error Description
Status200
200 OK (Successful) Request successfully processed.
Status401
401 Unauthorized Incorrect authentication process for accessing the resource: Incorrect login/password, invalid session, incorrect Service Manager account.

example

{
 "error": "Invalid Login / Password"
}
Status404
404 Not found Resource not found: Incorrect URI, missing resource, incorrect communication with the server, rfc_number not found.

example

{
 "error": "Resource not found"
}

Example

Result with a status code 200 returned

{
   "HREF": "http://{your_server}/api/v1/{your_account}/assets/9479",
   "ACQUISITION_TYPE_ID": "",
   "ASSET_GUID": "{2D744435-3FC5-4E16-B2FF-B432EB87A829}",
   "ASSET_ID": "50312",
   "ASSET_LABEL": "New asset via REST API - Updated",
   "ASSET_TAG": "a99f7fc1-4080-402b-b85d-2c484c6108c7",
   "AUTOMATIC_RENEWAL": "",
   "AVAILABILITY_SLA_ID": "",
   "AVAILABLE_FIELD_1": "Available for custom use - Updated",
   "AVAILABLE_FIELD_2": "",
   "AVAILABLE_FIELD_3": "",
   "AVAILABLE_FIELD_4": "",
   "AVAILABLE_FIELD_5": "",
   "AVAILABLE_FIELD_6": "",
   "BEFORE_LOAN_DEPARTMENT_PATH": "",
   "BEFORE_LOAN_DEPARTMENT_ID": "",
   "BEFORE_LOAN_EMPLOYEE_ID": "",
   "BEFORE_LOAN_LOCATION_PATH": "",
   "BEFORE_LOAN_LOCATION_ID": "",
   "BILLING_PERIODICITY_IN_MONTH": "",
   "BUDGET_ID": "",
   "BUY_BACK_VALUE": "",
   "BUY_BACK_VALUE_CUR_ID": "",
   "CATALOG_ID": "3544",
   "CHARGE_BACK": "",
   "CHARGE_BACK_CUR_ID": "",
   "CI_BACKUP_BY_DEFAULT": "",
   "CI_STATUS_ID": "",
   "CI_VERSION": "",
   "CM_DEFAULT_CHANGE_PATH": "",
   "CM_DEFAULT_CHANGE_ID": "",
   "COMMENT_ASSET": {
       "HREF": "http://{your_server}/api/v1/{your_account}/assets/9479/comment_asset"
    },
   "CONFIGURATION_ID": "",
   "CONTRACT_TYPE_ID": "",
   "CRITICAL_LEVEL_ID": "",
   "D_HARDWARE_GUID": "",
   "DELIVERY_DATE": "",
   "DELIVERY_NUMBER": "",
   "DEPARTMENT_PATH": "",
   "DEPARTMENT_ID": "5",
   "DEPRECIATION_RULE_ID": "",
   "EMPLOYEE_ID": "",
   "END_OF_WARANTY": "",
   "ENTRY_DATE": "",
   "ESTIMATED_PERCENTAGE_USE": "",
   "EXPECTED_END_LEND_DATE": "",
   "EXPECTED_RETURN_DATE": "",
   "FALLEN_TERM": "",
   "FIXED_ASSET_NUMBER": " -",
   "INITIAL_START": "",
   "INSTALLATION_DATE": "",
   "INTERNAL_DELIVERY_DATE": "",
   "INTERNAL_DISPO": "",
   "INVENTORY_ID": "",
   "INVOICE_NUMBER": "",
   "IS_CI": "0",
   "IS_DML": "0",
   "IS_LOCKED": "0",
   "IS_SERVICE": "0",
   "LAST_AUTOMATIC_DISCOVERY": "",
   "LAST_INTEGRATION": "",
   "LAST_PAYMENT": "",
   "LAST_PAYMENT_CUR_ID": "",
   "LAST_PHYSICAL_INVENTORY": "",
   "LAST_UPDATE": "2018-07-03",
   "LICENSE_VERSION": "",
   "LOCATION_PATH": "Europe/France",
   "LOCATION_ID": "63",
   "LOCATION_TO_CHECK_REQUEST_ID": "",
   "MAIN_USAGE_ID": "",
   "MAINTENANCE_COST": "",
   "MAINTENANCE_COST_CUR_ID": "",
   "MAX_INSTALLS": "",
   "MONTH_DURATION": "",
   "MONTHLY_FIXED_COST": "",
   "MONTHLY_FIXED_COST_CUR_ID": "",
   "MONTHLY_NET_RENTAL": "",
   "MONTHLY_NET_RENTAL_CUR_ID": "",
   "NETWORK_IDENTIFIER": " -",
   "NEXT_CI_VERSION": "",
   "NEXT_DEPARTMENT_PATH": "",
   "NEXT_DEPARTMENT_ID": "",
   "NEXT_MAINTENANCE_DATE": "",
   "NEXT_STATUS_ID": "",
   "NEXT_USER_APPLICATION_DATE": "",
   "NEXT_USER_ID": "",
   "NOTICE": "",
   "ORDER_DETAILS_ID": "",
   "ORDER_NUMBER": "",
   "OWNERSHIP_TO_CHECK_REQUEST_ID": "",
   "PACKAGE_PATH": "",
   "PIPELINE_STATUS_ID": "",
   "POWER_CONSUMPTION_WH": "",
   "PROCESSOR_COUNT": "",
   "PROCESSOR_SOCKET_COUNT": "",
   "PROJECT_ID": "",
   "PROVIDER_PATH": "",
   "PROVIDER_ID": "",
   "PURCHASE_DATE": "",
   "PURCHASE_PRICE": "",
   "PURCHASE_PRICE_CUR_ID": "",
   "PURCHASE_RATE_ID": "",
   "RECYCLED_DATE": "",
   "RECYCLING_PROVIDER_PATH": "",
   "RECYCLING_PROVIDER_ID": "",
   "REFORM_NUMBER": "",
   "REMOVED_DATE": "",
   "RENEWAL_DECISION_ID": "",
   "RENEWAL_VALUE": "",
   "RENEWAL_VALUE_CUR_ID": "",
   "REPAIRED_BY_PATH": "",
   "REPAIRED_BY_ID": "",
   "REQUEST_ID": "",
   "RESALES_VALUE": "",
   "SCHEDULED_END": "",
   "SD_CATALOG_PATH": "",
   "SD_CATALOG_ID": "1",
   "SD_DEFAULT_INCIDENT_PATH": "",
   "SD_DEFAULT_INCIDENT_ID": "",
   "SD_DEFAULT_REQUEST_PATH": "",
   "SD_DEFAULT_REQUEST_ID": "",
   "SERIAL_NUMBER": "2 AS- 155- 6 V",
   "SERVER_TYPE_ID": "",
   "SLA_ID": "",
   "STATUS_ID": "4",
   "SUPPLIER_PATH": "",
   "SUPPLIER_ID": "",
   "TERM": "",
   "UPDATE_COVERAGE_TERM": "",
   "UPDATED_BY_DISCOVERY": "0",
   "WARANTY_TYPE_ID": "",
   "XPOS": "",
   "YPOS": "",
   "ZPOS": "",
   "LOCATION": {
       "HREF": "http://{your_server}/api/v1/{your_account}/locations/63",
       "CITY": "",
       "LOCATION_CODE": "",
       "LOCATION_FR": "France",
       "LOCATION_PATH": "Europe/France",
       "LOCATION_ID": "63"
    },
   "DEPARTMENT": {
       "DEPARTMENT_CODE": "",
       "DEPARTMENT_FR": "-",
       "DEPARTMENT_PATH": "",
       "DEPARTMENT_ID": "5",
       "DEPARTMENT_LABEL": ""
    },
   "EMPLOYEE": {
       "BEGIN_OF_CONTRACT": "",
       "CELLULAR_NUMBER": "",
       "DEPARTMENT_PATH": "",
       "E_MAIL": "",
       "EMPLOYEE_ID": "",
       "LAST_NAME": "",
       "LOCATION_PATH": "",
       "PHONE_NUMBER": ""
    },
   "CATALOG_ASSET": {
       "HREF": "http://{your_server}/api/v1/{your_account}/catalog-assets/3544",
       "ARTICLE_MODEL": "PowerEdge 860",
       "CATALOG_ID": "3544",
       "NET_PRICE": "1 660,00",
       "SMBIOS_NAME": "PowerEdge 860",
       "TITLE_FR": ""
    }
}
ConventionsAPI

REST API Conventions

Convention Meaning
Orange Parameters used in an HTTP request string which do not correspond to Service Manager database fields.

example   Method View a list of assets

https://{your_server}/api/v1/{your_account}/assets?max_rows=3&fields=asset_tag
Black and Bold Parameters used in the URL of an HTTP request which correspond to Service Manager database fields.

example   Method View an asset

https://{your_server}/api/v1/{your_account}/assets/{asset_id}
Green Parameters used in the body of an HTTP request which represent JSON object names corresponding to Service Manager database fields; they allow the value of a database field to be assigned or modified.

example   Method Close an incident/request

{  "closed": {  "end_date": "11/20/2016 12:12:12",  }  }
Parameters used in the body of an HTTP request which represent JSON object names not corresponding to Service Manager database fields.

example   Method Reopen an incident/request

{  "restarted": {  "comment": "string (required)"  }  }
Tags:
Powered by XWiki © EasyVista 2022