Create a new handle for the current user
Registers a new Public Data handle in the specified handle service as the current user.
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 can be invoked on behalf of the current user only and requires 'handle_service_register_handle' privilege in the handle service where the new handle is to be registered.
Example cURL requests
Create new handle for the current user
curl -H "x-auth-token: $TOKEN" -H "content-type: application/json" \
-X POST https://$ZONE_HOST/api/v3/onezone/user/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>"
}'
Request body
New handle parameters.
| Property | Type & 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 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.
Enum: oai_dcoai_dataciteedm | |
metadata string Metadata (in XML format) compliant with the schema indicated by the metadata prefix. | |
Request Examples
{
"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
URI of the created space in form https://$ZONE_HOST/api/onezone/v3/user/handles/{id} is returned in the response Location header.
Invalid request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}