Object-Based PUT
The URL should include the object key and a record ID, while the headers will include one for content-type as well as those for authentication.
URL
PUT https://api.knack.com/v1/objects/object_xx/records/record_ID
Parameters
Parameter | Explanation | Example |
---|---|---|
object_xx | object key | object_1 |
record_ID | A record’s ID | 575482d691e16d4235adcdb6 |
Headers
Key | Value |
---|---|
X-Knack-Application-Id | Your application ID |
X-Knack-REST-API-KEY | Your API key |
content-type | application/json |
Example Request
# Update a Company record
curl -X PUT "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" \
-H "Content-Type: application/json" \
-d '{
"field_1":"Updated name",
"field_18":"Other"
}'
Example Response (200 OK)
{
"id": "58643557d1ea9432222f3cbb",
"field_1": "Updated name",
"field_1_raw": "Updated name",
"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": "Other",
"field_18_raw": "Other",
"field_31": "516-334-3077",
"field_31_raw": "516-334-3077"
}
Updated about 4 years ago
What’s Next