### Start DataCite API Application Source: https://github.com/datacite/lupo/blob/master/README.md Build and start the application and its dependencies using Docker Compose. Ensure Docker and Docker Compose are installed. ```bash docker-compose -f docker-compose.yml -f docker-compose.local.yml up --build ``` -------------------------------- ### Get Specific Client Source: https://context7.com/datacite/lupo/llms.txt Fetch details for a single client using its provider and client identifiers. ```bash curl "https://api.datacite.org/clients/cern.zenodo" ``` -------------------------------- ### Get Specific Prefix Source: https://context7.com/datacite/lupo/llms.txt Retrieve details for a single prefix using its identifier. ```bash curl "https://api.datacite.org/prefixes/10.5281" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get Specific Provider Source: https://context7.com/datacite/lupo/llms.txt Fetch details for a single provider using its identifier. ```bash curl "https://api.datacite.org/providers/cern" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Setup DataCite API Database Source: https://github.com/datacite/lupo/blob/master/README.md Set up the database, including creating tables, loading the schema, and seeding data. This command should be run after the Docker containers are running. ```bash docker-compose exec web bundle exec rake db:setup RAILS_ENV=development ``` -------------------------------- ### Get DOI Totals Grouped by Client Source: https://context7.com/datacite/lupo/llms.txt This GET request returns the total number of DOIs, grouped by client for a specified provider. ```bash curl "https://api.datacite.org/clients/totals?provider-id=cern" ``` -------------------------------- ### Get Prefix Totals for Client Source: https://context7.com/datacite/lupo/llms.txt Retrieve the total number of prefixes associated with a given client ID. ```bash curl "https://api.datacite.org/prefixes/totals?client-id=cern.zenodo" ``` -------------------------------- ### Get DOI Totals Grouped by Provider Source: https://context7.com/datacite/lupo/llms.txt This GET request returns the total number of DOIs, grouped by provider. ```bash curl "https://api.datacite.org/providers/totals" ``` -------------------------------- ### Get activities for a specific client Source: https://context7.com/datacite/lupo/llms.txt Retrieves a list of activities associated with a particular client. ```APIDOC ## GET /clients/{id}/activities ### Description Retrieves activities specific to a given client. ### Method GET ### Endpoint /clients/{id}/activities #### Path Parameters - **id** (string) - Required - The identifier of the client. ### Request Example ```bash curl "https://api.datacite.org/clients/cern.zenodo/activities" \ -H "Authorization: Bearer $TOKEN" ``` ### Response (Response structure includes a list of activity records for the specified client.) ``` -------------------------------- ### Get Specific Contact Source: https://context7.com/datacite/lupo/llms.txt Fetch details for a single contact using its unique identifier. ```bash curl "https://api.datacite.org/contacts/cern-tech-contact" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get activities for a specific provider Source: https://context7.com/datacite/lupo/llms.txt Retrieves a list of activities associated with a particular provider. ```APIDOC ## GET /providers/{id}/activities ### Description Retrieves activities specific to a given provider. ### Method GET ### Endpoint /providers/{id}/activities #### Path Parameters - **id** (string) - Required - The identifier of the provider. ### Request Example ```bash curl "https://api.datacite.org/providers/cern/activities" \ -H "Authorization: Bearer $TOKEN" ``` ### Response (Response structure includes a list of activity records for the specified provider.) ``` -------------------------------- ### Get Activities for a Provider Source: https://context7.com/datacite/lupo/llms.txt Fetches the audit log of activities specifically related to a given provider. Requires a bearer token for authentication. ```bash curl "https://api.datacite.org/providers/cern/activities" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get Activities for a Client Source: https://context7.com/datacite/lupo/llms.txt Retrieves the audit log of activities associated with a specific client. Requires a bearer token for authentication. ```bash curl "https://api.datacite.org/clients/cern.zenodo/activities" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get a specific client Source: https://context7.com/datacite/lupo/llms.txt Retrieves detailed information about a specific client using its unique identifier. ```APIDOC ## GET /clients/:id ### Description Retrieves details for a specific client. ### Method GET ### Endpoint /clients/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the client (e.g., "cern.zenodo"). ``` -------------------------------- ### Get Client Statistics Source: https://context7.com/datacite/lupo/llms.txt Retrieve statistics for a specific client, such as DOI counts and resource type breakdowns. Requires authentication. ```bash curl "https://api.datacite.org/clients/cern.zenodo/stats" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get Provider Statistics Source: https://context7.com/datacite/lupo/llms.txt Retrieve statistics for a specific provider, such as DOI counts aggregated by year. ```bash curl "https://api.datacite.org/providers/cern/stats" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Generate Random DOI Suffixes Source: https://context7.com/datacite/lupo/llms.txt This GET request generates a specified number of random DOI suffixes for a given prefix. ```bash curl "https://api.datacite.org/dois/random?prefix=10.5438&number=5" ``` -------------------------------- ### Get Next Page of Enrichments Source: https://context7.com/datacite/lupo/llms.txt Fetches the next page of enrichment results using a cursor token obtained from a previous request. Requires a bearer token. ```bash curl "https://api.datacite.org/enrichments?doi=10.5281/zenodo.1234567&page[cursor]=" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Retrieve Handle-Resolved URL for a DOI Source: https://context7.com/datacite/lupo/llms.txt Get the URL that a DOI resolves to, typically used for redirecting to the resource. ```APIDOC ## GET /dois/{id}/get-url ### Description Retrieves the Handle-resolved URL for a given DOI. ### Method GET ### Endpoint `/dois/{id}/get-url` ### Authentication Requires Bearer Token. ### Request Example ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567/get-url" -H "Authorization: Bearer $TOKEN" ``` ### Response Example ```json { "url": "https://zenodo.org/record/1234567" } ``` ``` -------------------------------- ### Get Monthly Data File S3 Credentials Source: https://context7.com/datacite/lupo/llms.txt Retrieves S3 credentials necessary for accessing monthly data files. Requires an authorization token. ```bash curl "https://api.datacite.org/credentials/datafile" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get next page of enrichments using cursor Source: https://context7.com/datacite/lupo/llms.txt Fetches the next page of enrichment results by providing a cursor obtained from a previous request. ```APIDOC ## GET /enrichments (with cursor) ### Description Retrieves the next page of enrichments using a cursor for pagination. ### Method GET ### Endpoint /enrichments #### Query Parameters - **doi** (string) - Required - The DOI to filter enrichments by. - **page[cursor]** (string) - Required - The cursor token for the next page. ### Request Example ```bash curl "https://api.datacite.org/enrichments?doi=10.5281/zenodo.1234567&page[cursor]=" \ -H "Authorization: Bearer $TOKEN" ``` ### Response (See Response section for 'List enrichments for a client') ``` -------------------------------- ### Get activities for a specific DOI Source: https://context7.com/datacite/lupo/llms.txt Retrieves a list of activities associated with a specific Digital Object Identifier (DOI). ```APIDOC ## GET /dois/{doi}/activities ### Description Retrieves activities related to a specific DOI. ### Method GET ### Endpoint /dois/{doi}/activities #### Path Parameters - **doi** (string) - Required - The Digital Object Identifier. ### Request Example ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567/activities" \ -H "Authorization: Bearer $TOKEN" ``` ### Response (Response structure includes a list of activity records for the specified DOI.) ``` -------------------------------- ### Get Single Activity Record Source: https://context7.com/datacite/lupo/llms.txt Retrieves a specific activity record using its unique identifier (UUID). Requires a bearer token for authentication. ```bash curl "https://api.datacite.org/activities/activity-uuid-123" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get Activities for a DOI Source: https://context7.com/datacite/lupo/llms.txt Fetches the audit log of activities related to a specific Digital Object Identifier (DOI). Requires a bearer token for authentication. ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567/activities" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Lint DataCite API Code Source: https://github.com/datacite/lupo/blob/master/README.md Run code linting using RuboCop to maintain code style and quality. This command checks for style guide violations. ```bash docker-compose exec web bundle exec rubocop ``` -------------------------------- ### Create a Client Source: https://context7.com/datacite/lupo/llms.txt Use this POST request to create a new client associated with a provider. Requires authentication. ```bash curl -X POST "https://api.datacite.org/clients" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{ "data": { "type": "clients", "attributes": { "symbol": "NEWUNI.REPO", "name": "New University Repository", "systemEmail": "repo@newuni.edu", "clientType": "repository", "domains": "newuni.edu", "url": "https://repo.newuni.edu" }, "relationships": { "provider": {"data": {"type": "providers", "id": "newuni"}} } } }' ``` -------------------------------- ### Retrieve DOI with Included Client and Media Source: https://context7.com/datacite/lupo/llms.txt Use the `include` query parameter to fetch related client and media information along with the DOI. ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567?include=client,media" ``` -------------------------------- ### Create a client Source: https://context7.com/datacite/lupo/llms.txt Creates a new client (repository or data center) under a specified provider. Requires provider association. ```APIDOC ## POST /clients ### Description Creates a new client. ### Method POST ### Endpoint /clients ### Request Body - **data** (object) - Required - The payload for the new client. - **type** (string) - Required - Must be "clients". - **attributes** (object) - Required - Contains the details of the client. - **symbol** (string) - Required - The unique symbol for the client. - **name** (string) - Required - The name of the client. - **systemEmail** (string) - Required - The system email address for the client. - **clientType** (string) - Required - The type of client (e.g., "repository"). - **domains** (string) - Optional - Associated domains. - **url** (string) - Optional - The client's URL. - **relationships** (object) - Required - Defines the associated provider. - **provider** (object) - Required - Specifies the provider. - **data** (object) - Required - Provider data. - **type** (string) - Required - Must be "providers". - **id** (string) - Required - The identifier of the provider. ``` -------------------------------- ### Create a Provider Source: https://context7.com/datacite/lupo/llms.txt Use this POST request to create a new provider. This operation requires administrator privileges. ```bash curl -X POST "https://api.datacite.org/providers" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{ "data": { "type": "providers", "attributes": { "symbol": "NEWUNI", "name": "New University", "displayName": "New University", "systemEmail": "admin@newuni.edu", "memberType": "direct_member", "country": "US", "organizationType": "academicInstitution", "nonProfitStatus": "non-profit" } } }' ``` -------------------------------- ### List Prefixes with Filters Source: https://context7.com/datacite/lupo/llms.txt Use this endpoint to list prefixes with optional filters for provider and client IDs. Pagination is supported. ```bash curl "https://api.datacite.org/prefixes?provider-id=cern&client-id=cern.zenodo&page[size]=10" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### List Clients with Filters Source: https://context7.com/datacite/lupo/llms.txt Retrieve a list of clients, filtering by provider ID and client type. Pagination is supported. ```bash curl "https://api.datacite.org/clients?provider-id=cern&client-type=repository&page[size]=10" ``` -------------------------------- ### Get a single enrichment by UUID Source: https://context7.com/datacite/lupo/llms.txt Retrieves a specific enrichment record using its unique UUID. ```APIDOC ## GET /enrichments/{id} ### Description Retrieves a single enrichment record by its unique identifier (UUID). ### Method GET ### Endpoint /enrichments/{id} #### Path Parameters - **id** (string) - Required - The UUID of the enrichment to retrieve. ### Request Example ```bash curl "https://api.datacite.org/enrichments/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer $TOKEN" ``` ### Response #### Success Response (200) - **data** (object) - The enrichment object. - **id** (string) - The unique identifier of the enrichment. - **type** (string) - The type of the resource, typically "enrichments". - **attributes** (object) - Contains the enrichment details. - **doi** (string) - The Digital Object Identifier associated with the enrichment. - **field** (string) - The field that was enriched. - **value** (array) - The enriched value. - **source** (string) - The source of the enrichment. - **createdAt** (string) - The timestamp when the enrichment was created. ### Response Example ```json { "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "type": "enrichments", "attributes": { "doi": "10.5281/ZENODO.1234567", "field": "subjects", "value": [...], "source": "nlp-tagger", "createdAt": "2024-06-01T12:00:00Z" } } } ``` ``` -------------------------------- ### Create Prefix Source: https://context7.com/datacite/lupo/llms.txt Create a new prefix. Requires a unique prefix ID. ```bash curl -X POST "https://api.datacite.org/prefixes" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{"data": {"type": "prefixes", "id": "10.99999"}}' ``` -------------------------------- ### List Providers with Filters Source: https://context7.com/datacite/lupo/llms.txt Retrieve a list of providers, applying filters for query, region, and member type. Pagination is supported. ```bash curl "https://api.datacite.org/providers?query=university®ion=EMEA&member-type=direct_member&page[size]=5" ``` -------------------------------- ### Get a specific provider Source: https://context7.com/datacite/lupo/llms.txt Retrieves detailed information about a specific provider using its unique identifier. ```APIDOC ## GET /providers/:id ### Description Retrieves details for a specific provider. ### Method GET ### Endpoint /providers/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the provider (e.g., "cern"). ``` -------------------------------- ### Export Providers as CSV Source: https://context7.com/datacite/lupo/llms.txt Download a CSV file containing all provider information. Requires authentication. ```bash curl "https://api.datacite.org/providers/text/csv" \ -H "Authorization: Bearer $TOKEN" > providers.csv ``` -------------------------------- ### List Enrichments (Cursor Pagination) Source: https://context7.com/datacite/lupo/llms.txt Retrieves a list of enrichments for a client using cursor-based pagination. Requires a bearer token for authentication. ```bash curl "https://api.datacite.org/enrichments?client-id=cern.zenodo" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get a single activity record Source: https://context7.com/datacite/lupo/llms.txt Retrieves a specific activity record using its unique activity UUID. ```APIDOC ## GET /activities/{id} ### Description Retrieves a single activity record by its unique identifier. ### Method GET ### Endpoint /activities/{id} #### Path Parameters - **id** (string) - Required - The UUID of the activity record. ### Request Example ```bash curl "https://api.datacite.org/activities/activity-uuid-123" \ -H "Authorization: Bearer $TOKEN" ``` ### Response (Response structure includes the details of the specified activity record.) ``` -------------------------------- ### Create Contact Source: https://context7.com/datacite/lupo/llms.txt Create a new contact for a provider. Requires specifying attributes like name, email, and roleName. ```bash curl -X POST "https://api.datacite.org/contacts" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{ "data": { "type": "contacts", "attributes": { "givenName": "Alice", "familyName": "Smith", "email": "alice@newuni.edu", "roleName": ["technical", "billing"] }, "relationships": { "provider": {"data": {"type": "providers", "id": "newuni"}} } } }' ``` -------------------------------- ### Create a Findable DOI with JSON Attributes Source: https://context7.com/datacite/lupo/llms.txt Register a new DOI using a JSON API request body with detailed attributes. Requires client credentials and authentication. ```bash curl -X POST "https://api.datacite.org/dois" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{ "data": { "type": "dois", "attributes": { "doi": "10.5438/test-doi-001", "url": "https://example.org/dataset/001", "titles": [{"title": "My Research Dataset"}], "creators": [{ "nameType": "Personal", "name": "Doe, Jane", "givenName": "Jane", "familyName": "Doe", "nameIdentifiers": [{"nameIdentifier": "https://orcid.org/0000-0001-2345-6789", "nameIdentifierScheme": "ORCID"}], "affiliation": [{"name": "Example University"}] }], "publisher": {"name": "Example Repository"}, "publicationYear": 2024, "types": {"resourceTypeGeneral": "Dataset"}, "descriptions": [{"description": "A sample research dataset.", "descriptionType": "Abstract"}], "subjects": [{"subject": "Environmental Science"}], "rightsList": [{"rights": "Creative Commons Attribution 4.0", "rightsUri": "https://creativecommons.org/licenses/by/4.0/"}], "event": "publish" }, "relationships": { "client": {"data": {"type": "clients", "id": "datacite.test"}} } } }' ``` -------------------------------- ### Get DOI totals grouped by provider Source: https://context7.com/datacite/lupo/llms.txt Retrieves the total number of DOIs registered, grouped by provider. ```APIDOC ## GET /providers/totals ### Description Returns the total number of DOIs registered, grouped by provider. ### Method GET ### Endpoint /providers/totals ``` -------------------------------- ### Export Repositories as CSV Source: https://context7.com/datacite/lupo/llms.txt Initiates a bulk export of all repository data in CSV format. Requires administrative privileges and a bearer token. ```bash curl "https://api.datacite.org/export/repositories" \ -H "Authorization: Bearer $TOKEN" > repositories.csv ``` -------------------------------- ### Assign Prefix to Client Source: https://context7.com/datacite/lupo/llms.txt Assign an existing prefix to a specific client. ```bash curl -X POST "https://api.datacite.org/client-prefixes" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{"data": {"type": "client-prefixes", "relationships": {"client": {"data": {"type": "clients", "id": "newuni.repo"}}, "prefix": {"data": {"type": "prefixes", "id": "10.99999"}}}}}}' ``` -------------------------------- ### Get provider statistics Source: https://context7.com/datacite/lupo/llms.txt Retrieves statistics for a specific provider, including DOI counts grouped by year. ```APIDOC ## GET /providers/:id/stats ### Description Retrieves statistics for a specific provider, such as DOI counts over time. ### Method GET ### Endpoint /providers/:id/stats ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the provider. ``` -------------------------------- ### List clients with filters Source: https://context7.com/datacite/lupo/llms.txt Retrieves a list of clients (repositories) with options to filter by provider ID and client type. Supports pagination. ```APIDOC ## GET /clients ### Description Lists clients with filtering and pagination capabilities. ### Method GET ### Endpoint /clients ### Query Parameters - **provider-id** (string) - Optional - Filters clients by their associated provider ID. - **client-type** (string) - Optional - Filters clients by their type (e.g., "repository"). - **page[size]** (integer) - Optional - The number of clients to return per page. Defaults to a system-defined value. - **page[number]** (integer) - Optional - The page number to retrieve. ``` -------------------------------- ### Retrieve DOI using Path-based Content Negotiation Source: https://context7.com/datacite/lupo/llms.txt An alternative method to content negotiation where the desired format is specified directly in the URL path. ```bash curl "https://api.datacite.org/dois/application/vnd.datacite.datacite+xml/10.5281/zenodo.1234567" ``` -------------------------------- ### Get client statistics Source: https://context7.com/datacite/lupo/llms.txt Retrieves statistics for a specific client, including DOI counts and resource type breakdowns. ```APIDOC ## GET /clients/:id/stats ### Description Retrieves statistics for a specific client. ### Method GET ### Endpoint /clients/:id/stats ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the client. ``` -------------------------------- ### Create Event Source: https://context7.com/datacite/lupo/llms.txt Create a new event record, which requires authentication and specific payload details including source, subject, object, and relation type. ```bash curl -X POST "https://api.datacite.org/events" \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/vnd.api+json; version=2" \ -H "Content-Type: application/vnd.api+json" \ -d '{ "data": { "type": "events", "attributes": { "messageAction": "create", "sourceToken": "crossref-agent", "subjId": "https://doi.org/10.1234/citing-paper", "objId": "https://doi.org/10.5281/zenodo.1234567", "relationTypeId": "references", "sourceId": "crossref", "occurredAt": "2024-01-15T10:00:00Z", "total": 1, "subj": {"id": "https://doi.org/10.1234/citing-paper", "type": "ScholarlyArticle"}, "obj": {"id": "https://doi.org/10.5281/zenodo.1234567", "type": "Dataset"} } } }' ``` -------------------------------- ### Retrieve DOI in BibTeX Format Source: https://context7.com/datacite/lupo/llms.txt Set the `Accept` header to `application/x-bibtex` to retrieve the DOI metadata in BibTeX format. ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567" \ -H "Accept: application/x-bibtex" ``` -------------------------------- ### List All Activities (Paginated) Source: https://context7.com/datacite/lupo/llms.txt Retrieves a paginated list of all activities, which serve as an audit log for changes. Requires a bearer token for authentication. ```bash curl "https://api.datacite.org/activities?page[size]=10" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Get DOI totals grouped by client for a provider Source: https://context7.com/datacite/lupo/llms.txt Retrieves the total number of DOIs registered, grouped by client for a specific provider. ```APIDOC ## GET /clients/totals ### Description Returns the total number of DOIs registered, grouped by client for a given provider. ### Method GET ### Endpoint /clients/totals ### Query Parameters - **provider-id** (string) - Required - The identifier of the provider for which to get client totals. ``` -------------------------------- ### List Events (v2 API) Source: https://context7.com/datacite/lupo/llms.txt List events using the v2 API, with options to filter by DOI and source ID. Requires specifying the version in the Accept header. ```bash curl "https://api.datacite.org/events?doi=10.5281/zenodo.1234567&source-id=crossref&page[size]=10" \ -H "Accept: application/vnd.api+json; version=2" ``` -------------------------------- ### GraphQL: Query Work with Citations and References Source: https://context7.com/datacite/lupo/llms.txt Retrieves details for a specific work, including its citations and references, formatted using a specified style (e.g., APA). Requires a bearer token and JSON content type. ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ \ "query": "query { work(id: \"https://doi.org/10.5281/zenodo.1234567\") { id doi titles { title } publicationYear creators { name nameIdentifiers { nameIdentifier } } citationCount citations(first: 3) { totalCount nodes { id doi titles { title } } } references(first: 3) { totalCount nodes { id doi titles { title } } } formattedCitation(style: \"apa\") } }"' ``` -------------------------------- ### Get Single Enrichment by UUID Source: https://context7.com/datacite/lupo/llms.txt Retrieves a specific enrichment record using its unique identifier (UUID). Requires a bearer token for authentication. ```bash curl "https://api.datacite.org/enrichments/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Retrieve DOI in RIS Format Source: https://context7.com/datacite/lupo/llms.txt Set the `Accept` header to `application/x-research-info-systems` to retrieve the DOI metadata in RIS format. ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567" \ -H "Accept: application/x-research-info-systems" ``` -------------------------------- ### Get monthly data file S3 credentials Source: https://context7.com/datacite/lupo/llms.txt This endpoint retrieves S3 credentials for accessing monthly data files. It requires an authorization token. ```APIDOC ## GET /credentials/datafile ### Description Retrieves S3 credentials for accessing monthly data files. ### Method GET ### Endpoint /credentials/datafile ### Request Headers - Authorization: Bearer $TOKEN ``` -------------------------------- ### Scroll Through All Events Source: https://context7.com/datacite/lupo/llms.txt Efficiently retrieve all events in bulk using a scroll cursor for pagination. Specify page size for performance. ```bash curl "https://api.datacite.org/events?page[scroll]=1m&page[size]=1000" \ -H "Accept: application/vnd.api+json; version=2" ``` -------------------------------- ### Retrieve DOI in CodeMeta JSON-LD Format Source: https://context7.com/datacite/lupo/llms.txt Set the `Accept` header to `application/vnd.codemeta.ld+json` to retrieve the DOI metadata in CodeMeta JSON-LD format. ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567" \ -H "Accept: application/vnd.codemeta.ld+json" ``` -------------------------------- ### Export Organizations as CSV Source: https://context7.com/datacite/lupo/llms.txt Initiates a bulk export of all organization data in CSV format. Requires administrative privileges and a bearer token. ```bash curl "https://api.datacite.org/export/organizations" \ -H "Authorization: Bearer $TOKEN" > organizations.csv ``` -------------------------------- ### List all activities Source: https://context7.com/datacite/lupo/llms.txt Retrieves a paginated list of all activities, which serve as an audit log for changes to providers, clients, and DOIs. ```APIDOC ## GET /activities ### Description Lists all activities, providing an audit trail of changes. This endpoint supports pagination. ### Method GET ### Endpoint /activities #### Query Parameters - **page[size]** (integer) - Optional - The number of activities to return per page. ### Request Example ```bash curl "https://api.datacite.org/activities?page[size]=10" \ -H "Authorization: Bearer $TOKEN" ``` ### Response (Response structure includes a list of activity records, pagination metadata, and links.) ``` -------------------------------- ### Assign Prefix to Provider Source: https://context7.com/datacite/lupo/llms.txt Assign an existing prefix to a specific provider. ```bash curl -X POST "https://api.datacite.org/provider-prefixes" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{"data": {"type": "provider-prefixes", "relationships": {"provider": {"data": {"type": "providers", "id": "newuni"}}, "prefix": {"data": {"type": "prefixes", "id": "10.99999"}}}}}}' ``` -------------------------------- ### Retrieve DOI in Schema.org JSON-LD Format Source: https://context7.com/datacite/lupo/llms.txt Set the `Accept` header to `application/vnd.schemaorg.ld+json` to retrieve the DOI metadata in Schema.org JSON-LD format. ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567" \ -H "Accept: application/vnd.schemaorg.ld+json" ``` -------------------------------- ### Transfer a Client to Another Provider Source: https://context7.com/datacite/lupo/llms.txt Use this PATCH request to transfer a client from its current provider to a new one. Requires authentication. ```bash curl -X PATCH "https://api.datacite.org/clients/newuni.repo" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{"data": {"type": "clients", "id": "newuni.repo", "attributes": {"mode": "transfer"}, "relationships": {"provider": {"data": {"type": "providers", "id": "targetorg"}}}}}' ``` -------------------------------- ### Retrieve DOI with Include and Content Negotiation Source: https://context7.com/datacite/lupo/llms.txt Retrieve a DOI and include related client and media information. Content negotiation can be used to specify the desired response format. ```APIDOC ## GET /dois/{id} ### Description Retrieve a specific DOI. Supports including related resources like client and media, and content negotiation for various output formats. ### Method GET ### Endpoint `/dois/{id}` ### Query Parameters - **include** (string) - Optional - Comma-separated list of related resources to include (e.g., `client`, `media`). ### Headers - **Accept**: Specifies the desired response format (e.g., `application/vnd.datacite.datacite+xml`, `application/vnd.schemaorg.ld+json`, `application/x-bibtex`, `application/x-research-info-systems`, `text/x-bibliography`, `application/vnd.codemeta.ld+json`). ### Request Example ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567?include=client,media" ``` ### Response Example (JSON) ```json { "data": { "type": "dois", "id": "10.5281/zenodo.1234567", "attributes": { "doi": "10.5281/zenodo.1234567", "url": "https://zenodo.org/record/1234567", "created": "2023-01-01T10:00:00Z", "updated": "2023-01-01T10:00:00Z", "publisher": {"name": "Zenodo"}, "titles": [{"title": "Example Dataset"}], "types": {"resourceTypeGeneral": "Dataset"} } } } ``` ``` -------------------------------- ### Authenticate via OpenID Connect Source: https://context7.com/datacite/lupo/llms.txt Authenticate using an OpenID Connect token obtained from a load balancer. ```APIDOC ## POST /oidc-token ### Description Authenticate via OpenID Connect token (from load-balancer OIDC). ### Method POST ### Endpoint https://api.datacite.org/oidc-token ### Parameters #### Request Body - **token** (string) - Required - The OIDC ID token. ### Request Example ```bash curl -X POST https://api.datacite.org/oidc-token \ -H "Content-Type: application/json" \ -d '{"token": ""}' ``` ``` -------------------------------- ### Create a DOI with JSON Attributes Source: https://context7.com/datacite/lupo/llms.txt Register a new DOI using JSON attributes for metadata. Requires client credentials. ```APIDOC ## POST /dois ### Description Register a new DOI with metadata provided as JSON attributes. The DOI state can be `draft`, `registered`, or `findable`. Requires client credentials. ### Method POST ### Endpoint `/dois` ### Headers - **Authorization**: Bearer Token - **Content-Type**: `application/vnd.api+json` ### Request Body ```json { "data": { "type": "dois", "attributes": { "doi": "string", "url": "string", "titles": [{"title": "string"}], "creators": [{"name": "string", ...}], "publisher": {"name": "string"}, "publicationYear": "integer", "types": {"resourceTypeGeneral": "string"}, "descriptions": [{"description": "string", "descriptionType": "string"}], "subjects": [{"subject": "string"}], "rightsList": [{"rights": "string", "rightsUri": "string"}], "event": "string" // e.g., "publish", "register" }, "relationships": { "client": {"data": {"type": "clients", "id": "string"}} } } } ``` ### Request Example ```bash curl -X POST "https://api.datacite.org/dois" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{ "data": { "type": "dois", "attributes": { "doi": "10.5438/test-doi-001", "url": "https://example.org/dataset/001", "titles": [{"title": "My Research Dataset"}], "creators": [{ "nameType": "Personal", "name": "Doe, Jane", "givenName": "Jane", "familyName": "Doe", "nameIdentifiers": [{"nameIdentifier": "https://orcid.org/0000-0001-2345-6789", "nameIdentifierScheme": "ORCID"}], "affiliation": [{"name": "Example University"}] }], "publisher": {"name": "Example Repository"}, "publicationYear": 2024, "types": {"resourceTypeGeneral": "Dataset"}, "descriptions": [{"description": "A sample research dataset.", "descriptionType": "Abstract"}], "subjects": [{"subject": "Environmental Science"}], "rightsList": [{"rights": "Creative Commons Attribution 4.0", "rightsUri": "https://creativecommons.org/licenses/by/4.0/"}], "event": "publish" }, "relationships": { "client": {"data": {"type": "clients", "id": "datacite.test"}} } } }' ``` ``` -------------------------------- ### List Contacts for Provider Source: https://context7.com/datacite/lupo/llms.txt Retrieve a list of contacts associated with a specific provider ID. ```bash curl "https://api.datacite.org/contacts?provider-id=cern" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Create a DOI with Base64-Encoded DataCite XML Source: https://context7.com/datacite/lupo/llms.txt Register a new DOI by providing the DataCite XML metadata as a base64-encoded string in the `xml` attribute. Requires client credentials and authentication. ```bash curl -X POST "https://api.datacite.org/dois" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/vnd.api+json" \ -d '{ "data": { "type": "dois", "attributes": { "xml": "PD94bWwgdmVyc2lvbj0iMS4wIj8+PHJlc291cmNlPi4uLjwvcmVzb3VyY2U+", "url": "https://example.org/dataset/002", "event": "publish" } } }' ``` -------------------------------- ### Trigger Async Repository Export Job Source: https://context7.com/datacite/lupo/llms.txt Initiates an asynchronous export job for all repositories. Requires an authorization token. ```bash curl -X POST "https://api.datacite.org/repositories/export" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Export All Contacts as CSV Source: https://context7.com/datacite/lupo/llms.txt Use this endpoint to export all registered contacts in CSV format. Requires an authorization token. ```bash curl "https://api.datacite.org/export/contacts" \ -H "Authorization: Bearer $TOKEN" > contacts.csv ``` -------------------------------- ### Trigger Async Provider Export Job Source: https://context7.com/datacite/lupo/llms.txt Initiates an asynchronous export job for all providers. A success message indicates the job has been queued. ```bash curl -X POST "https://api.datacite.org/providers/export" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### GraphQL Queries Source: https://context7.com/datacite/lupo/llms.txt Provides flexible cross-resource queries using GraphQL. Supports Apollo Federation tracing and requires bearer token authentication. ```APIDOC ## POST /client-api/graphql ### Description Executes GraphQL queries against the DataCite API for flexible cross-resource data retrieval. Supports Apollo Federation tracing. ### Method POST ### Endpoint /client-api/graphql #### Request Body - **query** (string) - Required - The GraphQL query string. ### Request Example (Query datasets by funder) ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "query { datasets(funderId: \"https://doi.org/10.13039/501100000780\", first: 5, published: \"2020-2024\") { totalCount nodes { id doi titles { title } publicationYear citationCount viewCount creators { name } repository { id name } } } }" }' ``` ### Request Example (Query a single work with citations and references) ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "query { work(id: \"https://doi.org/10.5281/zenodo.1234567\") { id doi titles { title } publicationYear creators { name nameIdentifiers { nameIdentifier } } citationCount citations(first: 3) { totalCount nodes { id doi titles { title } } } references(first: 3) { totalCount nodes { id doi titles { title } } } formattedCitation(style: \"apa\") } }" }' ``` ### Request Example (Query a researcher by ORCID) ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "query { person(id: \"https://orcid.org/0000-0001-2345-6789\") { id name datasets(first: 5) { totalCount nodes { doi titles { title } publicationYear } } publications(first: 5) { totalCount nodes { doi titles { title } } } } }" }' ``` ### Request Example (Query an organization) ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "query { organization(id: \"https://ror.org/01k4yrm29\") { id name country { name } citationCount datasets(first: 3) { totalCount nodes { doi titles { title } } } } }" }' ``` ### Request Example (Create a DOI claim mutation) ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "mutation { createClaim(doi: \"10.5281/zenodo.1234567\", sourceId: \"orcid_search\") { claim { id state sourceId } errors { message } } }" }' ``` ### Request Example (Update user profile mutation) ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "mutation { updateUserProfile(uid: \"0000-0001-2345-6789\", name: \"Jane Doe\") { user { id name } errors { message } } }" }' ``` ### Response (Response structure depends on the specific GraphQL query executed. Typically returns a JSON object with 'data' and/or 'errors' fields.) ``` -------------------------------- ### GraphQL: Create DOI Claim Mutation Source: https://context7.com/datacite/lupo/llms.txt Creates a claim linking a DOI to an ORCID profile using a mutation. Requires a bearer token and JSON content type. Returns claim status and potential errors. ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ \ "query": "mutation { createClaim(doi: \"10.5281/zenodo.1234567\", sourceId: \"orcid_search\") { claim { id state sourceId } errors { message } } }"' ``` -------------------------------- ### Export all repositories as CSV Source: https://context7.com/datacite/lupo/llms.txt Exports all repository data in CSV format. Requires elevated privileges. ```APIDOC ## GET /export/repositories ### Description Exports all repository data in CSV format. This is an administrative endpoint requiring elevated privileges. ### Method GET ### Endpoint /export/repositories ### Request Example ```bash curl "https://api.datacite.org/export/repositories" \ -H "Authorization: Bearer $TOKEN" > repositories.csv ``` ### Response (Returns the repository data as a CSV file.) ``` -------------------------------- ### Run DataCite API Test Suite Source: https://github.com/datacite/lupo/blob/master/README.md Execute the entire test suite for the DataCite API. This helps ensure the application is functioning correctly. ```bash docker-compose exec web bundle exec rspec ``` -------------------------------- ### Retrieve DOI in DataCite XML Format Source: https://context7.com/datacite/lupo/llms.txt Set the `Accept` header to `application/vnd.datacite.datacite+xml` to retrieve the DOI metadata in DataCite XML format. ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567" \ -H "Accept: application/vnd.datacite.datacite+xml" ``` -------------------------------- ### GraphQL: Query Organization with Stats Source: https://context7.com/datacite/lupo/llms.txt Retrieves information about an organization, including its country, citation count, and associated datasets. Requires a bearer token and JSON content type. ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ \ "query": "query { organization(id: \"https://ror.org/01k4yrm29\") { id name country { name } citationCount datasets(first: 3) { totalCount nodes { doi titles { title } } } } }"' ``` -------------------------------- ### Retrieve Handle-resolved URL for a DOI Source: https://context7.com/datacite/lupo/llms.txt Use the `/get-url` endpoint to retrieve the Handle-resolved URL for a given DOI. Requires authentication. ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567/get-url" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### GraphQL: Query Datasets by Funder Source: https://context7.com/datacite/lupo/llms.txt Queries datasets associated with a specific funder, with options to filter by publication year and limit results. Requires a bearer token and JSON content type. ```bash curl -X POST "https://api.datacite.org/client-api/graphql" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ \ "query": "query { datasets(funderId: \"https://doi.org/10.13039/501100000780\", first: 5, published: \"2020-2024\") { totalCount nodes { id doi titles { title } publicationYear citationCount viewCount creators { name } repository { id name } } } }"' ``` -------------------------------- ### Retrieve Single DOI with Content Negotiation Source: https://context7.com/datacite/lupo/llms.txt Fetch a single DOI record. By default, it returns the record in JSONAPI format. Content negotiation can be used to retrieve the metadata in various other supported formats. ```bash # Default JSONAPI response curl "https://api.datacite.org/dois/10.5281/zenodo.1234567" ``` -------------------------------- ### Retrieve DOI with Custom Style and Locale Source: https://context7.com/datacite/lupo/llms.txt Retrieve a DOI formatted as a citation, allowing for custom citation styles and locales. ```APIDOC ## GET /dois/{id} ### Description Retrieve a specific DOI formatted as a citation. Allows customization of citation style and locale. ### Method GET ### Endpoint `/dois/{id}` ### Query Parameters - **style** (string) - Optional - The citation style to use (e.g., `chicago-author-date`). - **locale** (string) - Optional - The locale for the citation (e.g., `de-DE`). ### Headers - **Accept**: `text/x-bibliography` for citation formats. ### Request Example ```bash curl "https://api.datacite.org/dois/10.5281/zenodo.1234567?style=chicago-author-date&locale=de-DE" -H "Accept: text/x-bibliography" ``` ### Response Example (APA Citation) ``` Doe, J. (2023). Example Dataset. Zenodo. https://doi.org/10.5281/zenodo.1234567 ``` ```