Retrieving One Record

You can retrieve a specific record by making a GET request with the record's ID appended to an appropriate view- or object-based base URL.

Retrieving One Record: Object-Based GET

URL
GET https://api.knack.com/v1/objects/object_xx/records/record_ID

Parameters

ParameterExplanationExample
object_xxobject keyobject_1
record_IDA record’s ID575482d691e16d4235adcdb6

Headers

KeyValue
X-Knack-Application-IdYour application ID
X-Knack-REST-API-KEYYour API key

Example Request

curl -X GET "https://api.knack.com/v1/objects/object_1/records/58643557d1ea9432222f3cbb" \
  -H "X-Knack-Application-Id: YOUR-APP-ID" \
  -H "X-Knack-REST-API-Key: YOUR-API-KEY"

Example Response (200 OK)

{
  "id": "58643557d1ea9432222f3cbb",
  "field_1": "Pearl Architectural Design",
  "field_1_raw": "Pearl Architectural Design",
  "field_16": "4913 Gnatty Creek Road
Westbury, NY 11590",
  "field_16_raw": {
    "street": "4913 Gnatty Creek Road",
    "city": "Westbury",
    "state": "NY",
    "zip": "11590",
    "latitude": 40.89964,
    "longitude": -73.601586
  },
  "field_17": "<a href=\"http://www.pearlinc.com\" target=\"_blank\">http://www.pearlinc.com</a>",
  "field_17_raw": {
    "url": "http://www.pearlinc.com"
  },
  "field_18": "Services",
  "field_18_raw": "Services",
  "field_31": "516-334-3077",
  "field_31_raw": "516-334-3077"
}

Retrieving One Record: View-Based GET

Once you’ve created a record, you can retrieve it by making a GET request to the route of any view which displays it and appending the ID to that route. These views include:

  • Tables
  • Lists
  • Searches
  • Calendars
  • Details views
  • Edit forms

Note that the only fields included in the response will be those included in the view specified in your URL, and that the view's data source will impact the records which your requests retrieve.

URL
GET https://api.knack.com/v1/pages/scene_xx/views/view_yy/records/record_ID

Parameters

ParameterExplanationExample
scene_xxpage keyscene_3
view_yyview keyview_5
record_IDa record's ID575482d691e16d4235adcdb6

Headers

KeyValue
X-Knack-Application-IdYour application ID
X-Knack-REST-API-KEYknack
AuthorizationA user token valid for the view (if view is nested under a login)

Example Request

curl -X GET "https://api.knack.com/v1/pages/scene_10/views/view_9/records/58643557d1ea9432222f3cb5" \
  -H "X-Knack-Application-Id: YOUR-APP-ID" \
  -H "X-Knack-REST-API-Key: knack"

Example Response (200 OK)

{
  "id": "58643557d1ea9432222f3cb5",
  "field_1": "BASCO",
  "field_1_raw": "BASCO",
  "field_16": "4295 Drainer Avenue<br />Tallahassee, FL 32304",
  "field_16_raw": {
    "longitude": -84.177903,
    "latitude": 30.463511,
    "zip": "32304",
    "state": "FL",
    "city": "Tallahassee",
    "street2": "",
    "street": "4295 Drainer Avenue"
  },
  "field_18": "Entertainment",
  "field_18_raw": "Entertainment",
  "field_17": "<a href=\"http://www.basco.com\" target=\"_blank\">http://www.basco.com</a>",
  "field_17_raw": {
    "url": "http://www.basco.com"
  },
  "field_31": "850-644-1128",
  "field_31_raw": "850-644-1128"
}

Retrieving records from views that are under a Details/Child page

If your view is under a Child page, the URL is a bit different than that for a Main page. Here is the general form of the Url: https://api.knack.com/v1/scenes/scene_XX/views/view_YY/records?page-slug_id=record_id

Parameters:

ParameterExplanationExample
scene_xxpage keyscene_3
view_yyview keyview_5
page-slugPage-URL of the Child Pagehome-page
record_IDa record's ID575482d691e16d4235adcdb6

Headers

KeyValue
X-Knack-Application-IdYour application ID
X-Knack-REST-API-KEYknack
AuthorizationA user token valid for the view (if view is nested under a login

Example Request

curl -X GET "https://api.knack.com/v1/pages/scene_10/views/view_9/records/58643557d1ea9432222f3cb5" \
  -H "X-Knack-Application-Id: YOUR-APP-ID" \
  -H "X-Knack-REST-API-Key: knack"

What’s Next