API and Resource reference

This section goes into more detail on the Hydra API and the resources it operates on.

The DLCS API is at https://api.dlcs.io/ and requires credentials using basic auth over https. There is also an open API at https://dlcs.azurewebsites.net/ that requires no credentials and is backed by mock data. This is a good way to explore the resource model used by the DLCS and relate the descriptions in this documentation to API responses.

The API uses JSON-LD and the Hydra vocabulary. Hydra+JSON-LD turns JSON over HTTP into a self-describing HyperMedia API. Each resource type has an associated JSON-LD context, and the full description of the types and their supported properties and operations is discoverable by clients.

The root of the API is of the special type “EntryPoint”:

{
    "@context": "http://dlcs.azurewebsites.net/contexts/DLCS.Client.Model.EntryPoint.jsonld",
    "@id": "http://dlcs.azurewebsites.net",
    "@type": "EntryPoint",
    "customers": "http://dlcs.azurewebsites.net/customers",
    "originStrategies": "http://dlcs.azurewebsites.net/originStrategies",
    "portalRoles": "http://dlcs.azurewebsites.net/portalRoles",
    "imageOptimisationPolicies": "http://dlcs.azurewebsites.net/imageOptimisationPolicies",
    "thumbnailPolicies": "http://dlcs.azurewebsites.net/thumbnailPolicies"
}

Each type-specific context defines the vocabulary for that type, for example:

{
    "@context": {
        "hydra": "http://www.w3.org/ns/hydra/core#",
        "vocab": "http://dlcs.azurewebsites.net/vocab#",
        "EntryPoint": "vocab:EntryPoint",
        "customers": {
            "@id": "vocab:EntryPoint/customers",
            "@type": "@id"
        }
    }
}

The full description of the types and their supported properties and operations is available at the “vocab” URI

Example: https://dlcs.azurewebsites.net/vocab. Note: This is implemented in API at /doc endpoint.

A diagram showing the full model is available here; the rest of this section looks at each resource type in detail.

For a collection of sample cURL requests, see the sample requests page.