Sample Requests



This example below shows how to create an asset and its dependent/needed objects through the API.
These operations can be done either with the API documentation (for single requests) on Swagger or other API development tools for script automation, as e.g. Postman.



1. Creating a new Manufacturer/Company


using only mandatory attributes

Method POST companies

{
  "name": "Grundfos",
  "tenant": {
    "id": 5703
  }
}    

Please note : you need to use your own tenant ID which you can obtain with the method GET tenants


Response body :

{
  "id": 15919,
  "name": "Grundfos",
  "tenant": {
    "id": 5703,
    "href": ""https://api.netilion.endress.com/v1/tenants/5703"
  },
  "products": [
    {
      "id": 53282,
      "href": ""https://api.netilion.endress.com/v1/products/53282"
    }
  ]
}

You can now use the generated ID to proceed, creating a product.


2. Creating a new Product (from the previously created manufacturer)


using mandatory and optional attributes

Method POST Products

{
  "name": "Actuator",
  "product_code": "091-904",
  "manufacturer": {
    "id": 15919
  },
  "status": {
    "id": 2
  },
  "tenant": {
    "id": 5703
  }
}

Please note : you need to specify a product status (undefined, available...) which you can obtain with the method GET /product/statuses


Response body :

{
  "id": 53283,
  "product_code": "091-904",
  "name": "Actuator",
  "status": {
    "id": 2,
    "href": ""https://api.netilion.endress.com/v1/products/53283/status"
  },
  "manufacturer": {
    "id": 15919,
    "href": ""https://api.netilion.endress.com/v1/companies/15919"
  },
  "tenant": {
    "id": 5703,
    "href": ""https://api.netilion.endress.com/v1/tenants/5703"
  },
  "links": {
    "categories": {
      "href": ""https://api.netilion.endress.com/v1/products/53283/categories"
    },
    "documents": {
      "href": ""https://api.netilion.endress.com/v1/products/53283/documents"
    },
    "quotations": {
      "href": ""https://api.netilion.endress.com/v1/products/53283/quotations"
    },
    "purchase_orders": {
      "href": ""https://api.netilion.endress.com/v1/products/53283/purchase_orders"
    },
    "pictures": {
      "href": ""https://api.netilion.endress.com/v1/products/53283/pictures"
    },
    "specifications": {
      "href": ""https://api.netilion.endress.com/v1/products/53283/specifications"
    }
  }
}




3. Creating a new Asset (from the previously created product)


using only mandatory attributes

Method POST Assets

{
  "serial_number": "9384382",
  "production_date": "2012-01-25",
  "status": {
    "id": 2
  },
  "product": {
    "id": 53283
  },
  "tenant": {
    "id": 5703
  }
    }

Please note : you need to specify an assset status (undefined, active...) which you can obtain or define yourself with the method GET or POST /asset/statuses


Response body :

{
  "id": 589480,
  "serial_number": "9384382",
  "production_date": "2012-01-25",
  "status": {
    "id": 2,
    "href": ""https://api.netilion.endress.com/v1/assets/589480/status"
  },
  "product": {
    "id": 53283,
    "href": ""https://api.netilion.endress.com/v1/products/53283"
  },
  "tenant": {
    "id": 5703,
    "href": ""https://api.netilion.endress.com/v1/tenants/5703"
  },
  "links": {
    "documents": {
      "href": ""https://api.netilion.endress.com/v1/assets/589480/documents"
    },
    "events": {
      "href": ""https://api.netilion.endress.com/v1/assets/589480/events"
    },
    "instrumentations": {
      "href": ""https://api.netilion.endress.com/v1/assets/589480/instrumentations"
    },
    "nodes": {
      "href": ""https://api.netilion.endress.com/v1/assets/589480/nodes"
    },
    "specifications": {
      "href": ""https://api.netilion.endress.com/v1/assets/589480/specifications"
    },
    "pictures": {
      "href": ""https://api.netilion.endress.com/v1/assets/589480/pictures"
    }
  }
}