# did.py

`GET` `/dids/<scope>/$`

  > Return all data identifiers in the given scope.

  Example request:

      GET /dids/<scope>/$ HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0]

`GET` `/dids/<scope>/dids/search`

  > List all data identifiers in a scope which match a given metadata.

  Example request:

      GET /dids/<scope>/dids/search HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 409 Conflict – ‘UnsupportedOperation’: e.args[0][0] 404 Not Found – ‘KeyNotFound’: e.args[0][0]

`POST` `/dids`

  > No doc string

  Example request:

      POST /dids HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

`POST` `/dids/attachments/attachments`

  > No doc string

  Example request:

      POST /dids/attachments/attachments HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

`GET` `/dids/<scope>/<name>/status/(.+)/(.+)`

  > Retrieve a single data identifier.

  Example request:

      GET /dids/<scope>/<name>/status/(.+)/(.+) HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/json'

  Status Codes: | 404 Not Found – ‘ScopeNotFound’: e.args[0][0] 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`POST` `/dids/<scope>/<name>/status/(.+)/(.+)`

  > Create a new data identifier.

  Example request:

      POST /dids/<scope>/<name>/status/(.+)/(.+) HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

  Status Codes: | 400 Bad Request – ‘ValueError’: ‘Cannot decode json parameter list’ 400 Bad Request – ‘ValueError’: str(e 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 409 Conflict – ‘DuplicateContent’: e.args[0][0] 409 Conflict – ‘DataIdentifierAlreadyExists’: e.args[0][0] 401 Unauthorized – ‘AccessDenied’: e.args[0][0] 409 Conflict – ‘UnsupportedOperation’: e.args[0][0] 500 Internal Server Error – ‘DatabaseException’: e.args 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`PUT` `/dids/<scope>/<name>/status/(.+)/(.+)`

  > Update data identifier status.

  Example request:

      PUT /dids/<scope>/<name>/status/(.+)/(.+) HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

  Status Codes: | 400 Bad Request – ‘ValueError’: ‘Cannot decode json data parameter’ 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 409 Conflict – ‘UnsupportedStatus’: e.args[0][0] 409 Conflict – ‘UnsupportedOperation’: e.args[0][0] 401 Unauthorized – ‘AccessDenied’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`GET` `/dids/<scope>/<name>/dids`

  > Returns the contents of a data identifier.

  Example request:

      GET /dids/<scope>/<name>/dids HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`POST` `/dids/<scope>/<name>/dids`

  > Append data identifiers to data identifiers.

  Example request:

      POST /dids/<scope>/<name>/dids HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

  Status Codes: | 400 Bad Request – ‘ValueError’: ‘Cannot decode json parameter list’ 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 409 Conflict – ‘DuplicateContent’: e.args[0][0] 401 Unauthorized – ‘AccessDenied’: e.args[0][0] 409 Conflict – ‘UnsupportedOperation’: e.args[0][0] 404 Not Found – ‘RSENotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0]

`DELETE` `/dids/<scope>/<name>/dids`

  > Detach data identifiers from data identifiers.

  Example request:

      DELETE /dids/<scope>/<name>/dids HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

  Status Codes: | 400 Bad Request – ‘ValueError’: ‘Cannot decode json parameter list’ 409 Conflict – ‘UnsupportedOperation’: e.args[0][0] 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 401 Unauthorized – ‘AccessDenied’: e.args[0][0]

`GET` `/dids`

  > No doc string

  Example request:

      GET /dids HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

`GET` `/dids/<scope>/<name>/files`

  List all replicas of a data identifier.

  Example request:

      GET /dids/<scope>/<name>/files HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`GET` `/dids/<scope>/<name>/parents`

  List all parents of a data identifier.

  Example request:

      GET /dids/<scope>/<name>/parents HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`GET` `/dids/<scope>/<name>/meta`

  > List all meta of a data identifier.

  Example request:

      GET /dids/<scope>/<name>/meta HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/json'

  Status Codes: | 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`POST` `/dids/<scope>/<name>/meta/<key>`

  > Add metadata to a data identifier.

  Example request:

      POST /dids/<scope>/<name>/meta/<key> HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

  Status Codes: | 400 Bad Request – ‘ValueError’: ‘Cannot decode json parameter list’ 409 Conflict – ‘Duplicate’: e[0][0] 400 Bad Request – ‘KeyNotFound’: e[0][0] 400 Bad Request – ‘InvalidMetadata’: e[0][0] 400 Bad Request – ‘InvalidValueForKey’: e[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`GET` `/dids/<scope>/<name>/rules`

  > Return all rules of a given DID.

  Example request:

      GET /dids/<scope>/<name>/rules HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 404 Not Found – ‘RuleNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0]

`GET` `/dids/<scope>/<name>/associated_rules`

  > Return all associated rules of a file.

  Example request:

      GET /dids/<scope>/<name>/associated_rules HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 500 Internal Server Error – e.__class__.__name__: e.args[0]

`GET` `/dids/<guid>/guid`

  > Return the file associated to a GUID.

  Example request:

      GET /dids/<guid>/guid HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0]