Resources

Current API version: v2
Table of Contents:
Table of Contents
Subject Description
Filtering on language Using the lang parameter
Search and sort Using the search and sort parameters
Total count of items The X-Total-Count header
Pagination Using the pagination parameters
Resource Description
GET biobanks?{parameters} Search for biobanks
GET biobanks/{id} Retrieve biobank by id
POST biobanks This request requires authorization. Create a biobank
PATCH biobanks/{id} This request requires authorization. Modify an existing biobank
GET biobanks/{id}/projects Retrieve projects related to a biobank by its id
GET biobanks/materials Show list of all valid biobank material codes
GET countries List supported countries
GET fundings?{parameters} Search for fundings/grants
GET fundings/{id} Retrieve funding/grant by id
GET fundings/{id}/projects Retrieve projects related to a funding/grant by its id
GET fundings/{id}/results Retrieve results related to a funding/grant by its id
GET fundings/sources Show list of all available funding sources
GET institutions?{parameters} Search for institutions
GET institutions/{id} Retrieve institution by id
GET keywords?{parameters} Search for keywords
GET keywords/{id} Retrieve keyword by id
POST keywords This request requires authorization. Create a new keyword
GET persons?{parameters} Search for persons
GET persons/{id} Retrieve person by id
POST persons This request requires authorization. Create a new person
PATCH persons/{id} This request requires authorization. Modify an existing person
GET persons/{pid}/affiliations This request requires authorization. Retrieve affiliations of a given person
POST persons/{id}/affiliations This request requires authorization. Create affiliation of a given person
GET persons/{pid}/affiliations/{aid} This request requires authorization. Retrieve an affiliation of a given person
PATCH persons/{pid}/affiliations/{aid} This request requires authorization. Modify an affiliation of a given person
DELETE persons/{pid}/affiliations/{aid} This request requires authorization. Delete an affiliation of a given person
GET persons/affiliations/positions Retrieve position codes for persons' affiliations
GET persons/{pid}/institutions/{iid} This request requires authorization. Retrieve person information specific to an institution
PATCH persons/{pid}/institutions/{iid} This request requires authorization. Modify person information specific to an institution
GET persons/{pid}/picture Retrieve profile picture for a given person
PUT persons/{pid}/picture This request requires authorization. Store profile picture for a given person
GET persons/{id}/users This request requires authorization. Retrieve all user accounts for a specific person
POST persons/{id}/users This request requires authorization. Create a new user account for a person
PATCH persons/{pid}/users/{accountid} This request requires authorization. Modify person user account specific to an institution
GET persons/{id}/results Retrieve results by person id
GET projects?{parameters} Search for projects
GET projects/{id} Retrieve project by id
POST projects This request requires authorization. Create a project
PATCH projects/{id} This request requires authorization. Modify an existing project
GET projects/{id}/biobanks Retrieve a project's related biobanks by project id
GET projects/{id}/datasets Retrieve project datasets by project id
POST projects/{id}/datasets This request requires authorization. Create a dataset for a project
PUT projects/{id}/datasets This request requires authorization. Update the whole collection of datasets for a project
GET projects/participants/roles Show all valid project participant roles (role codes)
GET results?{parameters} Search for results
GET results/{id} Retrieve result by id
GET results/{id}/chapters Retrieve result's chapters by result id, applicable only for books with chapters
GET results/{id}/contributors Retrieve result's contributors by result id
GET results/categories Show list of all valid result category codes
GET units?{parameters} Search for units
GET units/{id} Retrieve unit by id
GET units/{id}/results Retrieve results by unit id

Filtering on language

Using the 'lang' parameter

System data

For fields like 'institution_name' the text may be given in system data languages. System data languages are predefined in Cristin system and cannot be altered by the users. They are:

  • Norwegian Bokmål (nb)
  • Norwegian Nynorsk (nn)
  • English (en)

Filtering: These fields will be filtered on the language given by the request parameter 'lang'. The client may request one or several, comma-separated language codes.

Fallback language rules: If language is not specified in the url the default language English is used. If the specified language doesn't exist for a particular item, the data for this item will be given in 'Norwegian Bokmål'.

https://api.cristin.no/v2/institutions/2012?lang=nb
{
  "cristin_institution_id": 2012,
  "institution_name": {
	"nb": "Oslo universitetssykehus HF"
  },
  ...
}

https://api.cristin.no/v2/institutions/2012?lang=en
{
  "cristin_institution_id": 2012,
  "institution_name": {
	"en": "Oslo University Hospital"
  },
  ...
}

https://api.cristin.no/v2/institutions/2012?lang=en,nb
{
  "cristin_institution_id": 2012,
  "institution_name": {
	"nb": "Oslo universitetssykehus HF",
	"en": "Oslo University Hospital"
  },
  ...
}

Default language: If the 'lang' parameter is omitted, system data will be returned in English

https://api.cristin.no/v2/institutions/2012
{
  "cristin_institution_id": 2012,
  "institution_name": {
	"en": "Oslo University Hospital"
  },
  ...
}

Fallback language: If the requested language doesn't exist for a field, the data for this field will be given in 'Norwegian Bokmål'

