Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is possible to call the api's using the command line tool curl. This provides a simple way to use and test the api. These examples are also using the json_reformat tool, which formats the json string to allow for easy viewing.

 

Assets

View all Assets:

curl http://localhost:8080/ehelpdesk/api/assets -u admin:admin -H "Accept: */*" | json_reformat

 

Code Block
languagejs
HTTP/1.1 200 OK

{
    "content": [
        {
            "id": 2,
            "assetNumber": "asdfa111",
            "name": "asdfa111",
            "notes": null,
            "acquisitionDate": null,
            "assetLocation": null,
            "active": true,
            "accountingInfo": {
                "id": 2,
                "poNumber": "po111",
                "accountNumber": null,
                "accumulatedNumber": null,
                "expenseNumber": null,
                "acquisitionValue": null,
                "leaseNumber": null,
                "leaseExpirationDate": null,
                "leaseDuration": null,
                "leaseFrequency": null,
                "leaseFrequencyPrice": null,
                "warrantyDate": null,
                "disposalDate": null,
                "disposalMethod": null,
                "insuranceCategory": null,
                "replacementValueCategory": null,
                "replacementValue": null,
                "maintenanceCost": null,
                "depreciationMethod": null
            },
            "macAddress": null,
            "osNameType": null,
            "osVersion": null,
            "netbios": null,
            "ip": null,
            "osSerial": null,
            "netConnectionLoc": null,
            "netConnectionDesc": null,
            "vlan": null,
            "manufacturer": null,
            "modelNumber": null,
            "serialNumber": null,
            "description": null,
            "hostname": null,
            "vncPort": null,
            "assetTypeId": 1,
            "vendorId": null,
            "ticketIds": [

            ],
            "softwareLicenseIds": [

            ],
            "statusId": 1,
            "ownerId": null,
            "locationId": null,
            "groupId": null,
            "categoryId": null,
            "categoryOptionId": null
        },
        {
            "id": 3,
            "assetNumber": "asdfa1111",
            "name": "asdfa111",
            "notes": null,
            "acquisitionDate": null,
            "assetLocation": null,
            "active": true,
            "accountingInfo": {
                "id": 3,
                "poNumber": "po111",
                "accountNumber": null,
                "accumulatedNumber": null,
                "expenseNumber": null,
                "acquisitionValue": null,
                "leaseNumber": null,
                "leaseExpirationDate": null,
                "leaseDuration": null,
                "leaseFrequency": null,
                "leaseFrequencyPrice": null,
                "warrantyDate": null,
                "disposalDate": null,
                "disposalMethod": null,
                "insuranceCategory": null,
                "replacementValueCategory": null,
                "replacementValue": null,
                "maintenanceCost": null,
                "depreciationMethod": null
            },
            "macAddress": null,
            "osNameType": null,
            "osVersion": null,
            "netbios": null,
            "ip": null,
            "osSerial": null,
            "netConnectionLoc": null,
            "netConnectionDesc": null,
            "vlan": null,
            "manufacturer": null,
            "modelNumber": null,
            "serialNumber": null,
            "description": null,
            "hostname": null,
            "vncPort": null,
            "assetTypeId": 1,
            "vendorId": null,
            "ticketIds": [

            ],
            "softwareLicenseIds": [
                1,
                2
            ],
            "statusId": 1,
            "ownerId": null,
            "locationId": null,
            "groupId": null,
            "categoryId": null,
            "categoryOptionId": null
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "http://localhost:8080/ehelpdesk/api/assets"
        }
    ]
}



 

View Asset with id 1:

curl http://localhost:8080/ehelpdesk/api/assets/2 -u admin:admin -H "Accept: */*" | json_reformat

Code Block
HTTP/1.1 200 OK

{
    "content": {
        "id": 2,
        "assetNumber": "asdfa111",
        "name": "asdfa111",
        "notes": null,
        "acquisitionDate": null,
        "assetLocation": null,
        "active": true,
        "accountingInfo": {
            "id": 2,
            "poNumber": "po111",
            "accountNumber": null,
            "accumulatedNumber": null,
            "expenseNumber": null,
            "acquisitionValue": null,
            "leaseNumber": null,
            "leaseExpirationDate": null,
            "leaseDuration": null,
            "leaseFrequency": null,
            "leaseFrequencyPrice": null,
            "warrantyDate": null,
            "disposalDate": null,
            "disposalMethod": null,
            "insuranceCategory": null,
            "replacementValueCategory": null,
            "replacementValue": null,
            "maintenanceCost": null,
            "depreciationMethod": null
        },
        "macAddress": null,
        "osNameType": null,
        "osVersion": null,
        "netbios": null,
        "ip": null,
        "osSerial": null,
        "netConnectionLoc": null,
        "netConnectionDesc": null,
        "vlan": null,
        "manufacturer": null,
        "modelNumber": null,
        "serialNumber": null,
        "description": null,
        "hostname": null,
        "vncPort": null,
        "assetTypeId": 1,
        "vendorId": null,
        "ticketIds": [

        ],
        "softwareLicenseIds": [

        ],
        "statusId": 1,
        "ownerId": null,
        "locationId": null,
        "groupId": null,
        "categoryId": null,
        "categoryOptionId": null
    },
    "links": [
        {
            "rel": "self",
            "href": "http://localhost:8080/ehelpdesk/api/assets/2"
        }
    ]
}

...