Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Add handle service

POST /handle_services

Allows to register a new handle service.

This operation requires oz_handle_services_create admin privilege.

See also:
Create a new handle service for the current user
Create a new handle service for given group

Example cURL requests

Add handle services

curl -u username:password -X POST -H "Content-type: application/json" \
-d '{ ... }' https://$HOST/api/v3/handle_services

Request body

application/json
PropertyType & Description
handleServiceId
string

Handle service Id.

name
string

The user defined name of the service.

proxyEndpoint
string

The endpoint of the Handle service proxy, i.e. a service which implements logic specific for particular Handle service.

serviceProperties
object (HandleServiceProperties)

An abstract type for Handle identifier services properties.

type required
discriminator string

The type of handle service.

The type of handle service.

creator
object (Subject)

Object representing a subject in the system, can be perceived as client (actor) identity.

type
string

Type of the subject

Enum:
nobodyuseroneprovider
id
string

Id of the subject (null for nobody)

creationTime
integer (Timestamp)

Timestamp in seconds (UNIX epoch), e.g. 1563819329.

Request Examples

application/json
{
  "handleServiceId": "cdca849d2b71bc7205f3eab686cf62fb",
  "name": "MyCommunity Handle service",
  "proxyEndpoint": "https://localhost:17000/handle_proxy",
  "serviceProperties": {
    "type": "DOI",
    "host": "https://mds.test.datacite.org",
    "doiEndpoint": "/doi",
    "metadataEndpoint": "/metadata",
    "mediaEndpoint": "/media",
    "prefix": 10.5072,
    "username": "alice",
    "password": "pa$$word",
    "identifierTemplate": "{{space.name}}-{{space.guid}}",
    "allowTemplateOverride": false
  },
  "creator": {
    "type": "user",
    "id": "7434b256e71e1052e0d5e3e9da657ebf"
  },
  "creationTime": 1576152793
}

Responses

application/json
201

URI of the created handle service in form https://$HOST/api/onezone/v3/handle_services/{id} 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."
  }
}