GET method for /api/resources/
$.ajax({
url: "/api/resources/?title=DataONE",
type: 'GET',
success: function (data, status) {
if (status == 'success') {
//If the request was successful parse the data.
//This example will print out the title of the first result to console
console.log(data.results[0].title)
}else{
//If the request failed, handle this response.
console.log(status)
};
}
});
| Name | Type | Example | Description |
|---|---|---|---|
| title | string | DataONE | The title of the learning resource. |
| url | string | dataoneorg.github.io | |
| access_cost | float | 1.0 | |
| submitter_name | string | "Amber E Budden" | |
| submitter_email | string | example@example.com | |
| authors.givenName | string | Robert | |
| authors.familyName | string | Mayernik | |
| contributors.givenName | string | Robert | |
| contributors.familyName | string | HOEBELHEINRICH | |
| author_org.name | string | DataONE | |
| creator | string | Nhoebelheinrich | |
| contact | string | "Nancy J. Hoebelheinrich" | |
| contact_org | string | NASA | |
| abstract_data | string | researchers | |
| abstract_format | string | filtered_html | |
| subject | string | Aerospace | |
| keywords | string | "Data management" | |
| licence | string | "Creative Commons" | |
| usage_info | string | USGS | |
| citation | string | research | |
| locator_data | string | "10.5281/zenodo.239090" | |
| locator_type | string | DOI | |
| publisher | string | "Oak Ridge National Laboratory" | |
| version | string | "1.0" | |
| access_features | string | Transformation | |
| language_primary | string | es | |
| languages_secondary | string | fr | |
| ed_frameworks.name | string | "FAIR Data Principles" | |
| ed_frameworks.nodes | string | Local Data Management | |
| ed_frameworks.nodes.url | string | dataone.org | |
| target_audience | string | "Research scientist" | |
| purpose | string | "Professional Development" | |
| completion_time | string | "1 hour" | |
| media_type | string | "Moving Image" | |
| lr_type | string | "Learning Activity" | |
| limit | int | 15 | Maximum number of results to return. Default is 10 |
| facet_limit | int | 15 | Maximum number of results to return. Default is 100. -1 shows all. |
| facet_sort | string | count | Order of the facets can be "count" or "index". Index is Alphabetic |
POST method for /api/resources/
$.ajax({
type: "POST",
url: '/api/resources/',
dataType: 'json',
contentType: 'application/json',
async: false,
data: ,'{
"search": [
{
"group": "and",
"and": [
{
"field": "keywords",
"string": "ethics",
"type": "simple"
},
{
"field": "created",
"string": "2019-05-20T17:33:18Z",
"type": "gte"
}
],
"or": [
{
"field": "submitter_name",
"string": "Karl",
"type": "simple"
}
]
}
],
"limit": 10,
"offset": 0,
"sort": "id asc",
"facet_limit": -1,
"facet_sort": "count"
}',
success: function (data) {
console.log(data)
document.getElementById("postresult").appendChild(renderjson(data));
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
console.log("fail")
alert("Status: " + textStatus); alert("Error: " + errorThrown);
}
})
| Name | Type | Example | Description |
|---|---|---|---|
| title | string | DataONE | The title of the learning resource. |
| url | string | dataoneorg.github.io | |
| access_cost | float | 1.0 | |
| submitter_name | string | "Amber E Budden" | |
| submitter_email | string | example@example.com | |
| authors.givenName | string | Robert | |
| authors.familyName | string | Mayernik | |
| contributors.givenName | string | Robert | |
| contributors.familyName | string | HOEBELHEINRICH | |
| author_org.name | string | DataONE | |
| creator | string | Nhoebelheinrich | |
| contact | string | "Nancy J. Hoebelheinrich" | |
| contact_org | string | NASA | |
| abstract_data | string | researchers | |
| abstract_format | string | filtered_html | |
| subject | string | Aerospace | |
| keywords | string | "Data management" | |
| licence | string | "Creative Commons" | |
| usage_info | string | USGS | |
| citation | string | research | |
| locator_data | string | "10.5281/zenodo.239090" | |
| locator_type | string | DOI | |
| publisher | string | "Oak Ridge National Laboratory" | |
| version | string | "1.0" | |
| access_features | string | Transformation | |
| language_primary | string | es | |
| languages_secondary | string | fr | |
| ed_frameworks.name | string | "FAIR Data Principles" | |
| ed_frameworks.nodes | string | Local Data Management | |
| ed_frameworks.nodes.url | string | dataone.org | |
| target_audience | string | "Research scientist" | |
| purpose | string | "Professional Development" | |
| completion_time | string | "1 hour" | |
| media_type | string | "Moving Image" | |
| lr_type | string | "Learning Activity" | |
| limit | int | 15 | Maximum number of results to return. Default is 10 |
| facet_limit | int | 15 | Maximum number of results to return. Default is 100. -1 shows all. |
| facet_sort | string | count | Order of the facets can be "count" or "index". Index is Alphabetic |