Private
Update a version
Changed onUpdate a version for an edition of a dataset, if the state is changed to associated or published, the parent documents(dataset and edition resources) will also be updated. A version can only be updated if the state is not published
put/datasets/{id}/editions/{edition}/versions/{version}
Request
- Base URLhttps://api.beta.ons.gov.uk/v1
- Auth
- API key in header Authorization
- or API key in header Authorization and API key in header X-Download-Service-Token
Path parameters
idstring required
ID that represents a dataset
editionstring required
An edition of a dataset
versionstring required
A version of a dataset
Request body
Example request
{
"alerts": [
{
"description": "This is a description of the changes made as part of the correction or other important notice about this version.",
"type": "correction"
}
],
"collection_id": "666c06bc09d337ab9d164c82f8f383c081a4e38cbd91b79d4a23ea0025fecb3f",
"dataset_id": "my-dataset",
"dimensions": [
{
"links": {
"version": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions/5",
"id": "5"
}
}
}
],
"distributions": [
{
"title": "Full Dataset (CSV)",
"download_url": "https://download.ons.gov.uk/my-dataset-download.csv",
"byte_size": 4300000
}
],
"downloads": {
"csv": {
"href": "https://download.ons.gov.uk/my-dataset-download.csv",
"size": "123456"
},
"csvw": {
"href": "https://download.ons.gov.uk/my-dataset.metadata.json",
"size": "123456"
},
"txt": {
"href": "https://download.ons.gov.uk/my-dataset.metadata.txt",
"size": "123456"
},
"xls": {
"href": "https://download.ons.gov.uk/my-dataset.xls",
"size": "123456"
}
},
"edition": "july-september-2017",
"edition_title": "July to September 2017",
"is_based_on": {
"id": "Usual-Residents",
"type": "cantabular_table"
},
"latest_changes": [
{
"description": "Some estimates for the periods between April 2011 and March 2019 have been updated. This is because of changes in guidance on suppressing data, where estimates are no longer required to be suppressed solely based on their co-efficient of variation (CV) values.",
"name": "Data Suppression Changes"
}
],
"links": {
"dataset": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset",
"id": "my-dataset"
},
"dimensions": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions/5/dimensions"
},
"edition": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-datasets/editions/july-september-2017",
"id": "july-september-2017"
},
"self": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions/5"
},
"web_page": {
"href": "https://www.ons.gov.uk/businessindustryandtrade/datasets/my-dataset/editions/july-september-2017/versions/5"
},
"versions": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions"
}
},
"related_content": [
{
"href": "https://www.ons.gov.uk/my-related-page",
"title": "Related Link Title",
"description": "This is a description of the linked resource."
}
],
"state": "published",
"type": "static",
"usage_notes": [
{
"title": "Data Suppression",
"note": "Individual estimates suppressed with \"[c]\" relate to statistics based on a small number of respondents (< 5). Such values have been suppressed on quality grounds and to maintain confidentiality."
}
],
"version": 1
}Response
A json object containing a version
Example response
{
"alerts": [
{
"description": "This is a description of the changes made as part of the correction or other important notice about this version.",
"type": "correction"
}
],
"collection_id": "666c06bc09d337ab9d164c82f8f383c081a4e38cbd91b79d4a23ea0025fecb3f",
"dataset_id": "my-dataset",
"dimensions": [
{
"links": {
"version": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions/5",
"id": "5"
}
}
}
],
"distributions": [
{
"title": "Full Dataset (CSV)",
"download_url": "https://download.ons.gov.uk/my-dataset-download.csv",
"byte_size": 4300000
}
],
"downloads": {
"csv": {
"href": "https://download.ons.gov.uk/my-dataset-download.csv",
"size": "123456"
},
"csvw": {
"href": "https://download.ons.gov.uk/my-dataset.metadata.json",
"size": "123456"
},
"txt": {
"href": "https://download.ons.gov.uk/my-dataset.metadata.txt",
"size": "123456"
},
"xls": {
"href": "https://download.ons.gov.uk/my-dataset.xls",
"size": "123456"
}
},
"edition": "july-september-2017",
"edition_title": "July to September 2017",
"is_based_on": {
"id": "Usual-Residents",
"type": "cantabular_table"
},
"latest_changes": [
{
"description": "Some estimates for the periods between April 2011 and March 2019 have been updated. This is because of changes in guidance on suppressing data, where estimates are no longer required to be suppressed solely based on their co-efficient of variation (CV) values.",
"name": "Data Suppression Changes"
}
],
"links": {
"dataset": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset",
"id": "my-dataset"
},
"dimensions": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions/5/dimensions"
},
"edition": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-datasets/editions/july-september-2017",
"id": "july-september-2017"
},
"self": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions/5"
},
"web_page": {
"href": "https://www.ons.gov.uk/businessindustryandtrade/datasets/my-dataset/editions/july-september-2017/versions/5"
},
"versions": {
"href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset/editions/july-september-2017/versions"
}
},
"related_content": [
{
"href": "https://www.ons.gov.uk/my-related-page",
"title": "Related Link Title",
"description": "This is a description of the linked resource."
}
],
"state": "published",
"type": "static",
"usage_notes": [
{
"title": "Data Suppression",
"note": "Individual estimates suppressed with \"[c]\" relate to statistics based on a small number of respondents (< 5). Such values have been suppressed on quality grounds and to maintain confidentiality."
}
],
"version": 1
}Changes
- breaking
removed the success response with the status
- info
added the success response with the status
- breaking
- info
the endpoint scheme security
Authorizationwas added to the API - info
the endpoint scheme security
Authorization AND DownloadServiceAPIKeywas added to the API - info
api tag
Privateadded - info
api tag
Private userremoved
- info