sandbox.api.opticutter.com
api.opticutter.com
/linear
for access to linear solver/panel
for access to panel/sheet solver/status
for access to account status information/v1/
). With the new features, we'll release a new version of the API, but the previous versions will remain intact, so our customers don't have to upgrade their clients to the new version, if they want to stay with the older version.https://api.opticutter.com/v1/linear
production API call version 1 to linear solver endpointhttps://sandbox.api.opticutter.com/v1/linear
development API call version 1 to linear solver endpointhttps://sandbox.api.opticutter.com/v1/status
development API call version 1 to account status endpoint"Content-type: application/json"
HTTP header.
Authorization
which contains bearer authorization token.curl -H "Content-type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-X POST http://sandbox.api.opticutter.com/v1/status
<TOKEN>
placeholder.
curl -H "Content-type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-X POST http://sandbox.api.opticutter.com/v1/status
{
"message": "OK",
"remaining": 0
}
Because API call used development environment (sandbox.api.opticutter.com
) the JSON response contains "remaining":0
as how many API calls remains for this biling period. If you used production environment (api.opticutter.com
), the response would contain the actual number of calls remaining.
stocks
, array of requirements
and a single settings
object and it's structure is very similar to the form used in our online application.stocks array, required |
Array of all available stocks. Every child object contains two fields: length and count .
|
||||||
---|---|---|---|---|---|---|---|
requirements array, required |
Array of all required parts. Every child object must contain two mandatory fields length , count and can contain one optional field label .
|
||||||
settings object, optional |
Can contain fields: kerf , leftTrim , rightTrim .
|
||||||
layoutImages string, optional |
Flag indicates if layout images in SVG format (base64 encoded) are required in response object. Default value is empty (no images in response). Allowed value is y .
|
curl -H "Content-type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-X POST -d '{
"stocks" : [{
"length" : "300",
"count": 10
}],
"requirements" : [{
"length" : "100",
"count": 4
},
{
"length" : "40",
"count": 3
}],
"settings": {
"kerf": "1"
}
}' https://api.opticutter.com/v1/linear
solution
object, which contains three inner child elements: totalRequiredStocks
field, array of requiredStocks
and array of layouts
objects. Again, solution
object is very similar to linear cutting plan solution from our online application. Take a short look at the linear cutting plan results in online application first to understand it's concept.solution
wrapper object.totalRequiredStocks integer, required |
Total sum of all required stocks. | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
requiredStocks array, required |
Array of all required stocks and it's counts. Every child object contains three fields: index , length and count .
|
||||||||||||||||||||||||||||
layouts array, required |
Array of all cut layouts. Every child object contains four objects: count field, stock object, parts array and waste object.
|
{
"solution": {
"totalRequiredStocks": 2,
"requiredStocks": [
{
"index": 0,
"length": "300",
"count": 2
}
],
"layouts": [
{
"count": 1,
"stock": {
"index": 0,
"length": "300"
},
"parts": [
{
"index": 0,
"length": "100",
"count": 2
},
{
"index": 1,
"length": "40",
"count": 2
}
],
"waste": {
"cut": "4",
"material": "16"
},
"cuts": {
"count": 4
}
},
{
"count": 1,
"stock": {
"index": 0,
"length": "300"
},
"parts": [
{
"index": 0,
"length": "100",
"count": 2
},
{
"index": 1,
"length": "40",
"count": 1
}
],
"waste": {
"cut": "3",
"material": "57"
},
"cuts": {
"count": 3
}
}
]
}
}
stocks
, array of requirements
and a single settings
object and it's structure is very similar to the form used in our online application.stocks array, required |
Array of all available stocks. Every child object contains three fields: length , width , count and grainDirection .
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
requirements array, required |
Array of all required panels. Every child object contains four mandatory fields length , width , count , grainDirection and can contain one optional field label .
|
||||||||||
settings object, optional |
Can contain fields: kerf , leftTrim , rightTrim , topTrim and bottomTrim .
|
||||||||||
layoutImages string, optional |
Flag indicates if layout images in SVG format (base64 encoded) are required in response object. Default value is empty (no images in response). Allowed value is y .
|
curl -H "Content-type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-X POST -d '{
"stocks" : [{
"length" : "60",
"width" : "40",
"count": "10",
"grainDirection": null
},{
"length" : "40",
"width" : "35",
"grainDirection": null
}],
"requirements" : [{
"length" : "30",
"width" : "20",
"count": "8",
"grainDirection": null
},
{
"width" : "20",
"length" : "20",
"count": "3",
"grainDirection": null
}],
"settings" : {
"kerf": "0"
}
}' https://api.opticutter.com/v1/panel
solution
object, which contains three inner child elements: totalRequiredStocks
field, array of requiredStocks
and array of layouts
objects. Again, solution
object is very similar to sheet/panel cutting plan solution from our online application. Take a short look at the sheet cutting plan results in online application first to understand it's concept.solution
wrapper object.totalRequiredStocks integer, required |
Total sum of all required stocks. | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
requiredStocks array, required |
Array of all required stocks and it's counts. Every child object contains four fields: index , length , width and count .
|
||||||||||||||||||||||||||||||||||||||||||
layouts array, required |
Array of all cut layouts. Every child object contains four objects: count field, stock object, panels array and remainders object.
|
{
"solution": {
"totalRequiredStocks": 4,
"requiredStocks": [
{
"index": 0,
"length": "60",
"width": "40",
"count": 1
},
{
"index": 1,
"length": "40",
"width": "35",
"count": 3
}
],
"layouts": [
{
"count": 1,
"stock": {
"index": 0,
"length": "60",
"width": "40"
},
"panels": [
{
"index": 1,
"length": "20",
"width": "20",
"x": "0",
"y": "0"
},
{
"index": 0,
"length": "30",
"width": "20",
"x": "0",
"y": "20"
},
{
"index": 0,
"length": "30",
"width": "20",
"x": "30",
"y": "20"
},
{
"index": 1,
"length": "20",
"width": "20",
"x": "20",
"y": "0"
},
{
"index": 1,
"length": "20",
"width": "20",
"x": "40",
"y": "0"
}
],
"remainders": null,
"cuts": {
"count": 4,
"length": "120"
}
},
{
"count": 3,
"stock": {
"index": 1,
"length": "40",
"width": "35"
},
"panels": [
{
"index": 0,
"length": "20",
"width": "30",
"x": "0",
"y": "0"
},
{
"index": 0,
"length": "20",
"width": "30",
"x": "20",
"y": "0"
}
],
"remainders": [
{
"length": "40",
"width": "5",
"x": "0",
"y": "30"
}
],
"cuts": {
"count": 2,
"length": "70"
}
}
]
}
}
curl -H "Content-type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-X POST http://api.opticutter.com/v1/status
{
"message": "OK",
"remaining": 4959
}
remaining
contains info, how many API calls remains for this biling period. The same info is available also in API status section in online application.source
(when not null) contains detailed information which JSON element contains invalid data.{
"errors": [
{
"status": "401",
"source": null,
"title": "Unauthorized",
"detail": "Authorization header is missing or invalid."
}
]
}
{
"errors": [
{
"status": "422",
"source": {
"pointer": "settings.kerf"
},
"title": "Validation failed",
"detail": "Invalid decimal or fractional number"
}
]
}
{
"errors": [
{
"status": "422",
"source": {
"pointer": "stocks[0].length"
},
"title": "Validation failed",
"detail": "Must not be blank."
}
]
}
{
"errors": [
{
"status": "422",
"source": {
"pointer": "stocks"
},
"title": "Validation failed",
"detail": "Lack of stocks! Please add more stock's quantity or leave at least one stock quantity field blank."
}
]
}
{
"errors": [
{
"status": "500",
"source": null,
"title": "Internal Server Error",
"detail": "Identifier: 1643996842483"
}
]
}