Code Examples
Here you find examples of your first simple interactions with the API. By following the steps you see exactly how to build up your own data in Netilion.
You can use the interactive API documentation with your technical user credentials to run these commands at first. Once your application is ready and authorized it can run these direclty to the API.
These examples show you how to use the tenant as a tool to create your own masterdata and use it then with an asset.
If you have already created some data on our official Netilion Service Apps you might have already a tenant. You can retrieve your tenants by running:
In case you have none, go ahead and create a tenant.
Create your tenant
Request body:
Create a company / manufacturer
Request body:
There are more attributes available. The example contains the minimum. To create your own record of a company, you need to add your own tenant in the request.
Response body :
You can now use the company id to proceed, creating a product. Note, that there was a default product generated automatically. This is the “unknown product”. Its a placeholder, as all companies need to have at least a product in the system.
Create a product
There are more attributes available. The example contains the minimum. To create your own product, you need to add your own tenant in the request as well as the company you created within that tenant.
You need to specify a product status (undefined
, available
, etc.).
You can get a list of options as follows and add a product status id in the request.
Response body :
Create an asset
Request body:
There are more attributes available. The example contains the minimum. To create an asset of your own product, you need to add your tenant in the request as well as the product you created within that tenant.
You need to specify an asset status (undefined
, active
etc.).
Get a list of options as follows and add an asset status id in the request.
Response body:
Create an asset status
In case your desired asset status is not available among the default entries, you can create it. Use your tenant in the request.
Request body:
The code serves to identify and optionally add translations to the record. Learn more in the internationalisation section about translations.
Create a node
Request body:
You need to specify an node type (location, site etc.).
You need to specify an node type (location
, site
etc.).
Get a list of options as follows and add a node type id in the request.
Create a nested node
Request body:
Add the id of the first node you have created as parent_id
in the body of the second request to create a hierarchy.
You need to stay consistent on the node type when nesting nodes.
Create an asset-instrumentation assignment
Once you have an asset and an instrumentation, the association is possible from both sides.
Request body:
one or many instrumentations can be added in a comma separated list of objects. Alternatively you can use the instrumentation as fixed point and add assets to it:
Request body:
The same structure applies for node instrumentation assignment.
See the API documentation for all endpoints in detail.