API - update computer asset id via API

Idea created by 6011364 on May 25, 2016
    Under Consideration
    • 6641654
    • 6011364

    (Originally posted on 27, November 2014)

    I got the question if/how you could update the asset id from the API
    First you find the asset you need to update, in this example based on the serial number:


    The format (from command line) to filter on a serial number is:


    curl --digest -k -u "EMAIL:PASSWORD" -H "Accept: application/vnd.samanage.v1+xml" -X GET "https://api.samanage.com/hardwares.xml?&serial_number%5B%5D=C02MP187G086";


    So in this example I find the hardware via serial number. It returns xml and in the xml you find the '622365' internal ID you need to update and have in the PUT url. And you see the xml that you need to update the asset id.


    curl --digest -k -u "EMAIL:PASSWORD" -H "Accept: application/xml" -H "Content-Type:text/xml" -d "<hardware><asset_tag>123456</asset_tag></hardware>" -X PUT https://api.samanage.com/hardwares/622365.xml


    And now the asset id in Samanage is updated to 123456

    What problem will this feature solve?: