Available resources

About

This application will give you a set of Collection+JSON resources useful for creating Collection+JSON-related tools. It is developed in combination with the Collection+JSON Explorer.

Explore

To explore the data, queries and templates available you can either use the online explorer, command line tools like curl or wget or any other HTTP client.

Note that unless you explicitly request text/html you will be served application/vnd.collection+json if you include */* in your Accept header. If you request only unsupported types, you'll get a 406.

Exploring with curl

These examples use a Python tool to format the json as the server serves compacted JSON. If you want to see the headers served, add -D /dev/stderr and you'll get the headers too.

Start by fetching the root document:

$ curl -s http://employee.herokuapp.com/ | python -mjson.tool
{
    "collection": {
        "items": [], 
        "links": [
            {
                "href": "http://employee.herokuapp.com/department/", 
                "prompt": "Department List", 
                "rel": "departments"
            }, 
            {
                "href": "http://employee.herokuapp.com/employee/", 
                "prompt": "Employee List", 
                "rel": "employees"
            }
        ], 
        "queries": [], 
        "templates": [], 
        "version": "1.0"
    }
}

This will show all available root resources. Navigate to the department list:

$ curl -s http://employee.herokuapp.com/department/ | python -mjson.tool
{
  "collection": {
      "href": "http://employee.herokuapp.com/department/", 
      "items": [
          {
              "data": [
                  {
                      "name": "dept_no", 
                      "value": "d001"
                  }, 
                  {
                      "name": "dept_name", 
                      "value": "Marketing"
                  }
              ], 
              "href": "http://employee.herokuapp.com/department/d001", 
              "links": []
          }, 
          ...
      ], 
      "links": [], 
      "queries": [], 
      "templates": [], 
      "version": "1.0"
  }
}

etc..