REST API and ASSETS

REST API and ASSETS

Hello!

I try to automate to add some assets to Servicedesk via REST API with powershell, but can't figure it out.

Have someone a clue what I'm need to do? Or is it even possible to add assest through uri: "https://sdpondemand.manageengine.com/api/cmdb/ci/" ?


  1. $INPUT_DATA =

    @"

    <records>

    <record>

    <parameter><name>CI Name</name><value>sdp-w2k3-2</value></parameter>

    <parameter><name>CI Type</name><value>Windows Workstation</value></parameter>

    <parameter><name>Product Name</name><value>Latitude Optimus</value></parameter>

    <parameter><name>Site</name><value>Japan</value></parameter>

    <parameter><name>Business Impact</name><value>High</value></parameter>

    <parameter><name>Asset Tag</name><value>MY RES TAG</value></parameter>

    <parameter><name>Resource Serial No.</name><value>KIJH-KPOJ-IOO9-IO98</value></parameter>

    <parameter><name>Bar Code</name><value>(empty)</value></parameter>

    <parameter><name>Cost</name><value>23.98</value></parameter>

    <parameter><name>Vendor</name><value>Zoho Corp</value></parameter>

    <parameter><name>Expiry Date</name><value>2010-08-23</value></parameter>

    <parameter><name>Warranty Expiry Date</name><value>2010-08-23</value></parameter>

    <parameter><name>Acquisition Date</name><value>2008-8-23</value></parameter>

    <parameter><name>Location</name><value>(empty)</value></parameter>

    <parameter><name>Asset State</name><value>In use</value></parameter>

    <parameter><name>Location</name><value>Japan</value></parameter>

    <parameter><name>Description</name><value>Japan\r\nAXL</value></parameter>

    <parameter><name>Barcode</name><value>101001100010101</value></parameter>

    <parameter><name>Service Tag</name><value>AXL90OSASASD</value></parameter>

    <parameter><name>Total Memory</name><value>1024</value></parameter>

    <parameter><name>Virtual Memory</name><value>1024</value></parameter>

    <parameter><name>OS</name><value>Microsoft Windows XP Professional 2007</value></parameter>

    <parameter><name>Service Pack</name><value>Microsoft Windows XP Professional 2007</value></parameter>

    <parameter><name>Manufacturer</name><value>Zoho Corp</value></parameter>

    <parameter><name>Monitor Type</name><value>LG 360</value></parameter>

    <parameter><name>Monitor Manufacturer</name><value>LCD Flat monitor</value></parameter>

    <parameter><name>Monitor Serial Number</name><value>AADSD90KL88767</value></parameter>

    <parameter><name>Mouse Type</name><value>LOGITECH</value></parameter>

    <parameter><name>Mouse Manufacturer</name><value>Microsoft Corp</value></parameter>

    <parameter><name>Mouse Serial Number</name><value>MOUSE_AADSD90KL88767</value></parameter>

    <parameter><name>Keyboard Type</name><value>LG 480</value></parameter>

    <parameter><name>Keyboard Manufacturer</name><value>Microsoft Corp</value></parameter>

    <parameter><name>Keyboard Serial Number</name><value>KBD_AADSD90KL88767</value></parameter>

    <!-- Adding ownership details -->

    <multi-valued-parameter name="Assign Ownership">

    <record>

    <parameter><name>Department</name><value>Sales</value></parameter>

    <parameter><name>Department's site</name><value>Pleasanton,CA</value></parameter>

    </record>

    </multi-valued-parameter>

    <multi-valued-parameter name="Asset Lease Information">

    <record>

    <parameter><name>Start Date</name><value>2010-09-21</value></parameter>

    <parameter><name>End Date</name><value>2011-09-21</value></parameter>

    </record>

    </multi-valued-parameter>

    <multi-valued-parameter name="Network Details">

    <record>

    <parameter><name>DHCP Server</name><value>www.dbexplorer.com</value></parameter>

    <parameter><name>IP Address</name><value>192.168.112.234</value></parameter>

    <parameter><name>MAC Address</name><value>AS2.168.112.234</value></parameter>

    <parameter><name>NIC</name><value>MY NIC</value></parameter>

    <parameter><name>Network</name><value>192.168.112.0</value></parameter>

    </record>

    <record>

    <parameter><name>DHCP Server</name><value>www.dbexplorer1.com</value></parameter>

    <parameter><name>IP Address</name><value>192.168.112.233</value></parameter>

    <parameter><name>MAC Address</name><value>AS2.168.112.232</value></parameter>

    <parameter><name>NIC</name><value>MY NIC-1</value></parameter>

    <parameter><name>Network</name><value>192.168.112.12</value></parameter>

    </record>

    </multi-valued-parameter>

    <multi-valued-parameter name="Processor Details">

    <record>

    <parameter><name>Processor Count</name><value>1</value></parameter>

    <parameter><name>Processor Type</name><value>Intel.</value></parameter>

    <parameter><name>Processor Speed</name><value>1025</value></parameter>

    <parameter><name>Processor Manufacturer</name><value>SSL Corporation</value></parameter>

    </record>

    <record>

    <parameter><name>Processor Count</name><value>1</value></parameter>

    <parameter><name>Processor Type</name><value>Intel.</value></parameter>

    <parameter><name>Processor Speed</name><value>2025</value></parameter>

    <parameter><name>Processor Manufacturer</name><value>SSL Corporation (India)</value></parameter>

    </record>

    </multi-valued-parameter>

    <!-- Asset/Workstation Additional parameters Start -->

    <parameter><name>Cost Center</name><value>Sales</value></parameter>

    <parameter><name>Account Number</name><value>0166440001754</value></parameter>

    <parameter><name>Resolution</name><value>NO RESULT</value></parameter>

    <parameter><name>Bank Account</name><value>1298374</value></parameter>

    <parameter><name>Depreciation Amount</name><value>2022</value></parameter>

    <parameter><name>Renewal Date</name><value>2010-10-23</value></parameter>

    <parameter><name>My Child Data</name><value>Japan-Kollam</value></parameter>

    <parameter><name>Asset Data</name><value>My data&#xA;Textas</value></parameter>

    <parameter><name>Asset Number</name><value>98765</value></parameter>

    <!-- Asset Additional parameters Start -->

    </record>

    </records>

    "@ | ConvertTo-Xml

    Invoke-RestMethod -Method post -Uri "https://sdpondemand.manageengine.com/api/cmdb/ci/" -Body @{OPERATION_NAME="add";authtoken="9ed662b59b10e88b80fc6993a100b3aa";INPUT_DATA=$INPUT_DATA}



                New to ADSelfService Plus?