-
In a first approach, we define an API without authentication. As a consequence, this API will be constraint to the read only access to public data. Later on, we will add authentication to allow also access to embargoed data and may also consider to allow the creation of new datasets.
-
As the purpose of the API is to find metadata of documents (currently publications and proposals) and the datasets that are part of these documents, a decision has been made to only expose endpoints for documents, datasets and instruments.
Get a single dataset.
GET /datasets/{pid}
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Datasets/{pid}?filter={filter}'
pid : the pid of the dataset
filter: : a query
A dataset JSON object as defined in the data model. To include child objects, see Querying and Dataset Queries.
{
"pid": "20.500.12269/panosc-dataset1",
"title": "PaNOSC Test Dataset 1",
"isPublic": true,
"creationDate": "2020-05-05T15:01:02.341Z",
"documentId": "10.5072/panosc-document1",
"instrumentId": "20.500.12269/0f98fcf2-7bd7-430e-ad20-d47031ca8f71"
}
Get files for a dataset.
GET /datasets/{pid}/files
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Datasets/20.500.12269%2Fpanosc-dataset1/files?filter={filter}'
pid : the pid of the dataset
filter: : a query
An array of file JSON objects as defined in the data model.
[
{
"id": 1,
"name": "panosc-file1.hdf",
"datasetId": "20.500.12269/panosc-dataset1"
}
]
Get number of files for a dataset.
GET /datasets/{pid}/files/count
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Datasets/{pid}/files/count?where={where}'
pid : the pid of the dataset
where: : a where query
A JSON object.
{
"count": 1
}
Search for datasets.
GET /datasets
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Datasets?filter={filter}'
filter : a query
An array of dataset JSON objects as defined in the data model. To include child objects, see Querying and Dataset Queries.
[
{
"pid": "20.500.12269/panosc-dataset1",
"title": "PaNOSC Test Dataset 1",
"isPublic": true,
"creationDate": "2020-05-05T15:01:02.341Z",
"score": 0,
"documentId": "10.5072/panosc-document1",
"instrumentId": "20.500.12269/0f98fcf2-7bd7-430e-ad20-d47031ca8f71"
},
{
"pid": "20.500.12269/panosc-dataset2",
"title": "PaNOSC Test Dataset 2",
"isPublic": true,
"score": 0,
"creationDate": "2020-05-05T15:01:02.341Z",
"documentId": "10.5072/panosc-document1",
"instrumentId": "20.500.12269/125e8172-d0f4-4547-98be-a9db903a6269"
}
]
Get number of datasets.
GET /datasets/count
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Datasets/count?where={where}'
where : a where query
{
"count": 4
}
Get a single document.
GET /documents/{pid}
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Documents/{pid}?filter={filter}'
pid : the pid of the document
filter : a query
A document JSON object as defined in the data model. To include child objects, see Querying and Document Queries.
{
"pid": "10.5072/panosc-document1",
"isPublic": true,
"type": "publication",
"title": "PaNOSC Test Publication"
}
Search for documents.
GET /documents
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Documents?filter={filter}'
filter : a query
An array of document JSON objects as defined in the data model. To include child objects, see Querying and Document Queries.
[
{
"pid": "10.5072/panosc-document1",
"isPublic": true,
"type": "publication",
"title": "PaNOSC Test Publication",
"score": 0
},
{
"pid": "10.5072/panosc-document2",
"isPublic": true,
"type": "proposal",
"title": "PaNOSC Test Proposal",
"score": 0
}
]
Get number of documents.
GET /documents/count
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Documents/count?where={where}'
where : a where query
{
"count": 2
}
Get a single instrument.
GET /instruments/{pid}
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Instruments/{pid}?filter={filter}'
pid : the pid of the instrument
filter : a query
An instrument JSON object as defined in the data model.
{
"pid": "20.500.12269/0f98fcf2-7bd7-430e-ad20-d47031ca8f71",
"name": "LoKI",
"facility": "ESS"
}
Search for instruments.
GET /instruments
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Instruments?filter={filter}'
filter : a query
An array of instrument JSON objects as defined in the data model.
[
{
"pid": "20.500.12269/0f98fcf2-7bd7-430e-ad20-d47031ca8f71",
"name": "LoKI",
"facility": "ESS",
"score": 0
},
{
"pid": "20.500.12269/125e8172-d0f4-4547-98be-a9db903a6269",
"name": "ODIN",
"facility": "ESS",
"score": 0
}
]
Get number of instruments.
GET /instruments/count
curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/Instruments/count?where={where}'
where : a where query
{
"count": 15
}