Get list of all rows in TABLE_NAME
200: OK Example response 500: Internal Server Error Returns an server error message 403: Forbidden Return an error message related to authentication
Copy {
"data" : [
{
"uid" : "iaijasdiadsi14in" ,
"attributes" : {
"name" : "T-Shirt" ,
"price" : 10 ,
"category" : {
"uid" : "n10234b901489bwduih1dw91" ,
"name" : "clothing"
} ,
"createdAt" : "2022-08-22T16:04:49-04:00" ,
"updatedAt" : "2022-08-22T16:04:51-04:00"
}
}
] ,
"meta" : {
"total" : 1 ,
"page" : 1 ,
"limit" : 1 ,
"includesCount" : 1
}
}
Copy {
"errors" : [
{
"code" : "500" ,
"title" : "Internal Server Error" ,
"detail" : "Error processing your request"
}
]
}
cURL JavaScript - Fetch JavaScript - Axios
Copy curl --location 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}?where=[{%22attribute%22%3A%22sku%22%2C%22operator%22%3A%22%3D%22%2C%22value%22%3A%22Sdu2DTtF4bOlSfYJvC4X%22}]&sorted[param]=name&sorted[how]=desc&page=1&limit=10&includes=[%22orders%22]'
Copy var requestOptions = {
method : 'GET' ,
redirect : 'follow'
};
fetch ( "https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}?where=[{\"attribute\":\"sku\",\"operator\":\"=\",\"value\":\"Sdu2DTtF4bOlSfYJvC4X\"}]&sorted[param]=name&sorted[how]=desc&page=1&limit=10&includes=[\"orders\"]" , requestOptions)
.then (response => response .text ())
.then (result => console .log (result))
.catch (error => console .log ( 'error' , error));
Copy const axios = require ( 'axios' );
let config = {
method : 'get' ,
maxBodyLength : Infinity ,
url : 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}?where=[{"attribute":"sku","operator":"=","value":"Sdu2DTtF4bOlSfYJvC4X"}]&sorted[param]=name&sorted[how]=desc&page=1&limit=10&includes=["orders"]' ,
headers : { }
};
axios .request (config)
.then ((response) => {
console .log ( JSON .stringify ( response .data));
})
.catch ((error) => {
console .log (error);
});
Get row by UID from TABLE_NAME
200: OK Example response 500: Internal Server Error Returns an server error message 403: Forbidden Returns an error message related to authentication 404: Not Found Returns not found error
Copy {
"data" : {
"name" : "T-Shirt" ,
"price" : 10 ,
"category" : {
"uid" : "n10234b901489bwduih1dw91" ,
"name" : "clothing"
} ,
"createdAt" : "2022-08-22T16:04:49-04:00" ,
"updatedAt" : "2022-08-22T16:04:51-04:00"
} ,
"meta" : {
"total" : 1 ,
"page" : 1 ,
"limit" : 1 ,
"includesCount" : 1
}
}
Copy {
"errors" : [
{
"code" : "500" ,
"title" : "Internal Server Error" ,
"detail" : "Error processing your request"
}
]
}
Copy {
"data" : null ,
"errors" : [
{
"code" : "404" ,
"title" : "Not found" ,
"detail" : "Requested object not found"
}
]
}
cURL JavaScript - Fetch JavaScript - Axios
Copy curl --location 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}'
Copy var requestOptions = {
method : 'GET' ,
redirect : 'follow'
};
fetch ( "https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}" , requestOptions)
.then (response => response .text ())
.then (result => console .log (result))
.catch (error => console .log ( 'error' , error));
Copy const axios = require ( 'axios' );
let config = {
method : 'get' ,
maxBodyLength : Infinity ,
url : 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}' ,
headers : { }
};
axios .request (config)
.then ((response) => {
console .log ( JSON .stringify ( response .data));
})
.catch ((error) => {
console .log (error);
});
Create a new row in TABLE_NAME
200: OK Returns the object added to the database 422: Unprocessable Entity Returns an error message of what went wrong 500: Internal Server Error Returns an server error message 403: Forbidden Return an error message related to authentication
Copy {
"data" : {
"uid" : "tTvKpi6E7N68Xv8RJOug"
"name" : "Hat" ,
"price" : 12 ,
"image" : "" ,
"createdAt" : "2022-08-22T16:04:49-04:00" ,
"updatedAt" : "2022-08-22T16:04:51-04:00"
} ,
"meta" : {
"total" : 1 ,
"page" : 1 ,
"limit" : 1 ,
"includesCount" : 0
} ,
"info" : {
"action" : "post" ,
"webhooksTriggered" : 0
}
}
Copy {
"errors" : [
{
"propertyErrors" : [] ,
"typeErrors" : [] ,
"propertyMissingErrors" : [
{
"code" : "422" ,
"title" : "Unprocessable Entry" ,
"detail" : "Required property name from the 'products' database table is missing"
}
]
}
]
}
Copy {
"errors" : [
{
"code" : "500" ,
"title" : "Internal Server Error" ,
"detail" : "Error processing your request"
}
]
}
cURL JavaScript - Fetch JavaScript - Axios
Copy curl --location 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}' \
--header 'Content-Type: application/json' \
--data '{
"name": "string"
}'
Copy var myHeaders = new Headers ();
myHeaders .append ( "Content-Type" , "application/json" );
var raw = JSON .stringify ({
"name" : "string"
});
var requestOptions = {
method : 'POST' ,
headers : myHeaders ,
body : raw ,
redirect : 'follow'
};
fetch ( "https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}" , requestOptions)
.then (response => response .text ())
.then (result => console .log (result))
.catch (error => console .log ( 'error' , error));
Copy const axios = require ( 'axios' );
let data = JSON .stringify ({
"name" : "string"
});
let config = {
method : 'post' ,
maxBodyLength : Infinity ,
url : 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}' ,
headers : {
'Content-Type' : 'application/json'
} ,
data : data
};
axios .request (config)
.then ((response) => {
console .log ( JSON .stringify ( response .data));
})
.catch ((error) => {
console .log (error);
});
Update row by UID in TABLE_NAME
200: OK Returns the object updated to the database 422: Unprocessable Entity Returns an error message of what went wrong 500: Internal Server Error Returns an server error message 403: Forbidden Returns an error message related to authentication 404: Not Found Returns not found error
Copy {
"data" : {
"uid" : "tTvKpi6E7N68Xv8RJOug"
"name" : "Hat" ,
"price" : 12 ,
"image" : "" ,
"createdAt" : "2022-08-22T16:04:49-04:00" ,
"updatedAt" : "2022-08-22T16:04:51-04:00"
} ,
"meta" : {
"total" : 1 ,
"page" : 1 ,
"limit" : 1 ,
"includesCount" : 0
} ,
"info" : {
"action" : "patch" ,
"webhooksTriggered" : 0
}
}
Copy {
"errors" : [
{
"propertyErrors" : [] ,
"typeErrors" : [] ,
"propertyMissingErrors" : [
{
"code" : "422" ,
"title" : "Unprocessable Entry" ,
"detail" : "Required property name from the 'products' database table is missing"
}
]
}
]
}
Copy {
"errors" : [
{
"code" : "500" ,
"title" : "Internal Server Error" ,
"detail" : "Error processing your request"
}
]
}
Copy {
"data" : null ,
"errors" : [
{
"code" : "404" ,
"title" : "Not found" ,
"detail" : "Requested object not found"
}
]
}
cURL JavaScript - Fetch JavaScript - Axios
Copy curl --location --request PATCH 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}' \
--header 'Content-Type: application/json' \
--data '{
"name": "name"
}'
Copy var myHeaders = new Headers ();
myHeaders .append ( "Content-Type" , "application/json" );
var raw = JSON .stringify ({
"name" : "name"
});
var requestOptions = {
method : 'PATCH' ,
headers : myHeaders ,
body : raw ,
redirect : 'follow'
};
fetch ( "https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}" , requestOptions)
.then (response => response .text ())
.then (result => console .log (result))
.catch (error => console .log ( 'error' , error));
Copy const axios = require ( 'axios' );
let data = JSON .stringify ({
"name" : "name"
});
let config = {
method : 'patch' ,
maxBodyLength : Infinity ,
url : 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}' ,
headers : {
'Content-Type' : 'application/json'
} ,
data : data
};
axios .request (config)
.then ((response) => {
console .log ( JSON .stringify ( response .data));
})
.catch ((error) => {
console .log (error);
});
Delete row by UID in TABLE_NAME
Delete an object in the database. Note: If you delete an object the associated file will automatically be deleted in storage as well.
200: OK Returns data object with the uid and the location of the deleted object 500: Internal Server Error Returns an server error message 403: Forbidden Returns an error message related to authentication 404: Not Found Returns not found error
Copy {
"data" : {
"uid" : "E9s6pTHnFdzilQ6rTD3Z" ,
"resource" : "tests"
} ,
"meta" : {} ,
"info" : {
"action" : "delete" ,
"webhooksTriggered" : 0
}
}
Copy {
"errors" : [
{
"code" : "500" ,
"title" : "Internal Server Error" ,
"detail" : "Error processing your request"
}
]
}
Copy {
"data" : null ,
"errors" : [
{
"code" : "404" ,
"title" : "Not found" ,
"detail" : "Requested object not found"
}
]
}
cURL JavaScript - Fetch JavaScript - Axios
Copy curl --location --request DELETE 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}'
Copy var requestOptions = {
method : 'DELETE' ,
redirect : 'follow'
};
fetch ( "https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}" , requestOptions)
.then (response => response .text ())
.then (result => console .log (result))
.catch (error => console .log ( 'error' , error));
Copy const axios = require ( 'axios' );
let config = {
method : 'delete' ,
maxBodyLength : Infinity ,
url : 'https://${project_id}.api.deskree.com/api/v1/rest/collections/${table_name}/${row_uid}' ,
headers : { }
};
axios .request (config)
.then ((response) => {
console .log ( JSON .stringify ( response .data));
})
.catch ((error) => {
console .log (error);
});
Database Object Parameters
POST, PATCH, and DELETE Response Structure