We use the Dublin Core meaning for what a Resource represents: “…a resource is anything that has identity. Familiar examples include an electronic document, an image, a service (e.g., ”today's weather report for Los Angeles“), and a collection of other resources. Not all resources are network ”retrievable“; e.g., human beings, corporations, and bound books in a library can also be considered resources.”

Supported Formats

json

GET /resources
Return a list of resources available to the authenticated user

Supported Formats

json

Examples

curl  -H 'Authorization: CHANGEME' http://localhost:10000/api/v1/organizations/1/resources/ | jsonlint
  {
"data": [
  {
    "id": "t.y.f.f.s.h.,_2011_929d",
    "type": "resource",
    "attributes": {
      "title": "T.Y.F.F.S.H., 2011",
      "resource_type": "still_image",
      "canonical_id": "c4ca4238a0b923820dcc509a6f75849b",
      "source_uri": "https://coyote.pics/wp-content/uploads/2016/02/Screen-Shot-2016-02-29-at-10.05.14-AM-1024x683.png",
      "created_at": "2017-11-06T16:17:49.630Z",
      "updated_at": "2017-11-06T16:55:10.207Z",
      "resource_group": "collection"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organization",
          "id": "1"
        }
      },
      "representations": {
        "data": [
          {
            "type": "representation",
            "id": "1"
          }
        ]
      }
    }
  },
  {
    "id": "mona_lisa_48f9",
    "type": "resource",
    "attributes": {
      "title": "Mona Lisa",
      "resource_type": "still_image",
      "canonical_id": "c81e728d9d4c2f636f067f89cc14862c",
      "source_uri": "http://example.com/image123.png",
      "created_at": "2017-11-06T16:17:49.926Z",
      "updated_at": "2017-11-06T16:17:49.926Z",
      "resource_group": "voluptatibus"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organization",
          "id": "1"
        }
      },
      "representations": {
        "data": []
      }
    }
  }
],
"included": [
  {
    "id": "1",
    "type": "organization",
    "attributes": {
      "title": "Acme Museum"
    }
  },
  {
    "id": "1",
    "type": "representation",
    "attributes": {
      "status": "approved",
      "content_uri": null,
      "content_type": "text/plain",
      "language": "en",
      "text": "A red, white, and blue fabric canopy presses against walls of room; portable fans blow air into the room through a doorway.",
      "created_at": "2017-11-06T16:17:49.811Z",
      "updated_at": "2017-11-06T16:19:23.998Z",
      "metum": "Short",
      "author": "effie.boyle@carroll.org",
      "license": "Et quo dignissimos ex. Non optio minima eum qui. Placeat adipisci id omnis amet rem pariatur."
    },
    "relationships": {
      "resource": {
        "meta": {
          "included": false
        }
      }
    },
    "links": {
      "self": null
    }
  }
],
"links": {
  "self": "http://localhost:10000/api/v1/organizations/1/resources",
  "first": "http://localhost:10000/api/v1/organizations/1/resources?page%5Bnumber%5D=1\u0026page%5Bsize%5D=50"
},
"jsonapi": {
  "version": "1.0"
}
TEST

Params

Param name Description
page[number]
optional

Identifies the page of results to retrieve, numbered starting at 1

Validations:

  • Must be a Integer

page[size]
optional

How many records to return per page

Validations:

  • Must be a Integer

filter
optional

Validations:

  • Must be a Hash

filter[identifier_or_title_or_representations_text_cont_all]
optional

Search Resource identifier, title, or associated Representation text for this value

Validations:

  • Must be a String

filter[scope]
optional

Limit search to Resources in these states

Validations:

  • Must be one of: represented, assigned, unassigned, unrepresented, assigned_unrepresented, unassigned_unrepresented.


GET /resources/:id
Return attributes of a particular resource

Supported Formats

json

Examples

curl  -H 'Authorization: CHANGEME' http://localhost:10000/api/v1/resources/1 | jsonlint
{
  "data": {
    "id": "1",
    "type": "resource",
    "attributes": {
      "id": 1,
      "title": "T.Y.F.F.S.H., 2011",
      "resource_type": "still_image",
      "canonical_id": "c4ca4238a0b923820dcc509a6f75849b",
      "source_uri": "https://coyote.pics/wp-content/uploads/2016/02/Screen-Shot-2016-02-29-at-10.05.14-AM-1024x683.png",
      "created_at": "2017-11-06T16:17:49.630Z",
      "updated_at": "2017-11-06T16:55:10.207Z",
      "resource_group": "collection"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organization",
          "id": "1"
        }
      },
      "representations": {
        "data": [
          {
            "type": "representation",
            "id": "1"
          }
        ]
      }
    }
  },
  "included": [
    {
      "id": "1",
      "type": "organization",
      "attributes": {
        "title": "Acme Museum"
      }
    },
    {
      "id": "1",
      "type": "representation",
      "attributes": {
        "status": "approved",
        "content_uri": null,
        "content_type": "text/plain",
        "language": "en",
        "text": "A red, white, and blue fabric canopy presses against walls of room; portable fans blow air into the room through a doorway.",
        "created_at": "2017-11-06T16:17:49.811Z",
        "updated_at": "2017-11-06T16:19:23.998Z",
        "metum": "Short",
        "author": "effie.boyle@carroll.org",
        "license": "Et quo dignissimos ex. Non optio minima eum qui. Placeat adipisci id omnis amet rem pariatur."
      },
      "relationships": {
        "resource": {
          "meta": {
            "included": false
          }
        }
      },
      "links": {
        "self": null
      }
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

POST /resources
Create a new resource

Supported Formats

json

Params

Param name Description
resource
optional , nil allowed

Validations:

  • Must be a Hash

resource[id]
required

Resource ID

Validations:

  • Must be a Integer

resource[identifier]
required

Unique human-readable identifier (slug) for this resource

Validations:

  • Must be a String

resource[title]
optional , nil allowed

Caption that helps humans identify the resource

Validations:

  • Must be a String

resource[resource_type]
required

Dublin Core Metadata type for this resource

Validations:

  • Must be a String

resource[canonical_id]
required

Unique identifier assigned by the organization that owns this resource

Validations:

  • Must be a String

resource[source_uri]
optional , nil allowed

The canonical location of the resource

Validations:

  • Must be a String

resource[resource_group]
required

Identifies the organizationl resource_group to which this resource belongs

Validations:

  • Must be a String

resource[organization_id]
required

Identifies which organization owns the resource

Validations:

  • Must be a Integer


PATCH /resources/:id
Update attributes of a particular resource

Supported Formats

json