https://api.cristin.no/v2/projects/257?lang=nn
{
  "cristin_project_id": "257",
  ...
  "coordinating_institution": {
	"institution": {
	  "cristin_institution_id": "185",
	  "institution_name": {
		"nn": "Universitetet i Oslo" //data for 'nn' exists
	  },
	  "url": "https://api.cristin.no/v2/institutions/185"
	},
	"unit": {
	  "cristin_unit_id": "185.90.0.0",
	  ...
	}
  },
  "institutions_responsible_for_research": [
	{
	  "institution": {
		"cristin_institution_id": "254.0.0.0",
		"institution_name": {
		  "nb": "NLA Høgskolen" //data for 'nn' doesn't exist, fallback to 'nb'
	  },
	  "unit": { ... }
	}
  ...
  ],
 ...
}

User data

Other fields like 'title' may be given in several languages (user data languages) and are not limited to the three system data languages. These fields will not be affected by the 'lang' parameter.


https://api.cristin.no/v2/projects?id=257&lang=nb
[
  {
	"cristin_project_id": "257",
	"title": {
	  "da": "Elektrokardiografisk kvantisering af reversibel iskæmisk celleskade mm. test av låste felt",
	  "nb": "BOKMÅL - Electrocardiographic quantisation of reversible ischemic cell damage and stuff. Test av låste felt",
	  "nn": "Sekundærtittel på norsk for prosjekt 257. test av låste felt"
	},
	"main_language": "da",
	"url": "https://api.cristin.no/v2/projects/257"
  }
]

Duplicate parameters

Duplicate parameters

Some parameters can be used more than once in the same query. Parameters that allow duplicates are marked and refer back to this section.
Parameters that do not refer to this section may cause an error if duplicated.
Duplicate parameters can be used to narrow the search even more, e.g ../projects?keyword=wind energy&keyword=data analysis

Total count

The response of a search will return a 'X-Total-Count' header with the total number of hits.
This can be used to calculate the total number of pages in a paginated response.

Pagination

Services like the search services that return many items will divide the requested items over one or several requests ("pages").

Pagination
Parameter Type Description
page String Page number. First page is 1. Default if omitted is 1.
per_page String Number of items per page. Maximum is 1000. Default if omitted is 100.

Using the Link header

Given a requested page and number of items, either specified by the client or default, the response will contain the URLs for the next and the previous page in the Link header, with the pagination parameters set accordingly.

On the first and last page, the URLs for the previous and next page, respectively, will be omitted.

Link header examples

Linebreak is included for readability.
  • First page with more items available will contain a header like the following:
    Link: <https://api.cristin.no/v2/institutions?page=2&per_page=100>; rel="next"
  • Second page with still more items available will contain a header like the following:
    Link: <https://api.cristin.no/v2/institutions?page=3&per_page=100>;rel="next",
    <https://api.cristin.no/v2/institutions?page=1&per_page=100>;rel="prev"
  • Page with no more items available will contain a header like the following:
    Link: <https://api.cristin.no/v2/institutions?page=21&per_page=1000>; rel="prev"

Examples

These examples returns all institutions known to Cristin and paginates the result. The response shows the Link header and part of the body.

  • Paginated with 100 items (default) per page and starting with page 1 with items 1, 2, 3 ... 100.
  • Returns page 10, with 100 items (default) per page (items 1001, 1002, 1003 ... 1100 on this page).
     
  • Returns page 1, with 30 items per page (items 1, 2, 3, ... 30 on this page).
     
  • Returns page 2, with 30 items per page (items 30, 31, 32, ... 60 on this page).
     

GET biobanks?{parameters}

Search for biobanks by a combination of filter parameters.

GET biobanks
Parameter Type Description
id String Cristin id of the biobank
name String Name of the biobank, or part of the name.
institution String Cristin id, acronym, name, or part of the name of the coordinating institution of the biobank.
modified_since String Only biobanks that have been created or modified since this date will be returned. Format: YYYY-MM-DD.
project String Cristin id of a project related to one or more biobanks
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination
type String Type of biobank. Can be "specificbiobank" or "generalbiobank"

Examples

Response

Returns a JSON object that conforms to the biobank summary JSON schema. The response will be paginated.

HTTP Status Codes

  • 200 - Ok, returns a list of biobank summaries.
  • 400 - Bad request, returned if the filter parameters are invalid.

GET biobanks/{id}

Retrieve a biobank by its id.

GET biobanks
Parameter Type Description
id String The Cristin id of the biobank
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that conforms to the biobank JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the biobank.
  • 307 - Redirect, returned if the biobank was merged or moved into another biobank.
  • 400 - Returned if the id is invalid
  • 404 - Returned if there is no content with the given id

POST biobanks

Create a new biobank. (This request requires authentication.)

The request must have Content-Type: application/json and the payload must conform to the POST biobank JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

Examples

Response

HTTP Status Codes

  • 201 - Created, returns a JSON representation of the newly created biobank, along with a HTTP header Location containing the URL of the biobank.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.

PATCH biobanks/{id}

Modify an existing biobank. (This request requires authentication.)

PATCH biobanks
Parameter Type Description
id String The Cristin id of the biobank

The request must have Content-Type: application/merge-patch+json and the payload must conform to the PATCH biobank JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

PATCH updates one or more fields of the resource following the JSON Merge Patch strategy: Fields that are included in the request are overwritten, while fields not included in the request remain unaltered.

Unrecognized fields or fields that are not part of the PATCH biobank JSON schema are currently silently ignored.

Examples

Response

HTTP Status Codes

  • 204 - No content, returned upon successful modification.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.
  • 403 - Forbidden, returned if this particular biobank cannot be modified.
  • 404 - Not found, returned if there is no biobank with this id.

GET biobanks/{id}/projects

Retrieve projects related to a biobank by its id

GET biobank projects
Parameter Type Description
id String The Cristin id of the biobank
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination
sort String Sorts on 'start_date' and/or 'end_date'. See Search and sort
Default sort order is on 'cristin_project_id' in ascending order.
fields String 'fields=all' gives a list of project objects with all available fields.
If this parameter is omitted, a list of project summaries with fewer fields will be returned.

Examples

Response

HTTP Status Codes

  • 200 - Ok, returns a list of project summaries.
  • 400 - Bad request, returned if the filter parameters are invalid.
  • 404 - Not found, returned if there is no biobank with this id.

Returns a list of JSON objects. The list conforms to the projects summary JSON schema. The response will be paginated.

Response headers

  • X-Total-Count - total number of hits
  • Link - pagination previous and next page

GET biobanks/materials

Show list of all valid biobank material codes.

GET biobanks/materials
Parameter Type Description
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that contains an array with all valid biobank materials and conforms to the database codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of biobank materials.

GET countries

List all supported countries.

GET countries
Parameter Type Description
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that contains an array with countries and conforms to the country codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of countries.

GET fundings?{parameters}

Search for fundings

GET fundings
Parameter Type Desciption
id String The Cristin id of the funding.
funding_source_name String Funding source name e.g: Research Council of Norway
funding_source String Funding source code e.g: NFR
project_code String Project code is the internal reference number used by funding source
funding String Funding source code e.g: NFR, and project_code together separated by ':'
'NFR:1234' means 'funding_source': 'NFR' with 'project_code': '1234'
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination
fields String 'fields=all' gives a list of funding objects with all available fields. If this parameter is omitted, a list of funding summaries with fewer fields will be returned.

Examples


Response

Returns a JSON object that conforms to the fundings JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the list of fundings.
  • 400 - Bad request, any query paramters are invalid

GET fundings/{id}

Retrieves a funding by its id.

GET fundings
Parameter Type Description
id String The Cristin id of the funding.
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that conforms to the funding JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the funding
  • 400 - Bad request, returned if the id is invalid
  • 404 - Not found, returned if no funding with this id could be found

GET fundings/{id}/projects

Retrieves projects related to a funding by its id.

GET fundings/{id}/projects
Parameter Type Description
id String The Cristin id of the funding.
page String Page number. See Pagination
per_page String Number of items per page. See Pagination
lang String Two letter language code. Using the 'lang' parameter

Examples

  •  

Response

Returns a JSON object that conforms to the funding JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the list of projects
  • 400 - Bad request, returned if the id is invalid
  • 404 - Not found, returned if no funding with this id could be found

GET fundings/{id}/results

Retrieves results related to a funding by its id.

GET fundings/{id}/results
Parameter Type Description
id String The Cristin id of the funding.
page String Page number. See Pagination
per_page String Number of items per page. See Pagination
lang String Two letter language code. Using the 'lang' parameter

Examples

  •  

Response

Returns a JSON object that conforms to the funding JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the list of results
  • 400 - Bad request, returned if the id is invalid
  • 404 - Not found, returned if no funding with this id could be found

GET fundings/sources

Show list of all available funding sources.

GET fundings/sources
Parameter Type Description
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that contains an array with all available funding sources and conforms to the database codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of funding sources.

GET institutions?{parameters}

Search for institutions by a combination of filter parameters.

GET institutions
Parameter Type Description
id String Cristin id of the institution
name String Name or acronym of the institution
country String Two letter country code (ISO 3166-1 alpha-2)
cristin_institution Boolean If institution is an identified cristin institution or not (true/false)
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination

Examples

Response

Returns a JSON object that contains an array with matching institutions and conforms to the institutions summary JSON schema. The response will be paginated.

HTTP Status Codes

  • 200 - Ok, returns list of institution summaries.
  • 400 - Bad request, returned if the filter parameters are invalid.

GET institutions/{id}

Retrieve an institution by its id.

GET institutions
Parameter Type Description
id String The Cristin id of the institution
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that conforms to the institution JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the institution.
  • 307 - Redirect, returned if the institution was merged into another institution.
  • 400 - Returned if the id is invalid
  • 404 - Returned if there is no content with the given id

GET keywords?{parameters}

Search for keywords by name or browse all.

GET keywords
Parameter Type Description
name String The name of the keyword (that is, the keyword itself), or a part thereof, in any of the supported languages.
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination

Examples

Response

Returns a JSON object that contains an array with matching keywords and conforms to the database codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of keywords.
  • 400 - Bad request, returned if the filter parameters are invalid.

GET keyword/{id}

Retrieve keyword by identifier.

GET keyword
Parameter Type Description
id String Cristin id of the keyword.
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that contains a keyword and conforms to the database codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a keyword.
  • 404 - Returned if there is no content with the given id

POST keywords

Create a new keyword. (This request requires authentication.)

The request payload must conform to the POST Keyword JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

POST create a new keyword using the supplied languages and returns the newly created keyword as it will be shown in subsequent GET requests. If lang parameter is not supplied only the default language 'en' will be shown, but the other languages will be stored as well.

Unrecognized fields or fields that are not part of the POST keyword JSON schema are currently silently ignored.

Examples

Response

Returns a JSON object that conforms to the Database codes JSON schema.

HTTP Status Codes

  • 201 - Created, returned upon successful insertion.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.

Response headers

  • Location - Link to the created resource

GET persons?{parameters}

Search for persons by a combination of filter parameters.

GET persons
Parameter Type Description
id String Cristin id of the person
national_id String The eleven-digit Norwegian national id of the person (this parameter requires authorization)
name String First name, surname, or parts thereof of the person
institution String Cristin id, acronym, name, or part of the name of an institution the person is affiliated with
parent_unit_id String Id (e.g. unit=185.53.18.10) of a parent unit. Returns all persons affiliated with the given unit as well as its subunits. The paramter 'levels' can be used to narrow the scope.
levels String How many levels down from 'parent_unit_id' will be included in the search.'levels=1' will return persons affiliated with 'parent_unit_id', 'levels=2' will also include persons affiliated with that unit's direct subunit, and so on.
'levels' can also be used by itself to search for all persons registered to a known cristin unit down to the given level.
'levels' is a number between 1 and 32.
user String A person's username in Cristin together with the institution id separated by ':'
'askeladd:185' means Cristin user 'askeladd' from the institution '185'
page String Page number. See Pagination
per_page String Number of items per page. See Pagination
verified Boolean Show either verified or unverified persons only. Defaults to 'true'

Examples

Response

Returns a JSON object that contains an array with matching persons and conforms to the persons summary JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of person summaries.
  • 400 - Bad request, returned if the filter parameters are invalid.

GET persons/{id}

Retrieve a person by their id.

GET persons
Parameter Type Description
id String Cristin id of the person.
Alternatively, calling GET persons/ORCID:####-####-####-#### will attempt to resolve the person's verified ORCID and return a HTTP 307 redirect to the corresponding Cristin id.
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that conforms to the person JSON schema. Information may be truncated depending on client authorization.

HTTP Status Codes

  • 200 - Ok, returns the person.
  • 307 - Redirect, returned if the requested person id can be resolved to a different person id.
  • 400 - Returned if the id is invalid
  • 404 - Returned if there is no content with the given id

POST persons

Create a new person. (This request requires authentication.)

The request payload must conform to the POST person JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

POST create a new person using the supplied fields and returns the newly created person as it will be shown in subsequent GET requests.

Unrecognized fields or fields that are not part of the POST person JSON schema are currently silently ignored.

Examples

Request

Request headers

  • Cristin-Representing-Institution - Mandatory if payload has detailed_affiliations or person_nvi. Only create detailed_affiliations or person_nvi data at this Cristin institution. Takes a cristin institution id, or the string 'any' for any institution

Response

Returns a JSON object that conforms to the person JSON schema.

HTTP Status Codes

  • 201 - Created, returned upon successful insertion.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.

Response headers

  • Location - Link to the created resource

PATCH persons/{id}

Modify an existing person. (This request requires authentication.)

PATCH persons
Parameter Type Description
id String The Cristin id of the person

The request must have Content-Type: application/merge-patch+json and the payload must conform to the PATCH person JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

PATCH updates one or more fields of the resource following the JSON Merge Patch strategy: Fields that are included in the request are overwritten, while fields not included in the request remain unaltered.

Unrecognized fields or fields that are not part of the PATCH person JSON schema are currently silently ignored.

Examples

Request

Request headers

  • Cristin-Representing-Institution - Mandatory if updating detailed_affiliations or person_nvi. Only update detailed_affiliations or person_nvi data at this Cristin institution. Takes a cristin institution id, or the string 'any' for any institution

Response

HTTP Status Codes

  • 204 - No content, returned upon successful modification.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.
  • 403 - Forbidden, returned if this particular person cannot be modified.
  • 404 - Not found, returned if there is no person with this id.

GET persons/{pid}/affiliations

List of a given person's affiliations / employments. (This request requires authentication.)

GET persons/{pid}/affiliations
Parameter Type Description
pid String Cristin id of the person
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON array of objects containing and describing affiliations / employments, conforming to the affiliations JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of affiliations.
  • 400 - Bad request, returned if the person id is invalid

Response headers

  • X-Total-Count - total number of hits
  • Link - pagination previous and next page
This endpoint is not currently paginated, but clients should implement handling of these headers in case pagination is introduced later.

POST persons/{id}/affiliations

Create a new affiliation / employment for a person. (This request requires authentication.)

POST persons/{pid}/affiliations
Parameter Type Description
pid String Cristin id of the person
lang String Two letter language code. Using the 'lang' parameter

The request payload must conform to the POST person affiliation JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

Creates a new affiliation / employment for a person using the supplied fields and returns the result as a HTTP status code.

Unrecognized fields or fields that are not part of the POST affiliation JSON schema are currently silently ignored.

Examples

Request

Request headers

  • Cristin-Representing-Institution - Mandatory. Only allow creation of affiliation at this Cristin institution. Takes a number corresponding to top level institution identifier, or the string 'any' for any institution

Response

HTTP Status Codes

  • 201 - Created, returned upon successful insertion, along with a JSON representation of the newly created affiliation.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.

Response headers

  • Location - Link to the created resource

GET persons/{pid}/affiliations/{aid}

Retrieve a particular affiliation / employment of a person. (This request requires authentication.)

GET persons/{pid}/affiliations/{aid}
Parameter Type Description
pid String Cristin id of the person
aid String Cristin id of the affiliation
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object containing and describing a particular affiliation / employment, conforming to the GET affiliation JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of affiliations.
  • 400 - Bad request, returned if ids are invalid.
  • 404 - Not found, returned if no affiliation can be found for the given ids.

PATCH persons/{pid}/affiliations/{aid}

Modify an affiliation / employment of a given person. (This request requires authentication.)

PATCH persons/{pid}/affiliations/{aid}
Parameter Type Description
pid String Cristin id of the person
aid String Cristin id of the affiliation

The request must have Content-Type: application/merge-patch+json and the payload must conform to the PATCH person affiliation JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

PATCH updates one or more fields of the resource following the JSON Merge Patch strategy: Fields that are included in the request are overwritten, while fields not included in the request remain unaltered.

Unrecognized fields or fields that are not part of the JSON schema are currently silently ignored.

Examples

Request

Request headers

  • Cristin-Representing-Institution - Mandatory. Only allow update of affiliation at this Cristin institution. Takes a number corresponding to top level institution identifier, or the string 'any' for any institution

Response

HTTP Status Codes

  • 204 - No content, the information on that affiliation was updated
  • 400 - Bad request, returned if the ids are invalid or there were problems with the payload
  • 404 - Not found, returned if the person or affiliation ids do not exist

DELETE persons/{pid}/affiliations/{aid}

Delete person affiliation / employment specific to an institution. (This request requires authentication.)

DELETE one person affiliation / employment per institution
Parameter Type Description
pid String Cristin id of the person
aid String Cristin id of the affiliation

Request

Request headers

  • Cristin-Representing-Institution - Mandatory. Only allow deletion of affiliation at this Cristin institution. Takes a number corresponding to top level institution identifier, or the string 'any' for any institution

Response

HTTP Status Codes

  • 200 - Ok, returned upon successful deletion
  • 400 - Bad request, returned if the ids are invalid
  • 404 - Not found, returned if no match could be found for the given ids

GET persons/affiliations/positions

List of person affiliation / employment position codes which can be retrieved in optional requested language.

GET persons/affiliations/positions
Parameter Type Description
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON array of objects containing and describing position codes, conforming to the position codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of position codes.

Response headers

  • X-Total-Count - total number of hits
  • Link - pagination previous and next page
This endpoint is not currently paginated, but clients should implement handling of these headers in case pagination is introduced later.

GET persons/{pid}/institutions/{iid}

Retrieve person information specific to an institution. (This request requires authentication.)

GET person data per institution
Parameter Type Description
pid String Cristin id of the person
iid String Cristin id of the institution

Examples

Response

Returns a JSON object that conforms to the person-at-institution JSON schema.

HTTP Status Codes

  • 200 - Ok, returns information on that person at the given institution
  • 400 - Bad request, returned if the ids are invalid
  • 404 - Not found, returned if no data could be found for the given ids

PATCH persons/{pid}/institutions/{iid}

Modify person information specific to an institution. (This request requires authentication.)

PATCH person data per institution
Parameter Type Description
pid String Cristin id of the person
iid String Cristin id of the institution

The request must have Content-Type: application/merge-patch+json and the payload must conform to the PATCH person information JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

PATCH updates one or more fields of the resource following the JSON Merge Patch strategy: Fields that are included in the request are overwritten, while fields not included in the request remain unaltered.

Unrecognized fields or fields that are not part of the JSON schema are currently silently ignored.

Examples

Response

HTTP Status Codes

  • 204 - No content, the information on that person at the given institution was updated
  • 400 - Bad request, returned if the ids are invalid or there were problems with the payload
  • 404 - Not found, returned if the person or institution ids do not exist

GET persons/{id}/picture

Retrieve profile picture for a given person.

GET person picture
Parameter Type Description
id String Cristin id of the person

Response

Returns binary content of type image/jpeg

HTTP Status Codes

  • 200 - Ok, returns the profile picture
  • 400 - Bad request, returned if supplied id is invalid
  • 404 - Not found, returned if no person matches the supplied id, or the person has no profile picture

PUT persons/{id}/picture

Store profile picture for a given person. (This request requires authentication.)

The request must declare the header Content-Type: image/jpeg and the payload must contain corresponding binary data. Size restrictions may apply.

PUT person picture
Parameter Type Description
id String Cristin id of the person

Response

HTTP Status Codes

  • 204 - No content, stores the profile picture
  • 400 - Bad request, returned if supplied id is invalid
  • 404 - Not found, returned if no person matches the supplied id
  • 415 - Unsupported media type, returned if the content type is not accepted

GET persons/{id}/users

Retrieve all registered user accounts for a specific person. (This request requires authentication.)

GET person user account data per institution
Parameter Type Description
id String Cristin id of the person

Examples

Response

Returns a JSON object that conforms to the Person user account list JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of that person's user accounts.
  • 400 - Bad request, returned if supplied id is invalid
  • 404 - Not found, returned if no user matches the supplied id

POST persons/{id}/users

Create a new user account for a person. (This request requires authentication.)

The request payload must conform to the POST person user account JSON schema. Use the schema validator. Additional constraints on the JSON fields apply. Note that the API will convert usernames to lowercase.

Creates a new user account for a person using the supplied fields and returns the newly created user account as it will be shown in subsequent GET requests.

Unrecognized fields or fields that are not part of the POST user account JSON schema are currently silently ignored.

Examples

Response

Returns a JSON object that conforms to the person user account JSON schema.

HTTP Status Codes

  • 201 - Created, returned upon successful insertion.
  • 404 - Not found, returned if no user matches id.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.

Response headers

  • Location - Link to the created resource

PATCH persons/{pid}/users/{accountid}

Modify person user account specific to an institution. (This request requires authentication.)

PATCH person user account per institution
Parameter Type Description
pid String Cristin id of the person
accountid String A person’s account id, composed of the username and institution id separated by ':', e.g. askeladd:185

The request must have Content-Type: application/merge-patch+json and the payload must conform to the PATCH person user account JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

PATCH updates one or more fields of the resource following the JSON Merge Patch strategy: Fields that are included in the request are overwritten, while fields not included in the request remain unaltered.

Unrecognized fields or fields that are not part of the JSON schema are currently silently ignored.

Examples

Response

HTTP Status Codes

  • 204 - No content, the information on that person at the given institution was updated
  • 400 - Bad request, returned if the ids are invalid or there were problems with the payload
  • 404 - Not found, returned if the person or institution ids do not exist or does not have an account

GET persons/{id}/results

Retrieve results by person id.

GET person results
Parameter Type Description
id String Cristin id of the person
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination

Examples

Response

Returns a list of JSON objects that conforms to the results JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of results for that person.
  • 400 - Bad request, returned if the id is invalid
  • 404 - Not found, returned if the person id could not be found

GET projects?{parameters}

Search for projects by a combination of filter parameters.

GET projects
Parameter Type Description
id String Cristin id of the project
title String Title of the project, or part of the title
institution String Cristin id, acronym, name, or part of the name of the coordinating institution
user String A person's username in Cristin together with the institution id separated by ':'
'askeladd:185' means Cristin user 'askeladd' from the institution '185'
biobank String Biobank id. 'biobank' can be used more than once. See Duplicate parameters
project_manager String Cristin id, name or part of the name of the project manager.
participant String Cristin id, name or part of the name of a participant of the project.
'participant' can be used more than once. See Duplicate parameters
approval_reference_id String Reference id of a project approval.
approved_by String Code for the authority that evaluated a project approval.
creator String Cristin person id of the person who registered the project
modified_since String Only projects that have been modified since this date will be returned. Format: YYYY-MM-DD
keyword String Keyword search. '?keyword=wind energy' makes a search for projects with keywords equal to or a substring of
'wind energy'. 'keyword' can be used more than once. See Duplicate parameters
unit String Id (e.g. unit=185.53.18.10)
parent_unit_id String Id (e.g. unit=185.53.18.10) of a parent unit. Returns all projects under the given unit as well as its child units. The paramter 'levels' can be used to narrow the scope.
levels String How many levels down from 'parent_unit_id' will be included in the search.'levels=1' will return projects registered to 'parent_unit_id'.
'levels' can also be used by itself to search for all projects registered to a known cristin unit down to the given level.
'levels' is a number between 1 and 32.
status String Status of the projects. One of three values: [active, concluded, not started]. Projects without an end date are assumed to be active if start date has passed.
project_code String Project code is the internal reference number used by funding source
funding_source String Funding source code e.g: NFR
funding String Funding source code e.g: NFR, and project_code together separated by ':'
'NFR:1234' means 'funding_source': 'NFR' with 'project_code': '1234'
multiple String Matches multiple fields using only this one param, those being 'id', 'title', 'project_manager', 'participant' and 'project_code'
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination
sort String Sorts on 'start_date' and/or 'end_date'. See Search and sort
Default sort order is on 'cristin_project_id' in ascending order.

Examples

Response

Returns a JSON object that conforms to the projects summary JSON schema. The response will be paginated.

HTTP Status Codes

  • 200 - Ok, returns a list of project summaries.
  • 400 - Bad request, returned if the filter parameters are invalid.

GET projects/{id}

Retrieve a project by its id. Projects that are not published can be retrieved by authenticating as the project's creator.

GET projects
Parameter Type Description
id String The Cristin id of the project
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that conforms to the project JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the project.
  • 307 - Redirect, returned if the project was merged or moved into another project.
  • 400 - Bad request, returned if the id is invalid
  • 401 - Unauthorized, returned if the project is not published and the request didn't include authentication.
  • 403 - Forbidden, returned if the project is not published and the supplied authentication is incorrect for the project.
  • 404 - Returned if there is no content with the given id

GET projects/categories

Show list of all project categories.

Parameter Type Description
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that contains an array with all project categories to the database codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of project categories.

POST projects

Create a new project. (This request requires authentication.)

The request must have Content-Type: application/json and the payload must conform to the POST project JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

Examples

Response

HTTP Status Codes

  • 201 - Created, returns a JSON representation of the newly created project, along with a HTTP header Location containing the URL of the project.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.

PATCH projects/{id}

Modify an existing project. (This request requires authentication.)

PATCH projects
Parameter Type Description
id String The Cristin id of the project

The request must have Content-Type: application/merge-patch+json and the payload must conform to the PATCH project JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

PATCH updates one or more fields of the resource following the JSON Merge Patch strategy: Fields that are included in the request are overwritten, while fields not included in the request remain unaltered.

Unrecognized fields or fields that are not part of the PATCH project JSON schema are currently silently ignored.

Examples

Response

HTTP Status Codes

  • 204 - No content, returned upon successful modification.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.
  • 403 - Forbidden, returned if this particular project cannot be modified.
  • 404 - Not found, returned if there is no project with this id.

GET projects/{id}/biobanks

Retrieve a project's related biobanks

GET project
Parameter Type Description
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination

Examples

Response

Returns a list of JSON objects. The list conforms to the biobanks summary JSON schema . The response will be paginated.

HTTP Status Codes

  • 200 - OK, returns the project's related biobanks
  • 400 - Bad request, returned if the filter parameters are invalid

Response headers

  • X-Total-Count - total number of hits
  • Link - pagination previous and next page

GET projects/{id}/datasets

Retrieve a projects datasets

GET projects
Parameter Type Description
id String The Cristin id of the project

Examples

Response

Returns a list of JSON objects. The list conforms to the GET project datasets response JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the project's datasets.
  • 403 - Forbidden, the project is not published.
  • 404 - Not found, returned if there is no project with this id.

POST projects/{id}/datasets

Create a new project dataset. (This request requires authentication.)

POST projects
Parameter Type Description
id String The Cristin id of the project

The request must have Content-Type: application/json and the payload must conform to the POST project datasets request JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

Examples

Response

Returns a JSON object that conforms to the POST project datasets response JSON schema.

HTTP Status Codes

  • 200 - OK, returns a JSON representation of the (single) newly created project dataset, along with a HTTP header Location containing the URL of all the project's datasets.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings. e.g. if the supplied dataset already exists in the project.
  • 403 - Forbidden, returned if the project cannot be accessed.
  • 404 - Not found, returned if there is no project with this id.

PUT projects/{id}/datasets

Update the whole collection of datasets of a project by removing all previously attached datasets and replacing them with a new collection. (This request requires authentication.)

PUT project
Parameter Type Description
id String The Cristin id of the project

The request must have Content-Type: application/json and the payload must conform to the PUT project datasets request JSON schema. Use the schema validator. Additional constraints on the JSON fields apply.

Examples

Response

Returns a list of JSON objects. The list conforms to the PUT project datasets response JSON schema.

HTTP Status Codes

  • 200 - OK, returns a JSON representation of the updated / replaced collection of the project's datasets, along with a HTTP header Location containing the URL of this collection.
  • 400 - Bad request, returned if the supplied JSON content is invalid. The response will contain relevant error messages and warnings.
  • 403 - Forbidden, returned if the project cannot be accessed.
  • 404 - Not found, returned if there is no project with this id.

GET /projects/participants/roles

Show list of all valid project participant roles.

GET /projects/participants/roles
Parameter Type Description
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that contains an array with all valid project participant roles and conforms to the database codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of project participant roles.

GET results?{parameters}

Search for results (publications) by combining queries with filters. See Search and sort

Parameter Type Description
id String The Cristin id of the result
doi String DOI name (e.g. doi=10.1000/123456)
title String The title of the result
contributor String Author's name or Cristin person id
issn String The issn of the result
unit String Id (e.g. unit=185.53.18.10)
institution String Id (one number, e.g. institution=185), name or acronym of the institution the contributors belong to
user String A person's username in Cristin together with the institution id separated by ':'
'askeladd:185' means Cristin user 'askeladd' from the institution '185'
category String Result category code, category codes
published_since String Results published since and inclusive the given year, (yyyy), e.g: 2005
published_before String Results published before and inclusive the given year, (yyyy), e.g: 2017
created_since String Results created since and inclusive the given date, (yyyy-mm-dd), e.g: 2005-03-17
created_before String Results created before and inclusive the given date, (yyyy-mm-dd), e.g: 2005-03-17
modified_since String Results modified since and inclusive the given date, (yyyy-mm-dd), e.g: 2005-03-17
modified_before String Results modified before and inclusive the given date, (yyyy-mm-dd), e.g: 2005-03-17
year_reported String The year a result was reported
project_code String Project code is the internal reference number used by funding source
funding_source String Funding source code e.g: NFR
funding String Funding source code e.g: NFR, and project_code together separated by ':'
'NFR:1234' means 'funding_source': 'NFR' with 'project_code': '1234'
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination
sort String Sorts on 'category' and/or 'year_published'. See Search and sort
Default sort order is on 'cristin_result_id' in ascending order.
fields String 'fields=all' gives a list of result objects with all available fields.
If this parameter is omitted, a list of result summaries with fewer fields will be returned.

Examples

The list of results given by the response, has been trunctated in most of these examples.

Response

Returns a JSON object that conforms to the results JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the results
  • 400 - Bad request, returned if the filter parameters are invalid

Response headers

  • X-Total-Count - total number of hits
  • Link - pagination previous and next page

GET results/{id}

Retrieves a result (publication) by its id.

GET results
Parameter Type Description
id String The Cristin id of the result.
lang String Two letter language code. Using the 'lang' parameter

Examples

  •  (Article)
  •  (Book)
  •  (Chapter)
  •  (Media contribution)

Response

Returns a JSON object that conforms to the results JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the result
  • 307 - Redirect, returned if the result was merged or moved into another result.
  • 400 - Bad request, returned if the id is invalid
  • 404 - Not found, returned if no result with this id could be found

GET results/{id}/chapters

Retrieves chapters of the result by result id.

GET chapters
Parameter Type Description
id String The Cristin id of the result.
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that conforms to the chapters JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the result
  • 307 - Redirect, returned if the result was merged or moved into another result.
  • 400 - Bad request, returned if the id is invalid
  • 404 - Not found, returned if there is no result with the given id

GET results/{id}/contributors

Retrieves contributors of the result by result id.

GET contributors
Parameter Type Description
id String The Cristin id of the result.
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination

Examples

Response

Returns a JSON object that conforms to the contributors JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the result
  • 307 - Redirect, returned if the result was merged or moved into another result.
  • 400 - Bad request, returned if the id is invalid
  • 404 - Not found, returned if there is no result with the given id

GET results/categories

Show list of all valid result category codes.

GET results/categories
Parameter Type Description
lang String Two letter language code. Using the 'lang' parameter

Examples

Response

Returns a JSON object that contains an array with all valid result categories and conforms to the database codes JSON schema.

HTTP Status Codes

  • 200 - Ok, returns a list of result categories with descriptions.

GET units?{parameters}

Search for units (organizational units) by a combination of filter parameters.

GET units
Parameter Type Desciption
id String The Cristin id of the unit (four numbers separated by dots)
name String Name or acronym of the unit
institution String Id (one number, e.g. institution=185), name or acronym of the institution
parent_unit_id String Returns all the subunits that belong to this unit
levels String How many levels down from parent_unit_id will be included in the search. 'levels=1' will return 'parent_unit_id's direct children.
Can also be used by itself to search for all units known to Cristin down to the given level.
'levels' is a number between 1 and 32.
country String Two letter country code (ISO 3166-1 alpha-2)
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination

Examples

  • (No hits, returns an empty list)

Response

Returns a JSON object that conforms to the unit summary JSON schema. The response will be paginated.

HTTP Status Codes

  • 200 - Ok, returns the units.
  • 400 - Bad request, returned if the filter parameters are invalid
  • 404 - Not found, returned if the unit id could not be found

GET units/{id}

Retrieve a unit (organizational unit) by its id.

GET units
Parameter Type Desciption
id String The Cristin id of the unit (four numbers separated by dots).
lang String Two letter language code. Using the 'lang' parameter

Examples

  • (This unit does not have subunits)
  • (This is the top unit, the institution itself, with its direct subunits)

Response

Returns a JSON object that conforms to the unit JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the unit.
  • 400 - Bad request, returned if the id is invalid
  • 403 - Forbidden, returned if this particular unit cannot be accessed.
  • 404 - Not found, returned if there is no content with the given id

GET units/{id}/results

Retrieve results for a unit (organizational unit) by its id.

GET unit results
Parameter Type Desciption
id String The Cristin id of the unit (four numbers separated by dots).
lang String Two letter language code. Using the 'lang' parameter
page String Page number. See Pagination
per_page String Number of items per page. See Pagination

Examples

Response

Returns a JSON object that conforms to the results JSON schema.

HTTP Status Codes

  • 200 - Ok, returns the results for the unit.
  • 400 - Bad request, returned if the id is invalid
  • 404 - Not found, returned if no unit with this id could be found