This article explains how to use our REST api to get, update or add data to your datasets schemas.
The Neoforce API allows you to view, add and edit new objects to your datasets schemas.
Getting started
➡️ It is important to get a token first. Check this article to find out how to get a token.
Authentication of API requests is done through a Bearer token. Therefore, please add the following header to every request you send to our API:
X-Authorization: Bearer [your_token]
Endpoint URL
You should send a GET, PUT or POST request to at least the following endpoint address. Depending on the method chosen in the http request, it will be considered whether you want to read, write or add.
Endpoint
https://{your-company-domain}.neoforce.app/?api=datasets&filter[schema]={schema-name}
Getting objects from the API
Send a GET request to the endpoint. It is possible to filter on columns. Add filter[column_name]=your_filter to the URL. This will return all objects that match your filter.
Example: get all inactive laptops from the laptop schema. Use a limit of 10 objects:
https://{your-company-domain}.neoforce.app/?api=datasets&filter[schema]=obj_laptops&filter[active]=0&limit=10
Editing objects via the API
Send a PATCH request to the endpoint. It is important to add a filter to the URL to prevent unnecessary changes to objects. Send the columns that you would like to edit as a JSON array in the body of your request.
Example: update the laptop with objectID 0027 to change the brand to 'Apple':
URL:
https://{your-company-domain}.neoforce.app/?api=datasets&filter[schema]=obj_laptops&filter[objectID]=0021
BODY:
{
"merk": "Apple",
"type": "MacBook Pro 13 inch"
}
Adding objects via the API
Send a POST request to the endpoint. Send the columns that you would like to edit as a JSON array in the body of your request.
Example: Add a new Macbook Pro 13 inch to the schema 'laptops'.
URL:
https://{your-company-domain}.neoforce.app/?api=datasets&filter[schema]=obj_laptops
BODY:
{
"merk": "Apple",
"type": "MacBook Pro 13 inch"
}
How do you know the column names?
When creating a new field, Neoforce assigns column names to the new field. You can find this name when you're editing an existing field.