Activate Production Order
This code sample could be a part of a larger integration where another system manages orders activation in the tablet.
Code Snippets
String requestBody = "{
"active": true
}";
HttpClient httpClient = HttpClient.newBuilder();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://api.aps.autodesk.com/fusion-operations/v2/products/" + productId + "/inventory"))
.header("Content-Type", "application/merge-patch+json")
.header("Authorization", "Bearer " + generate3LeggedToken())
.PATCH(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = httpClient.send(request, BodyHandlers.ofString());
if (response.statusCode() == 200) {
System.out.println("The Production Order was activated.");
}
Show More
Example Request
{
"activate": true
}
Example Response
{
"id": 46
"code": "PO-1001",
"startDate": "2024-04-01T10:00:00Z",
"dueDate": "2024-04-15T10:00:00Z",
"predictedDuration": "PT1H40M00S",
"products": [
{
"product": {
"id": 236
"code": "ProductX",
"name": "Product X 100"
},
"quantityOrdered": 1,
"lot": "LOT12345",
"parameters": []
}
],
"description": "Production Order for Product X",
"workerGroups": [
{
"id": 5,
"name": "Worker Group 1"
}
],
"active": true,
"assignedWorkers": [
{
"id": 20,
"name": "Worker 200"
}
],
"machines": [
{
"id": 10,
"code": "MC-100",
"name": "Machine 100"
}
],
"shipping": {
"id": 451,
"code": "Shipping001"
},
"boxQuantity": 4,
"notes": "Ensure quality checks are performed.",
"status": "OPEN",
"parameters": [
{
"id": 67,
"code": "Voltage",
"value": "220V"
}
]
}
Show More
Java, Fusion_Operations_API_V2