Skip to content
boh1996 edited this page Aug 9, 2012 · 10 revisions

Computer

Get Computer: GET /computer/[:id:]

Request:

GET /computer/1

Response:

{
    "Computer": {
        "id": 1,
        "identifier": "BUF92146",
        "organization": {
            "id": 1,
            "name": "Groendalsvaengets Skole",
            "employees": {
                "id": 1,
                "organizations": [
                    "1"
                ],
                "email": "test",
                "name": "Bo"
            }
        },
        "lan_mac": "78-2B-CB-B3-97-73",
        "ip": "10.87.45.109",
        "disk_space": "465",
        "ram_size": "3241",
        "serial": "JQDF45J",
        "operating_system": {
            "id": "1",
            "name": "Windows XP",
            "detection_string": "Windows XP",
            "version": "XP",
            "family": {
                "id": "1",
                "manufacturer": {
                    "id": 18,
                    "name": "Microsoft",
                    "abbrevation": "Microsoft"
                },
                "name": "Windows",
                "core": {
                    "id": "1",
                    "manufacturer": {
                        "id": 18,
                        "name": "Microsoft",
                        "abbrevation": "Microsoft"
                    },
                    "name": "Windows"
                }
            }
        },
        "screen_size": {
            "id": "3",
            "width": "1024",
            "height": "768",
            "detection_string": "1024x768",
            "name": "Extended Graphics Array",
            "aspect_ratio": "4:3",
            "abbrevation": "XGA"
        },
        "cpu": {
            "id": 1,
            "manufacturer": {
                "id": 2,
                "name": "Intel",
                "abbrevation": "Intel"
            },
            "cores": "4",
            "name": "Pentium III Xeon",
            "detection_string": "Intel Pentium III Xeon-processor"
        },
        "created_time": "07/11-2011 - 11:20:11",
        "last_updated": "09/08-2012 - 00:26:57",
        "creator_user": {
            "id": 1,
            "organizations": [
                {
                    "id": 1,
                    "name": "Groendalsvaengets Skole",
                    "employees": {
                        "id": 1,
                        "organizations": [
                            "1"
                        ],
                        "email": "test",
                        "name": "Bo"
                    }
                }
            ],
            "email": "test",
            "name": "Bo"
        },
        "last_updated_user": {
            "id": 1,
            "organizations": [
                {
                    "id": 1,
                    "name": "Groendalsvaengets Skole",
                    "employees": {
                        "id": 1,
                        "organizations": [
                            "1"
                        ],
                        "email": "test",
                        "name": "Bo"
                    }
                }
            ],
            "email": "test",
            "name": "Bo"
        },
        "location": {
            "id": 15,
            "name": "41",
            "room_number": "41",
            "organization": "1"
        },
        "lan_macs": [
            "78-2B-CB-B3-97-73"
        ]
    },
    "count": 17,
    "error_message": null,
    "error_code": null,
    "script_excecution_time": "0.0922",
    "server_time": 1344532587
}

Location

Get locations of organization: GET options/location/?organization=[:id:]

Request:

GET options/location/?organization=1

Response:

{
    "Locations": [
        {
            "id": 2,
            "name": "23",
            "room_number": "23",
            "organization": "1"
        },
        {
            "id": 3,
            "name": "Biblioteket",
            "organization": "1"
        },
        {
            "id": 4,
            "name": "EAT",
            "organization": "1"
        }
        .....
    ],
    "count": 33,
    "error_message": null,
    "error_code": null,
    "script_excecution_time": "0.0870",
    "server_time": 1344533240
}

Organization : The id of the organization to get the locations of

Device Types

Get device types: GET options/device_types?category=[:category:]

Request:

GET options/device_type?category=Computer

Response:

{
    "Device_Types": [
        {
            "id": 1,
            "name": "Laptop",
            "category": {
                "id": 1,
                "name": "Computer"
            }
        },
        {
            "id": 2,
            "name": "Desktop",
            "category": {
                "id": 1,
                "name": "Computer"
            }
        }
    ],
    "count": 2,
    "error_message": null,
    "error_code": null,
    "script_excecution_time": "0.0310",
    "server_time": 1344540193
}

Caterory : The device category Computer etc that you wan't to get

Screen sizes

GET options/screen_size

Request:

GET options/screen_size

Response:

{
    "Screen_Sizes": [
        {
            "id": "1",
            "width": "1280",
            "height": "1024",
            "detection_string": "1280x1024",
            "name": "Super Extended Graphics Array",
            "aspect_ratio": "5:4",
            "abbrevation": "SXGA"
        },
        {
            "id": "2",
            "width": "1280",
            "height": "800",
            "detection_string": "1280x800",
            "name": "Wide XGA",
            "aspect_ratio": "8:5",
            "abbrevation": "WXGA"
        },
        ...
}

User

GET user/[:id:]

Request:

GET user/me

Response:

{
    "User": {
        "id": 1,
        "organizations": [
            {
                "id": 1,
                "name": "Groendalsvaengets Skole",
                "employees": {
                    "id": 1,
                    "organizations": [
                        "1"
                    ],
                    "email": "test",
                    "name": "Bo"
                }
            }
        ],
        "email": "test",
        "name": "Bo"
    },
    "count": 4,
    "error_message": null,
    "error_code": null,
    "script_excecution_time": "0.0218",
    "server_time": 1344546409
}

Id : The id can either me an integer value or me

Computer Models

GET options/computer_model?manufacturer=[:manufacturer:]&type=[:device_type:]&name=[:name:]

Request:

GET options/computer_model

Response:

{
    "Computer_Models": [
        {
            "id": 1,
            "manufacturer": {
                "id": 4,
                "name": "Dell",
                "abbrevation": "Dell"
            },
            "type": {
                "id": 2,
                "name": "Desktop",
                "category": {
                    "id": 1,
                    "name": "Computer"
                }
            },
            "name": "OptiPlex 790",
            "detection_string": "OptiPlex 790"
        },
        {
            "id": 2,
            "type": {
                "id": 1,
                "name": "Laptop",
                "category": {
                    "id": 1,
                    "name": "Computer"
                }
            },
            "name": "Unknown Model"
        },
        ...
    ],
    "count": 25,
    "error_message": null,
    "error_code": null,
    "script_excecution_time": "0.3476",
    "server_time": 1344548373
}

Manufacturer : An optional parameter to search for computer models only matching that manufactuer

Device_Type : An optional parameter selecting device type ie Laptop

Name : An optional parameter selecting the name or a part of the model name

Manufacturers

GET options/manufacturer?name=[:name:]

Request:

GET options/manufacturer

Response:

{
    "Manufacturers": [
        {
            "id": 1,
            "name": "Hewlett Packard",
            "abbrevation": "HP"
        },
        {
            "id": 2,
            "name": "Intel",
            "abbrevation": "Intel"
        },
        {
            "id": 3,
            "name": "IBM",
            "abbrevation": "IBM"
        },
        .....
    ],
    "count": 18,
    "error_message": null,
    "error_code": null,
    "script_excecution_time": "0.0669",
    "server_time": 1344548987
}

Name : An optional paremeter selecting the name or part of the name for the manufacturer

Clone this wiki locally