REST API

Access

  • Please contact store@bfs.de to request access.
  • Accessing the API is completely free and we only require a valid ORCID ID for security reasons.

Authentication

Access to the STORE REST API is via the standard authentication process:

  • Call the /login endpoint with your ORCID ID and password. Javascript Example:
    								
    	$.ajax({
    		url: "https://www.storedb.org/store_v3/rest-api/login",
    		type: 'POST',
    		dataType: 'json',
    		contentType: 'application/json',
    		processData: false,
    		data: JSON.stringify({
    			"orcidId": "your-orcid-id-here",
    			"password": "your-password-here"
    		}),
    		done: function(data, textStatus, request) {
    			console.log('Login successful. Token received: ' + request.getResponseHeader('Authorization'));
    			token = request.getResponseHeader('Authorization');
    		}
    	});
    								
    							
  • Use the returned token to get access to the other endpoints and to retrieve data.

Retrieving data

All data in STORE can be retrieved through GET endpoints (see below) and by providing the access token in the Authorization header field. Javascript Example:

								
	$.ajax({
		beforeSend: function(request) {
			request.setRequestHeader("Authorization", your-token-from-above);
		},
		url: "https://www.storedb.org/store_v3/rest-api/studyEntities",
		type: 'GET',
		dataType: 'json',
		contentType: 'application/json',
		processData: false,
		success: function(data, textStatus, request) {
			console.log(data);								  
		},
		error: function(request, textStatus, errorThrown) {
			console.log(errorThrown);
		},
		});
								
							

Endpoints

POST

  • https://www.storedb.org/store_v3/rest-api/login (Provide ORCID ID and password as JSON body - see above)

GET

All of the below endpoints require the Authorization header (see above)

  • https://www.storedb.org/store_v3/rest-api/studyEntities (Returns a list of all studies in STORE)
  • https://www.storedb.org/store_v3/rest-api/studyEntity/{STUDYID} (Returns all attributes and values (incl dataset and file data) for the given study)

As the study endpoint above includes all data, most use cases shouldn't require the following, but they can be used if required to load indivual bits of data:

  • https://www.storedb.org/store_v3/rest-api/datasetEntities (Returns a list of all datasets in STORE)
  • https://www.storedb.org/store_v3/rest-api/datasetEntity/{DATASETID} (Returns all attributes and values for the given dataset)
  • https://www.storedb.org/store_v3/rest-api/fileEntities (Returns a list of all files in STORE - NOTE: This is a long list!)
  • https://www.storedb.org/store_v3/rest-api/fileEntity/{FILEID} (Returns all attributes and values for the given file)
  • https://www.storedb.org/store_v3/rest-api/attributes (Returns a list of all attributes in STORE incl allowed values)
  • https://www.storedb.org/store_v3/rest-api/attribute/{ATTRIBUTEID} (Returns all attributes details)