Unarchive

Using the Unarchive handler, you can change the archival state of an asset back to its not archived state. The request can be made using GET without any additional information to unarchive the asset.

GET /api/inventory/<asset-id>/unarchive

POST /api/inventory/<asset-id>/unarchive

Will unarchive the assets and its parent assets. The response is the same as in the assets handler.

Note: unarchiving an asset always also unarchives the parent assets. To unarchive all child assets as well, use the /unarchive-all handler.

Example Request

# Request
POST /api/inventory/0000000014dda45eb9fe2ecb0/unarchive HTTP/1.1
Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u
Content-Type: application/json
 
# Response
HTTP/1.1 200 OK
Content-Type: application/json
 
{
  "id": "0000000014dda45eb9fe2ecb0",
  "parent": null,
  "name": "Dell Precision T3400",
  "isArchived": false,
  "type": {
    "id": 11,
    "name": "Computer"
  },
  "hasAttachments": false,
  "fields": {
    "owner": "sys02qmoxwlwprnnovhrxtx7n",
    "license": 0,
    "serialnumber": "G 1234 5678 90",
    "purchasedate": 1629410400000,
    "price": 1399.5,
    "vendor": 1,
    "name": "Dell Precision T3400",
    "warranty": 1692482400000,
    "sla": 2,
    "location": 0,
    "custom1": "10.1.1.10",
    "assetnumber": "X123"
  }
}

Application Example

# Browser access
http://127.0.0.1:9000/api/inventory/0000000014dda45eb9fe2ecb0/unarchive
 
# Shell access using curl
curl -LsH "Authorization: Bearer <access_token>" "http://127.0.0.1:9000/api/inventory/0000000014dda45eb9fe2ecb0/unarchive"
 
# Shell access using curl using username and password
curl -Lsu username:password "http://127.0.0.1:9000/api/inventory/0000000014dda45eb9fe2ecb0/unarchive"