Multi-Step Creation API

Build a container one call at a time. Do the calls in order. Each step needs the container_id from Step 1.

Step 1: Initialize Container

Creates a new container and sets up its folder structure. Access levels must be Public, Private, or Restricted.

  • Endpoint: POST /rdmc/init/

  • Request Payload:

{
  "RDMC Title": "Ocean Current Analysis 2026",
  "Artifacts Details": [
    {
      "artifact_name": "Source_Code",
      "access_level": "Public"
    },
    {
      "artifact_name": "Raw_Data",
      "access_level": "Restricted"
    }
  ]
}

  • Expected Response (201 Created):

{
  "success": true,
  "container_id": "niBWYGu6",
  "message": "Step 1 complete: RDMC initialized and empty physical directories created."
}

Step 2: Upload Resource(s)

Adds links, files, or folders to container artifacts. A call can upload one resource, or a mix of links, files, and folders to one or more artifacts (see Upload multiple resources below).

  • Endpoint: POST /rdmc/<container_id>/upload/

Note

Important Note on File and Folder Paths: If you send a pure JSON payload with paths like C:/Research/Data/..., the server will try to read those files from its own local hard drive. This only works if you are running the server locally.

To upload files from your computer to a remote server, you must use ``multipart/form-data`` so the actual file content is transmitted. See the Integration Guide below for a curl example, or use the recommended Python client.

👉 View step_by_step_rdmc_api.py on GitLab

Upload a link (JSON)

{
  "artifact_name": "Source_Code",
  "access_level": "Public",
  "links": [
    {
      "link": "https://github.com/research-lab/climate-model",
      "title": "Project Repository",
      "resource type": "Software"
    }
  ]
}

  • Expected Response (201 Created):

{
  "success": true,
  "message": "Resources uploaded successfully.",
  "warnings": []
}

Upload multiple resources (Server-Local JSON)

Warning: This JSON format only works if the files are already on the server. For remote uploads, use multipart/form-data.

{
  "Artifacts Details": [
    {
      "artifact_name": "Source_Code",
      "access_level": "Public",
      "links": [
        {
          "link": "https://gitlab.gwdg.de/nfdixcs/a1-architecture/rdmc-prototype",
          "title": "Project Wiki",
          "resource type": "Software"
        }
      ],
      "files": [
        {
          "file name": "C:/Users/mm/Documents/app_v1.exe",
          "title": "Release v1.0",
          "resource type": "Software"
        }
      ],
      "folders": [
        {
          "folder name": "C:/Users/mm/Documents/libs",
          "title": "Support Libraries",
          "resource type": "Software"
        }
      ]
    }
  ]
}

Step 3: Apply Container Metadata

Adds descriptive metadata to the container. This also generates the physical manifest.rdmc file and updates the container’s hashes.

  • Endpoint: POST /rdmc/<container_id>/metadata/

  • Request Payload:

{
  "Contributors": [
    {
      "first_name": "Jane",
      "last_name": "Doe",
      "affiliation": "Institute for Computer Science",
      "orcid": "0000-0002-1825-0097",
      "role": "Lead Developer"
    }
  ],
  "License": "MIT",
  "Keywords": "Machine Learning, Distributed Systems, API",
  "Description": "Implementation of the distributed architecture model.",
  "Subject": "Computer and Information Science"
}

  • Expected Response (200 OK):

{
  "success": true,
  "message": "Metadata successfully applied, manifest.rdmc generated, and hashes updated."
}

Step 4: Seal Container

Locks the container against future edits. This hashes every file, generates an EPIC PID if the service is reachable, and signs the result.

  • Endpoint: POST /rdmc/<container_id>/seal/

  • Request Payload: An empty JSON object, {}

  • Expected Response (200 OK):

{
  "success": true,
  "message": "Container sealed and signed successfully.",
  "epic_pid": "21.11113/0000-0000-0000-0000",
  "signature": "base64_encoded_signature_string_here"
}

Note

Sealing a container twice returns an error. A sealed container cannot be sealed again.

Integration Guide

The example below uses curl in the Windows Command Prompt (CMD) to show the exact HTTP calls. Any language that can send HTTP requests can follow the same pattern. In Bash, end each line with \ instead of ^ and put the JSON in single quotes.

# Step 1: Initialize the container
curl -f -X POST https://api.nfdixcs.org/rdmc_creation/rdmc/init/ ^
  -H "Authorization: Token <your_token>" ^
  -H "Content-Type: application/json" ^
  -d "{\"RDMC Title\": \"My First RDMC\", \"Artifacts Details\": [{\"artifact_name\": \"Source_Code\", \"access_level\": \"Public\"}, {\"artifact_name\": \"Datasets\", \"access_level\": \"Restricted\"}]}"

# The response contains a "container_id". Use it in place of <container_id> below.

# --------------------------------------------------
# Step 2: Upload a link
# --------------------------------------------------
curl -f -X POST https://api.nfdixcs.org/rdmc_creation/rdmc/<container_id>/upload/ ^
  -H "Authorization: Token <your_token>" ^
  -H "Content-Type: application/json" ^
  -d "{\"artifact_name\": \"Datasets\", \"access_level\": \"Restricted\", \"links\": [{\"link\": \"https://gitlab.gwdg.de/nfdixcs/a1-architecture/rdmc-prototype\", \"title\": \"RDMC Prototype\", \"resource type\": \"Data\"}]}"

# --------------------------------------------------
# Step 2: Upload a real file from your computer (Multipart)
# --------------------------------------------------
curl -f -X POST https://api.nfdixcs.org/rdmc_creation/rdmc/<container_id>/upload/ ^
  -H "Authorization: Token <your_token>" ^
  -F "artifact_name=Source_Code" ^
  -F "access_level=Public" ^
  -F "files_meta=[{\"title\": \"questions_v_1.0.6.json\", \"resource type\": \"Data\"}]" ^
  -F "files=@C:/Users/mm/Downloads/questions_v_1.0.6.json"

# Step 3: Add metadata
curl -f -X POST https://api.nfdixcs.org/rdmc_creation/rdmc/<container_id>/metadata/ ^
  -H "Authorization: Token <your_token>" ^
  -H "Content-Type: application/json" ^
  -d "{\"Contributors\": [{\"first_name\": \"Jane\", \"last_name\": \"Doe\", \"affiliation\": \"Institute for Computer Science\", \"orcid\": \"0000-0002-1825-0097\", \"role\": \"Lead Developer\"}], \"License\": \"MIT\", \"Keywords\": \"Machine Learning, Distributed Systems, API\", \"Description\": \"Implementation of the distributed architecture model.\", \"Subject\": \"Computer and Information Science\"}"

# Step 4: Seal the container
curl -f -X POST https://api.nfdixcs.org/rdmc_creation/rdmc/<container_id>/seal/ ^
  -H "Authorization: Token <your_token>" ^
  -H "Content-Type: application/json" ^
  -d "{}"

# Only if a step above failed: delete the container instead of leaving it partially built
curl -f -X DELETE https://api.nfdixcs.org/rdmc_creation/rdmc/<container_id>/delete/ ^
  -H "Authorization: Token <your_token>"

Note

Why a folder cannot easily be uploaded with curl: To upload a folder properly, you must zip it and send it via a folder_zip multipart field, or send every file with mapped relative paths. This cannot be written cleanly as one short command. We highly recommend using the Python client for uploading folders. It traverses the directory and handles the zip packaging for you automatically.

Check the status code after each call. 200 or 201 means it worked. The -f option makes curl stop with an error when the server returns an error status. If a call fails, run the delete command above before you retry. This clears the partially built container so no files are left behind.