About the API - ChrisMavrommatis/Binacle.Net GitHub Wiki
Contents
Binacle.Net offers two versions of its API, each tailored to different needs.
Version 1
Version 1 focuses exclusively on the Fitting function, with the goal of finding the smallest bin that can accommodate all of the items.
-
Presets: Returns a list of all available presets, which are predefined collections of bins.
-
Query by Preset: Lets you send only the items and the preset key. The API will return the smallest bin from the specified preset that can accommodate all items, if such a bin exists.
-
Query by Custom: Allows you to send both the bins and items in a single request. The API will return the smallest bin that that can accommodate all items, if such a bin exists.
Version 2
Version 2 expands on the capabilities of Version 1 by offering both the Fitting and Packing Functions. Unlike Version 1, it doesn't focus solely on finding the smallest bin but returns results for all bins.
-
Presets: Lists all available presets, which are predefined collections of bins.
-
Fit By Preset: Send only the items and the preset key. The API performs the Fitting function and returns results for each bin in the preset, specifying which bins can accommodate all the items.
-
Fit By Custom: This endpoint allows you to submit both the bins and items in a single request. The API performs the Fitting function, providing results for each bin in the request and indicating which can accommodate all the items.
-
Pack By Preset: Send only the items and the preset key. The API executes the Packing function and returns results for each bin from the preset, including the specific locations for each item.
-
Pack By Custom: This endpoint enables you to send both bins and items in one request. The API carries out the Packing function, returning results for each bin in the request, along with the positions for each item.
Fitting Parameters
Both Fitting endpoints support the following parameters, which are disabled by default:
- Report Fitted Items: Indicates whether to return details of the items that fit within the bins.
- Report Unfitted Items: Specifies whether to include information about items that could not be accommodated.
- Find Smallest Bin Only: Restricts the response to only the smallest bin that can hold all items.
Packing Parameters
Both Packing endpoints accept the following parameters, which are disabled by default:
- Opt In To Early Fails: Allows the process to terminate early if it determines that not all items can be packed.
- Report Packed Items Only When Fully Packed: Ensures that packed items are reported only when all items fit completely.
- Never Report Unpacked Items: Excludes any information about items that remain unpacked in the response.
- Stop At Smallest Bin: Stops the packing process once the smallest bin is found.