Method GET
Path /res/{resName}/{resId}
Query Params None required
(optionally use _output=application/json to specify JSON encoding)
Request body None
Response body Results as XML Response.xsd Content-Type: application/xml or application/json

Description

Returns row matching path parameters. Separate compound primary key values by slashes. Empty readResponse document is returned if no rows match criteria.

Results are ordered by the primary key(s), in ascending order. In a hierarchical query, the children are ordered within the parent by the child table's primary key(s).

XML Examples

GET /restsql/res/Actor/123 HTTP/1.1
Accept: applicaton/xml
HTTP/1.1 200 OK
Content-Type: application/xml

<readResponse>
   <actor actor_id="123" first_name="JULIANNE" last_name="DENCH" />
</readResponse>
a hierarchical SQL resource:
GET /restsql/res/ActorFilm/123 HTTP/1.1
Accept: applicaton/xml
HTTP/1.1 200 OK
Content-Type: application/xml

<readResponse>
   <actor actor_id="123" first_name="JULIANNE" last_name="DENCH">
      <film year="2600" title="ADAPTATION HOLES" film_id="3" />
      <film year="2600" title="ATLANTIS CAUSE" film_id="43" />
      <film year="2600" title="BERETS AGENT" film_id="67" />
      <film year="2600" title="BULL SHAWSHANK" film_id="105" />
      <film year="2600" title="CHOCOLATE DUCK" film_id="148" />
   </actor>
</readResponse>

JSON Examples

GET /restsql/res/Actor/123 HTTP/1.1
Accept: applicaton/json
HTTP/1.1 200 OK
Content-Type: application/json

{ "actors": [
      { "id": 123, "first_name": "JULIANNE", "surname": "DENCH" }
   ]
}
a hierarchical SQL resource:
GET /restsql/res/ActorFilm/123 HTTP/1.1
Accept: applicaton/json
HTTP/1.1 200 OK
Content-Type: application/json

{ "actors": [
      { "id": 123, "first_name": "JULIANNE", "surname": "DENCH" },
         "films": [
            { "year": 2006, "title": "ADAPTATION HOLES", "film_id": 3 },
            { "year": 2006, "title": "ATLANTIS CAUSE", "film_id": 43 },
            { "year": 2006, "title": "BERETS AGENT", "film_id": 67 },
            { "year": 2006, "title": "BULL SHAWSHANK", "film_id": 105 },
            { "year": 2006, "title": "CHOCOLATE DUCK", "film_id": 138 },
         ]
      }
   ]
}

Without an Accept header, the output format defaults to application/xml. An alternative to the Accept header is using the _output query parameter with the mime type, as in:

GET /restsql/res/ActorFilm/123?_output=application/json HTTP/1.1
will return JSON output. See Media Types for more discussion.