Summary

API Endpoint Address

https://api.trackrecordpro.co.uk/3.0/files

Minimum Supported API Version3.0
Supported Methods

GET
POST
PUT
DELETE

Access LevelEveryone
DescriptionEach asset may optionally be assocated with one or more files, each of which have a description. To define the descriptions and metadata, use this endpoint, and to upload an actual file associated with the entry, use the upload endpoint.

GET files

GET /3.0/files HTTP/1.1

Details

Returns a list of files associated with one or more assets. Note that this returns only a reference to the files, and if you need the file content you may fetch them with a separate web request using these addresses as locations. To upload files against these references, you must use the upload endpoint, with the parameters specified in the upload_endpoint parameter.

{
    "request": {
        "url": "\/3.0\/files",
        "endpoint": "files",
        "requested_version": "3.0",
        "api_version": 3,
        "request_method": "Get",
        "timestamp": 1507557662,
        "session": null
    },
    "pagination": {
        "total_pages": 24,
        "total_records": 692
    },
    "response": [
        {
            "id": 1,
            "upload_uuid": null,
            "upload_endpoint": "https:\/\/api.trackrecordpro.co.uk\/3.0\/upload\/5ad8ef80-a8da-11e7-bc5c-3417ebeecb23",
            "filedate": "2017-10-04",
            "description": "Calibration of asset 1",
            "filename": "",
            "asset_id": 1,
            "company_id": 1,
            "data": {},
            "asset": {
                "id": 1,
                "asset_no": "TEST1",
                "serial_no": "TEST1SER",
                "status": "Active",
                "next_check": "2017-10-26",
                "period": 12,
                "company_id": 1,
                "location_id": 1,
                "department_id": 1,
                "description": "Test Asset 1",
                "data": null
            },
            "company": {
                "id": 1,
                "name": "TrackRecordPro",
                "created": "2017-10-09 08:42:37",
                "logo": "trp.png",
                "subdomain": "trackrecordpro",
                "styles": {
                    "test": {
                        "foo": "bar",
                        "baz": 1
                    },
                    "test2": 666.7
                },
                "data": null
            }
        },
        {
            "id": 2,
            "upload_uuid": null,
            "upload_endpoint": "https:\/\/api.trackrecordpro.co.uk\/3.0\/upload\/13cef708-a8db-11e7-bc5c-3417ebeecb23",
            "filedate": "2017-10-04",
            "description": "Second Cal of Asset 1",
            "filename": "files\/1\/3dbc82b51fcf2ff84f43b02ad7dd4c6e.png",
            "asset_id": 1,
            "company_id": 1,
            "data": {},
            "asset": {
                "id": 1,
                "asset_no": "TEST1",
                "serial_no": "TEST1SER",
                "status": "Active",
                "next_check": "2017-10-26",
                "period": 12,
                "company_id": 1,
                "location_id": 1,
                "department_id": 1,
                "description": "Test Asset 1",
                "data": null
            },
            "company": {
                "id": 1,
                "name": "TrackRecordPro",
                "created": "2017-10-09 08:42:37",
                "logo": "trp.png",
                "subdomain": "trackrecordpro",
                "styles": {
                    "test": {
                        "foo": "bar",
                        "baz": 1
                    },
                    "test2": 666.7
                },
                "data": null
            }
        }
    ]
}

POST files

POST /3.0/files HTTP/1.1

Details

Update an entry in the files table. You must include the fields and values to update as a JSON object in the POST data. Note that you cannot include the actual file content using this endpoint, only the metadata. Once you have updated or added the metadata, you can use the upload_endpoint field to determine where to post the actual file data.

{
    "request": {
        "url": "\/3.0\/files\/id=42",
        "endpoint": "files",
        "requested_version": "3.0",
        "api_version": 3,
        "request_method": "Post",
        "timestamp": 1507622071,
        "session": null
    },
    "response": {
        "records_updated": 1,
        "records_found": 1
    }
}

 

 

PUT files

PUT /3.0/files HTTP/1.1

Details

Describe the PUT method

Example here

DELETE files

DELETE /3.0/files HTTP/1.1

Details

Describe the DELETE method

Example here

Field Definitions

Expand

Invalid license

Your evaluation license of PocketQuery expired. Please contact an administrator to purchase a new license.

 

 

{
    "request": {
        "url": "\/3.0\/files",
        "endpoint": "files",
        "requested_version": "3.0",
        "api_version": 3,
        "request_method": "Get",
        "timestamp": 1507557662,
        "session": null
    },
    "response": [
        {
            "id": 1,
            "upload_uuid": null,
            "upload_endpoint": "https:\/\/api.trackrecordpro.co.uk\/3.0\/upload\/5ad8ef80-a8da-11e7-bc5c-3417ebeecb23",
            "filedate": "2017-10-04",
            "description": "Calibration of asset 1",
            "filename": "",
            "asset_id": 1,
            "company_id": 1,
            "data": {},
            "asset": {
                "id": 1,
                "asset_no": "TEST1",
                "serial_no": "TEST1SER",
                "status": "Active",
                "next_check": "2017-10-26",
                "period": 12,
                "company_id": 1,
                "location_id": 1,
                "department_id": 1,
                "description": "Test Asset 1",
                "data": null
            },
            "company": {
                "id": 1,
                "name": "TrackRecordPro",
                "created": "2017-10-09 08:42:37",
                "logo": "trp.png",
                "subdomain": "trackrecordpro",
                "styles": {
                    "test": {
                        "foo": "bar",
                        "baz": 1
                    },
                    "test2": 666.7
                },
                "api_publickey_signature": "8EE9B31CE3874D30",
                "api_impersonation": 0,
                "api_assetqueue_manager_id": 1,
                "api_can_create_companies": 1,
                "api_webhook": null,
                "parent_company_id": 1,
                "data": null
            }
        },
        {
            "id": 2,
            "upload_uuid": null,
            "upload_endpoint": "https:\/\/api.trackrecordpro.co.uk\/3.0\/upload\/13cef708-a8db-11e7-bc5c-3417ebeecb23",
            "filedate": "2017-10-04",
            "description": "Second Cal of Asset 1",
            "filename": "files\/1\/3dbc82b51fcf2ff84f43b02ad7dd4c6e.png",
            "asset_id": 1,
            "company_id": 1,
            "data": {},
            "asset": {
                "id": 1,
                "asset_no": "TEST1",
                "serial_no": "TEST1SER",
                "status": "Active",
                "next_check": "2017-10-26",
                "period": 12,
                "company_id": 1,
                "location_id": 1,
                "department_id": 1,
                "description": "Test Asset 1",
                "data": null
            },
            "company": {
                "id": 1,
                "name": "TrackRecordPro",
                "created": "2017-10-09 08:42:37",
                "logo": "trp.png",
                "subdomain": "trackrecordpro",
                "styles": {
                    "test": {
                        "foo": "bar",
                        "baz": 1
                    },
                    "test2": 666.7
                },
                "api_publickey_signature": "8EE9B31CE3874D30",
                "api_impersonation": 0,
                "api_assetqueue_manager_id": 1,
                "api_can_create_companies": 1,
                "api_webhook": null,
                "parent_company_id": 1,
                "data": null
            }
        }
    ]
}