Other Assets:
Getting a list of all other assets:
curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X GET
https://api.samanage.com/other_assets.xml
Getting asset details (using asset ID number):
curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X GET https://api.samanage.com/other_assets/ASSET_ID.xml
Create a new asset:
curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_XML' -H 'Accept: application/xml' -H 'Content-Type:text/xml' -X POST https://api.samanage.com/other_assets.xml
Required fields:
<name>,<manufacturer>,<asset_type>,<status>
XML Exmaple:
<other_asset>
<name>Asset name</name>
<asset_id>123456789</asset_id>
<status><name>Operational</name></status>
<asset_type><name>Printer</name></asset_type>
<description>Description</description>
<ip>10.0.0.0</ip>
<manufacturer>Asset manufacturer</manufacturer>
<model>Model</model>
<serial_number>123456789</serial_number>
<owner><email>demo@samanage.com</email></owner>
<user><email>demo@samanage.com</email></user>
<site><name>Site name</name> </site>
<department><name>Department name</name></department>
<custom_fields_values>
<custom_fields_value>
<name>field name</name>
<value>content</value>
</custom_fields_value>
<custom_fields_value>
<name>field name</name>
<value>content</value>
</custom_fields_value>
</custom_fields_values>
</other_asset>
JSON Exmaple:
{
"other_asset": {
"name": "content",
"asset_id": "123456789",
"asset_type": {"name": "Printer"},
"status": {"name": "Operational"},
"description": "Description",
"ip_address": "10.0.0.0",
"manufacturer": "Asset manufacturer",
"serial_number": "123456789",
"owner": {"email": "demo@samanage.com"},
"site": {"name": "Site name"},
"department": {"name": "Department name"},
"custom_fields_values":{
"custom_fields_value":[
{"name": "Custom Field Name 1", "value": "Value 1"},
{"name": "Custom Field Name 2", "value": "Value 2"},
{"name": "Custom Field Name 3", "value": "Value 3"}
]
}
}
}
Updating an existing other asset:
curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_XML' -H 'Accept: application/xml' -H 'Content-Type:text/xml' -X PUT https://api.samanage.com/other_assets/ASSET_ID.xml
XML Example:
<other_asset>
<field_to_update>content</field_to_update>
</other_asset>
JSON Example:
{
"other_asset": {
"field_to_update": "content",
}
}
Deleting an other asset:
curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X DELETE https://api.samanage.com/other_assets/ASSET_ID.xml