Infor Nexus Guide to Consume CubeMaster API

A step-by-step guide to integrate the CubeMaster API (https://api.cubemaster.net/loads) with Infor Nexus using a RESTful POST request.

To use the CubeMaster API, you need an API key (TokenID) for authentication. Here's how to get started:

  1. Visit the CubeMaster website: https://cubemaster.net.
  2. Locate the "Sign In" option (typically found in the top-right corner).
  3. Fill out the registration form with your details (e.g., name, email, password, company information).
  4. After signing up, log in to your account dashboard.
  5. Navigate to the "Settings" - "Integration" section to generate your API key (TokenID).
  6. Generate an API key. Once generated, you’ll receive a unique TokenID (e.g., abc123xyz789). Copy this key and store it securely, as it will be used in the HTTP headers of your API requests.
  7. Copy the TokenID and store it securely.

Note: Keep your TokenID confidential to prevent unauthorized access.

A RESTful API (Representational State Transfer) is a way for software applications to communicate over the internet using standard HTTP methods like GET, POST, PUT, and DELETE. The CubeMaster API is RESTful, meaning it uses these methods to interact with resources (e.g., creating a load).

  • POST Method: Used to send data to the server to create a resource (e.g., a load plan in CubeMaster).
  • Endpoint: A specific URL where the API can be accessed (e.g., https://api.cubemaster.net/loads).
  • JSON: A lightweight data format used to send and receive data, structured as key-value pairs.
  • Headers: Additional metadata sent with the request, such as authentication tokens (e.g., TokenID).

In this guide, you’ll use a POST request to send cargo and container details to CubeMaster and receive a load plan in response.

Infor Nexus can pull order or shipment data stored in your customer's legacy database to prepare the API request. This data includes cargo dimensions, weights, and quantities.

  1. In Infor Nexus, log in to the platform and navigate to the Data Integration module from the left sidebar.
  2. Select Legacy System Connector from the integration options.
  3. Configure the connection by entering the database credentials (e.g., host, port, username, password) for your legacy system.
  4. Use the Query Builder tool to extract relevant fields such as Name, Length, Width, Height, Weight, and Qty from tables like Orders or Shipments.
  5. Map these fields to the CubeMaster API’s Cargoes array structure and save the configuration.

For example, an order for "ITEM001" with 16 units can be transformed into the API’s required JSON format (see Step 5).

The CubeMaster API requires authentication using a TokenID in the request headers. Here’s how to configure it in Infor Nexus:

  1. In Infor Nexus, go to the API Integration section from the main dashboard.
  2. Click New API Connection and select RESTful API.
  3. In the Headers tab, add a new header:
    • Key: TokenID
    • Value: abc123xyz789 (replace abc123xyz789 with your actual TokenID).
  4. Save the configuration. This header will be included in every request to https://api.cubemaster.net/loads.

Use Infor Nexus to construct and send the POST request to https://api.cubemaster.net/loads with the cargo and container data.

  1. In the API Integration section, select your CubeMaster API connection.
  2. Set the Endpoint URL to https://api.cubemaster.net/loads.
  3. Choose POST as the HTTP method from the dropdown.
  4. In the Body tab, select JSON format and paste the following request JSON (adjusted with legacy data):
{
    "Title": "New Mixed Truck Load",
    "Description": "Hello Web API",
    "Cargoes": [
        {
            "Name": "ITEM001",
            "Length": 72,
            "Width": 30,
            "Height": 75,
            "Weight": 1002.45,
            "OrientationsAllowed": "OrientationsAll",
            "TurnAllowedOnFloor": false,
            "Qty": 16,
            "ColorKnownName": "Brown"
        },
        {
            "Name": "ITEM002",
            "Length": 27.31,
            "Width": 37.5,
            "Height": 76.67,
            "Weight": 521.45,
            "OrientationsAllowed": "OrientationsAll",
            "TurnAllowedOnFloor": false,
            "Qty": 28,
            "ColorKnownName": "Aqua"
        },
        {
            "Name": "SKU0005",
            "Length": 27.31,
            "Width": 9.5,
            "Height": 75.67,
            "Weight": 501.45,
            "OrientationsAllowed": "OrientationsAll",
            "TurnAllowedOnFloor": true,
            "Qty": 24,
            "ColorKnownName": "Beige"
        },
        {
            "Name": "SKU0005",
            "Qty": 23
        },
        {
            "Name": "SKU0008",
            "Qty": 34
        }
    ],
    "Containers": [
        {
            "VehicleType": "Dry",
            "Name": "53FT-Intermodal",
            "Length": 630,
            "Width": 98,
            "Height": 106,
            "ColorKnownName": "Blue"
        }
    ],
    "Rules": {
        "IsWeightLimited": true,
        "IsSequenceUsed": false,
        "FillDirection": "FrontToRear",
        "CalculationType": "MixLoad"
    }
}
                        

Click Send Request to submit the data to CubeMaster.

After sending the request, CubeMaster will respond with a JSON object containing the load plan. Infor Nexus can process this response for further use.

  1. In the API Integration section, view the response in the Response tab after sending the request.
  2. Check the status field to confirm success ("succeed"). If it’s not successful, review the message and calculationError for issues (e.g., "InvalidCargoSize").
  3. Extract key data like loadSummary (e.g., cargoesLoaded, volumeUtilization) and filledContainers for visualization or reporting.
  4. Use the Data Mapping tool to save the response data (e.g., graphics.images.path3DDiagram) into Infor Nexus’s Shipment Planning module.

Here’s the sample response JSON:

{
    "status": "succeed",
    "message": "Engine created. 5 cargoes. 1 empty containers. Calculation started. Calculation ended. The load built successfully. The load saved to the cloud database.",
    "calculationError": "InvalidCargoSize",
    "document": {
        "title": "New Mixed Truck Load",
        "description": "Hello Web API",
        "isShared": true,
        "isAutoSaved": true,
        "isPending": false,
        "calculationTimeInSeconds": 0.6152743,
        "processId": "",
        "batchId": "",
        "createdBy": "CHANG@LOGEN.CO.KR",
        "createdAt": "2023-02-11T01:17:01.7392204+09:00",
        "updatedAt": "0001-01-01T00:00:00"
    },
    "loadSummary": {
        "cargoesLoaded": 68,
        "piecesLoaded": 68,
        "cargoesLeft": 0,
        "piecesLeft": 57,
        "unitloadsLoaded": 0,
        "volumeLoaded": 5261723.4606,
        "weightLoaded": 42674.59999999999,
        "priceLoaded": 0,
        "containersLoaded": 1
    },
    "filledContainers": [
        {
            "name": "#1 53FT-Intermodal",
            "sequence": 1,
            "loadSummary": {
                "cargoesLoaded": 68,
                "piecesLoaded": 68,
                "unitloadsLoaded": 0,
                "volumeLoaded": 5261723.4606,
                "volumeUtilization": 80.39990374424703,
                "vollumeUtilizationToLoadHeight": 81.03441853085657,
                "floorLoaded": 57090.75,
                "floorUtilization": 92.46963070942662,
                "weightLoaded": 42674.59999999999,
                "weightTotal": 42674.59999999999,
                "weightUtilization": 0,
                "dimWeight": 39424.33734939759,
                "priceLoaded": 0,
                "pricetUtilization": 0,
                "cargoesPerLayer": 14,
                "layersPerUnitload": 0
            },
            "actualSize": {
                "length": 630,
                "width": 98,
                "height": 106
            },
            "loadSize": {
                "length": 625.6499999999999,
                "width": 97.5,
                "height": 105.17
            },
            "graphics": {
                "images": {
                    "path3DDiagram": "https://api.cubemaster.net/runtimes/b28413ca_51ed_44c9_b92e_13147363fd61.PNG",
                    "pathComposite": "https://api.cubemaster.net/runtimes/7eb09974_2f1d_41bc_9371_2002658dce07.PNG"
                }
            }
        }
    ]
}
                        

Note: The full response is truncated here for brevity; refer to the original document for all details.

Infor Nexus provides tools to monitor and troubleshoot API interactions with CubeMaster.

  1. Go to the API Monitoring section in the Infor Nexus dashboard.
  2. Select your CubeMaster API connection to view a log of recent requests and responses.
  3. Check the Status Code (e.g., 200 for success, 401 for authentication errors) and Response Time for each call.
  4. If an error occurs (e.g., calculationError: "InvalidCargoSize"), use the Debug Console to inspect the request JSON and headers. Adjust cargo dimensions or quantities as needed.
  5. Enable Notifications to receive alerts for failed API calls via email or the Infor Nexus interface.

This ensures smooth integration and quick resolution of issues.