Create Component API
Create a new component in the catalog.
HTTP Method / Path: POST /configwise/api/components
Authorization: Request must include 'x-token' header, eg: 'x-token': '755c0fadf29146c3b65778528a3abb12' See Setup API token to generate or retrieve the API token defined in the ConfigWise Portal.
Required HTTP headers:
x-token: YOUR_API_TOKEN
Content-Type: application/json
Accept: application/json
Request body:
{ (required) "productNumber": "PR-01004", (required) "name": "MyProduct", (optional, null by default) "appName": "MyProduct (app)", (optional, false by default) "isFloating": false, (optional, null by default) "description": "Description of MyProduct", (optional, null by default) "productLink": "https://my.store.com/product/PR-01004", (optional, null by default) "parentProductNumber": "PR-01001" }
NOTICE: 'parentProductNumber' field is used to configure variances of created components (products). If this field exists in the request JSON then created component will be attached as a variance of existing product (which productNumber you set in the 'parentProductNumber' field). If you set there incorrect or non existing productNumber, then such configuration will be ignored.
An example of success response:
201 HTTP response code
{ "id": "x5V6RNtqGO", "productNumber": "PR-01004", "name": "MyProduct", "createdAt": "2019-12-05T11:51:23.571Z", "updatedAt": "2019-12-05T11:51:23.571Z", "isFloating": false, "description": "Description of MyProduct", "isVariance": true, "parentProductNumber": "PR-01001", "published": true, "thumbnail": null, "iosModel": null, "iosModelAssets": [], "androidModel": null, "androidModelAssets": [], "originalModel": null, "originalModelAssets": [], "fileSizes": [], "nodesToTags": [], "tagsToMaterials": [] }
Examples of error responses:
400 HTTP response code (if requested component not found)
{ "error": "'productNumber' must not be blank." }
400 HTTP response code (if requested component not found)
{ "error": "'name' must not be blank." }
409 HTTP response code (if requested component not found)
{ "error": "Component with such 'productNumber' already exists." }
403 HTTP response code (if incorrect 'x-token' header in the response)
{ "error": "Forbidden." }
500 HTTP response code (if server side error occurs)
{ "error": "Internal Server Error" }