Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Create a new handle for given group

POST /groups/{id}/handles

Registers a new Public Data handle in the specified handle service on behalf of a group.

A Public Data handle is essentially a persistent identifier (PID/DOI) that points to a resource in Onedata that is to be shared publicly as a Public Data record. All handles are advertised via the OAI-PMH protocol (Onezone serves as a repository of Public Data records, to be harvested by Public Data aggregators).

The handle service serves as a proxy that registers persistent identifiers in an external service such as DataCite or handle.net. It is typically set up by Onezone admins, who grant the rights to register handles to specific users/groups.

This operation requires group_create_handle privilege in the group and handle_service_register_handle privilege in the handle service specified in the handleServiceId field.
For administrator who does not belong to this group oz_groups_add_relationships and oz_handles_create privilege is required.

Example cURL requests

Create new handle for given group

curl -H "x-auth-token: $TOKEN" -H "content-type: application/json" \
  -X POST https://$ZONE_HOST/api/v3/onezone/groups/$GROUP_ID/handles \
  -d '{ 
    "handleServiceId": "ddb06ed993bae95f2f430664fff122f7", 
    "resourceType": "Share", 
    "resourceId": "4fa683cbda8d8f686d15d42720af431d", 
    "metadataSchema": "oai_dc", 
    "metadata": "<?xml version=\"1.0\" encoding=\"utf-8\" ?><metadata><dc:contributor>John Doe</dc:contributor></metadata>"
  }'

Path parameters

Parameter Type & Description
id required
string

Group Id.

Request body

application/json

New handle parameters.

PropertyType & Description
handleServiceId
string

The Id of the handle service through which the handle will be registered.

resourceType
string

The type of resource for which a handle will be registered - currently, only the Share type is supported.

Enum:
Share
resourceId
string

The Id of the resource to be assigned a handle identifier (currently, always a share Id).

metadataSchema
string

Short keyword that indicates the schema of the metadata attached to the handle. The keywords are borrowed from the concept of metadataPrefix in the OAI-PMH protocol.

  • oai_dc - Dublin Core
  • oai_datacite - Datacite
  • edm - Europeana Data Model Each handle metadata schema can be disseminated using one or more OAI-PMH metadata prefixes, but each OAI-PMH metadata prefix has only one corresponding handle metadata schema.
Enum:
oai_dcoai_dataciteedm
metadata
string

Metadata (in XML format) compliant with the schema indicated by the metadata prefix.

Request Examples

application/json
{
  "handleServiceId": "f1c8b1a37aa7447b22eb65a742d40524",
  "resourceType": "Share",
  "resourceId": "f7a6d2ea511e728c9b3f3972cecb7af4",
  "metadataSchema": "oai_dc",
  "metadata": "<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?> <metadata xmlns:dc=\\\"http://purl.org/dc/elements/1.1/\\\">\n  <dc:title>Example Resource</dc:title>\n  <dc:creator>John Doe</dc:creator>\n  <dc:publisher>ACC Cyfronet AGH</dc:publisher>\n  <dc:date>2024-06-15</dc:date>\n</metadata>\n"
}

Responses

application/json
201

URI of the created space in form https://$ZONE_HOST/api/onezone/v3/groups/{id}/handles/{sid} is returned in the response Location header.

400

Invalid request.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
401

Authentication error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
403

Authorization error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
404

Resource not found.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
500

Internal server Error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}