Skip to content

B2SHARE v3 (Invenio-RDM 13) API Submission Guide#

Overview#

This guide explains how to publish metadata, upload files, and submit a record to a community through the B2SHARE v3 API.

To use the API, you first need to generate an API token:

Profile > Applications > Personal access tokens

Use this token as your in all requests.


STEP 1: Create a draft record (publish metadata)#

This creates a draft record. You will publish it later.

curl -X POST "https://b2share.eudat.eu/api/records" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -d '{
    "access": {"record": "public", "files": "public"},
    "metadata": {
      "title": "An Empirical Study on Marine Ecosystems",
      "description": "This paper examines climate impacts on marine life in the Arctic region.",
      "publication_date": "2025-10-01",
      "publisher": "Nordic Marine Studies",
      "creators": [
        {
          "person_or_org": {
            "family_name": "Johansen",
            "given_name": "Kari",
            "type": "personal"
          },
          "affiliations": [{"name": "University of Tromsø"}]
        },
        {
          "person_or_org": {
            "family_name": "Larsen",
            "given_name": "Ola",
            "type": "personal"
          },
          "affiliations": [{"name": "Norwegian Institute of Marine Research"}]
        }
      ],
      "resource_types": [{"id": "publication-journal"}],
      "identifiers": [
        {"scheme": "doi", "identifier": "10.1234/ojs.2025.003"},
        {"scheme": "url", "identifier": "https://journals.example.org/article/view/3"}
      ],
      "subjects": [
        {"subject": "Marine biology"},
        {"subject": "Climate change"}
      ],
      "rights": [{"id": "cc-by-4.0"}]
    },
    "files": {"enabled": true}
  }'

The response will return a Record ID. Use this value in all following steps:

$RID = <record_id>

STEP 2: Add file metadata#

Add the list of file entries you plan to upload.

Single file:

curl -X POST "https://b2share.eudat.eu/api/records/$RID/draft/files" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '[{"key": "article.pdf"}]'

Multiple files:

curl -X POST "https://b2share.eudat.eu/api/records/$RID/draft/files" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '[
        {"key": "figure.png"},
        {"key": "article.pdf"},
        {"key": "data.zip"}
      ]'

STEP 3: Upload file content#

Repeat this step for each file.

curl -X PUT "https://b2share.eudat.eu/api/records/$RID/draft/files/article.pdf/content" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/octet-stream" \
  --upload-file <file_path>/article.pdf

STEP 4: Commit the uploaded file#

Repeat this step for each file.

curl -X POST "https://b2share.eudat.eu/api/records/$RID/draft/files/article.pdf/commit" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"

STEP 5: Create a request to submit to a community#

In order to submit to a community, you need to first get the community id.

The community id can be found quering the https://b2share.eudat.eu/api/communities/ endpoint.

Example: https://b2share.eudat.eu/api/communities/eudat

Then you can create a review request associated with your draft record.

curl -X PUT "https://b2share.eudat.eu/api/records/$RID/draft/review" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -d '{
    "receiver": {
      "community": "<community_id>"
    },
    "type": "community-submission"
  }'

The response includes a section like:

"links": {
  "actions": {
    "submit": "https://b2share.eudat.eu/api/requests/<request_id>/actions/submit"
  }
}

Copy the value of the submit link.


STEP 6: Submit the record to the community#

Use the submit URL obtained from the previous response:

response_link = response.links.actions.submit

Example:

https://b2share.eudat.eu/api/requests/<request_id>/actions/submit

Submit the request:

curl -X POST "<response_link>" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"

After this step: - If the community allows direct publication, the submission is accepted immediately. - If the community requires review, the request will stay pending until a curator accepts it.

Last update : 14.11.2025

Last review : 14.11.2025