Records
The records route provides a flexible and powerful way to create, retrieve, update, and delete records within your app. The route is designed to be resource-oriented and follows standard HTTP verbs.
Create a new record in a collection
ID of the collection to create the record in
JSON object data to store in the record
{"users":[{"id":1,"email":"[email protected]"}]}
Whether to include metadata in the response
true
Record created successfully
Unauthorized
Insufficient credit or access denied
Collection not found
POST /v2/records HTTP/1.1
Host: api.myjson.online
x-collection-access-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 131
{
"collectionId": "556aaefb-7009-4c16-84de-aa89740131f1",
"data": {
"users": [
{
"id": 1,
"email": "[email protected]"
}
]
},
"metadata": true
}
{
"data": {
"users": [
{
"id": 1,
"email": "[email protected]"
}
]
},
"version": 1,
"id": "123e4567-e89b-12d3-a456-426614174000"
}
Retrieve a record by its ID
Unique identifier of the record
Whether to include metadata in the response
true
Specific version of the record to retrieve
Record retrieved successfully
Unauthorized
Insufficient credit or access denied
Record not found
GET /v2/records/{recordId} HTTP/1.1
Host: api.myjson.online
x-collection-access-token: YOUR_API_KEY
Accept: */*
{
"data": {
"users": [
{
"id": 1,
"email": "[email protected]"
}
]
},
"version": 1,
"id": "123e4567-e89b-12d3-a456-426614174000"
}
Update an existing record
Unique identifier of the record
JSON object data to store in the record
{"users":[{"id":2,"email":"[email protected]"}]}
Whether to include metadata in the response
Record created/updated successfully
Unauthorized
Insufficient credit or access denied
PUT /v2/records/{recordId} HTTP/1.1
Host: api.myjson.online
x-collection-access-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 77
{
"data": {
"users": [
{
"id": 2,
"email": "[email protected]"
}
]
},
"metadata": true
}
{
"data": {
"users": [
{
"id": 1,
"email": "[email protected]"
}
]
},
"version": 1,
"id": "123e4567-e89b-12d3-a456-426614174000"
}
Remove a record permanently
Unique identifier of the record
Record deleted successfully
No content
Unauthorized
Insufficient credit or access denied
Record not found
DELETE /v2/records/{recordId} HTTP/1.1
Host: api.myjson.online
x-collection-access-token: YOUR_API_KEY
Accept: */*
No content
Update specific fields of an existing record
Unique identifier of the record
JSON object data to update in the record
{"users":[{"id":1,"email":"[email protected]","firstName":"Charles"}]}
Whether to include metadata in the response
Record updated successfully
Unauthorized
Insufficient credit or access denied
PATCH /v2/records/{recordId} HTTP/1.1
Host: api.myjson.online
x-collection-access-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 100
{
"data": {
"users": [
{
"id": 1,
"email": "[email protected]",
"firstName": "Charles"
}
]
},
"metadata": false
}
{
"data": {
"users": [
{
"id": 1,
"email": "[email protected]"
}
]
},
"version": 1,
"id": "123e4567-e89b-12d3-a456-426614174000"
}
Last updated
Was this helpful?