Retrieve Product Inventory
This code sample is used to get the Product inventory and print the response to the console if the request was successful.
Code Snippets
String productId = "1298123";
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/json")
.header("Authorization", "Bearer " + generate3LeggedToken())
.GET()
.build();
HttpResponse<String> response = httpClient.send(request, BodyHandlers.ofString());
if (response.statusCode() == 200) {
System.out.println("The response from the inventory endpoint: " + response.body());
}
Show More
Example Response
{
"quantity": 52.6
}
Java, Fusion_Operations_API_V2