v1

latestOpenAPI 3.0.0Open Government Licence v3.02026-07-23111218.0 KB
Create file access event

Log a file access event

post/file-events

Request body

created_atstring date-time

The date and time the event occurred.

action'CREATE' | 'READ' | 'UPDATE' | 'DELETE' required

The action taken by the user.

resourcestring required

The path of the API resource that was called.

Example request

{
  "requested_by": {
    "id": "0889d599-3f0e-4564-9d6e-9455a6b73da7",
    "email": "publisher@ons.gov.uk"
  },
  "action": "READ",
  "resource": "/downloads-new/dataset-upload/myfile.csv",
  "file": {
    "path": "images/meme.jpg",
    "is_publishable": true,
    "collection_id": "1234-asdfg-54321-qwerty",
    "bundle_id": "bundle-789-xyz",
    "title": "The latest Meme",
    "size_in_bytes": 14794,
    "type": "image/jpeg",
    "licence": "OGL v3",
    "licence_url": "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",
    "etag": "1234567890asdfghjk",
    "state": "UPLOADED",
    "content_item": {
      "dataset_id": "cpih01",
      "edition": "time-series",
      "version": "1"
    }
  }
}

Response

File access event successfully created

created_atstring date-time

The date and time the event occurred.

action'CREATE' | 'READ' | 'UPDATE' | 'DELETE' required

The action taken by the user.

resourcestring required

The path of the API resource that was called.

Example response

{
  "requested_by": {
    "id": "0889d599-3f0e-4564-9d6e-9455a6b73da7",
    "email": "publisher@ons.gov.uk"
  },
  "action": "READ",
  "resource": "/downloads-new/dataset-upload/myfile.csv",
  "file": {
    "path": "images/meme.jpg",
    "is_publishable": true,
    "collection_id": "1234-asdfg-54321-qwerty",
    "bundle_id": "bundle-789-xyz",
    "title": "The latest Meme",
    "size_in_bytes": 14794,
    "type": "image/jpeg",
    "licence": "OGL v3",
    "licence_url": "http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",
    "etag": "1234567890asdfghjk",
    "state": "UPLOADED",
    "content_item": {
      "dataset_id": "cpih01",
      "edition": "time-series",
      "version": "1"
    }
  }
}