Documentation

La documentation ci-dessous présente des informations sur la manière de se connecter au back-end et au front-end de l’application. Afin de se connecter au back-end de l’application, il faut saisir un jeton. L’intégration avec le front-end ne nécessite pas de jeton

Remplissez le formulaire pour recevoir la clé d’activation:

  • Documentation back-end
  • Documentation front-end

Documentation back-end

Beta version

Endpoint

https://app.goodloading.com/api/external/calculation

POST /calculation

Request Headers

Name Value Mandatory Description
Authorization Bearer <token> Yes Authorisation key

Request Body

Field Type Mandatory Value
loads array Yes Loads board
load.quantity integer Yes Loads quantity. Must be an integer greater than 0.
load.name string Yes Load name
load.length number Yes One load length. Must be greater than 0.
load.width number Yes One load width. Must be greater than 0.
load.height number Yes One load height. Must be greater than 0.
load.weight number Yes One load weight. Must be greater than or equal to 0.
load.priority integer Yes Load priority. The value must be an integer greater than or equal to 0. Default value: 0.
load.stacking boolean / integer Yes Load stacking. The false value means that it is nonstackable, the true value means that it is stackable. Indicating an integer greater than 0 means that the load is stackable with a limited number of stacks. Default value: true.
load.allowToRotate boolean Yes Assumes true or false. Setting the value as true allows for replacing the width with the length while calculating, i.e. it allows for rotating the load relative to the base. Default value true.
loadingSpaces array Yes Load space board
loadingSpace.
quantity
integer Yes Load space quantity. Must be an integer greater than 0.
loadingSpace.name string Yes Load space name.
loadingSpace.type string No Load space type. One of the three values may be set:

– vehicle.
– container.
– other.

The other value is set by default.

loadingSpace.parts array Yes Load space parts board. E.g. a set will have two parts
loadingSpace.part.
length
number Yes Load space part length. Must be greater than 0.
loadingSpace.part.
width
number Yes Load space part width. Must be greater than 0.
loadingSpace.part.
height
number Yes Load space part height. Must be greater than 0.
loadingSpace.part.
limit
number Yes Load space part load capacity. Must be greater than or equal to 0.
loadinSpace.part.
axis
array No Load space axles board. If indicated, it must include exactly two elements.
loadingSpace.part.
axi.distanceFromSpaceFront
number Yes Axle distance from the beginning of the load space.
loadingSpace.part.
axi.emptySpaceLoad
number Yes Axle load with an empty load space. The value must be a number greater than or equal to 0.
loadingSpace.part.
axi.maxLoad
number Yes The highest permissible axle load. The value must be a number greater than or equal to 0.
options json Yes Calculation options
options.allowOverweight boolean No Setting the value as true will result in not distributing the loads in the load space if the weight exceeds the permissible load capacity. Default value: false.
options.unit string No Units of the indicated dimensions. One of the two values may be set:

– cm
– lb

Default value: “cm”

options.keepLoadsTogether boolean No Setting the value as true will result in distributing the loads from a given group together. Default value: false
Inquiry example
{
  "loads": [
      {
          "quantity": 10,
          "name": "test load 1",
          "length": 120,
          "width": 80,
          "height": 100,
          "weight": 100,
          "priority": 0,
          "stacking": true,
          "allowToRotate": true
      },{
          "quantity": 300,
          "name": "test load 2",
          "length": 100,
          "width": 60,
          "height": 20,
          "weight": 100,
          "priority": 0,
          "stacking": 2,
          "allowToRotate": true
      }
  ],
  "loadingSpaces": [
      {
          "quantity": 1,
          "name": "test truck",
          "parts": [
              {
                  "length": 1300,
                  "width": 200,
                  "height": 200,
                  "limit": 24000,
                  "axis": [
                      {
                          "distanceFromSpaceFront": -200,
                          "emptySpaceLoad": 800,
                          "maxLoad": 10000
                      },
                      {
                          "distanceFromSpaceFront": 1000,
                          "emptySpaceLoad": 800,
                          "maxLoad": 10000
                      }
                  ]
              }
          ],
          "type": "vehicle"
      }
  ],
  "options": {
      "allowOverweight": false,
      "unit": "cm",
      "keepLoadsTogether": false
  }
}

Response

Http status Description
200 The calculation result is returned
400 Input data validation error
401 Authorisation error
429 Allowed number of inquires has been exceeded

Response Body

Name Type Value
loadingSpaces array Load space board
loadingSpace.id integer Load space identifier
loadingSpace.name string Load space name.
loadingSpace.type string Load space type.
loadingSpace.parts array Load space parts board. E.g. a set will have two parts.
loadingSpace.part.length number Load space part length.
loadingSpace.part.width number Load space part width.
loadingSpace.part.height number Load space part height.
loadingSpace.part.limit number Load space part load capacity.
loadinSpace.part.axis array Load space axles board.
loadingSpace.part. axi.distanceFromSpaceFront number Axle distance from the beginning of the load space.
loadingSpace.part.
axi.emptySpaceLoad
number Axle load with an empty load space.
loadingSpace.part.
axi.maxLoad
number The highest permissible axle load.
loadingSpace.part.
axi.addedLoad
number Axle load of the distributed loads.

 

loadingSpace.part.loads array Loads distributed in a given part of the load space.
loadingSpace.part.load.id number Load identifier
loadingSpace.part.load.allowToRotate boolean Value indicated for the free rotation option.
loadingSpace.part.load.quantity integer Quantity of loads from a given group distributed in a given space part.
loadingSpace.part.load.name string Load name
loadingSpace.part.load.priority integer Load priority
loadingSpace.part.load.weight number One load weight.
loadingSpace.part.load.length number Basic load length.
loadingSpace.part.load.width number Basic load width.
loadingSpace.part.load.height number Basic load height.
loadingSpace.part.load.stacking boolean / integer Value set for stacking the load
loadingSpace.part.load.placement array Board with the distribution of loads in a given load space part.
loadingSpace.part.load.placement.length number Distributed load length. The values of length and width may be replaced in relation to the basic values, if the allowToRotate option is set as true.
loadingSpace.part.load.placement.width number Distributed load width.
loadingSpace.part.load.placement.height number Distributed load height.
loadingSpace.part.load.placement.position json Load position in the load space part. Looking from the beginning of the space, position x: 0, y: 0, z: 0 is the right lower corner of the space.

Assumed axle indication:

  • x: along the space width

  • y: along the space height

  • z: along the space length

loadingSpace.part.load.placement.position.x number Position on the x axle
loadingSpace.part.load.placement.position.y number Position on the y axle
loadingSpace.part.load.placement.position.z number Position on the z axle
loadingSpace.part.load.placement.loadsPerAxis json Quantity of loads distributed along a given axle
loadingSpace.part.load.placement.loadsPerAxis.x integer Quantity of loads along the x axle.
loadingSpace.part.load.placement.loadsPerAxis.y integer Quantity of loads along the y axle.
loadingSpace.part.load.placement.loadsPerAxis.z integer Quantity of loads along the z axle.
loadingSpace.part.summary json Summary for a given load space part.
loadingSpace.part.summary.occupiedLdm number Occupied Idm
loadingSpace.part.summary.freeLdm number Free ldm
notFittedLoads array Loads which did not fit in any load space
notFittedLoad.id number Loads identifier
notFittedLoad.length number Loads length
notFittedLoad.width number Loads width
notFittedLoad.height number Loads height
notFittedLoad.weight number One load weight
notFittedLoad.quantity integer Loads quantity
notFittedLoad.priority integer Priority
notFittedLoad.name string Loads name
notFittedLoad.stacking boolean / integer Value set for stacking the load
notFittedLoad.allowToRotate boolean Value indicated for the free rotation option
options json Calculation options
options.allowToOverweight boolean Value set for the option allowing for exceeding the maximum load capacity.
options.unit string Unit set
options.keepLoadsTogether boolean Value set for the option keeping the loads from a given group together.
_links array Further possible actions board
link.rel string relation
link.href string address
Answer example
{
   "loadingSpaces": [
       {
           "id": 1,
           "name": "test truck",
           "parts": [
               {
                   "height": 200,
                   "length": 1300,
                   "width": 200,
                   "limit": 24000,
                   "loads": [
                       {
                           "id": 1,
                           "allowToRotate": true,
                           "stacking": true,
                           "name": "test load 1",
                           "priority": 0,
                           "quantity": 10,
                           "width": 120,
                           "length": 80,
                           "height": 100,
                           "weight": 100,
                           "placement": [
                               {
                                   "height": 100,
                                   "length": 80,
                                   "width": 120,
                                   "loadsPerAxis": {
                                       "x": 1,
                                       "y": 2,
                                       "z": 3
                                   },
                                   "position": {
                                       "x": 0,
                                       "y": 0,
                                       "z": 0
                                   }
                               },
                               {
                                   "height": 100,
                                   "length": 120,
                                   "width": 80,
                                   "loadsPerAxis": {
                                       "x": 1,
                                       "y": 2,
                                       "z": 2
                                   },
                                   "position": {
                                       "x": 120,
                                       "y": 0,
                                       "z": 0
                                   }
                               }
                           ]
                       },
                       {
                           "id": 2,
                           "allowToRotate": true,
                           "stacking": 2,
                           "name": "test load 2",
                           "priority": 0,
                           "quantity": 230,
                           "width": 100,
                           "length": 60,
                           "height": 20,
                           "weight": 100,
                           "placement": [
                               {
                                   "height": 20,
                                   "length": 60,
                                   "width": 100,
                                   "loadsPerAxis": {
                                       "x": 2,
                                       "y": 2,
                                       "z": 17
                                   },
                                   "position": {
                                       "x": 0,
                                       "y": 0,
                                       "z": 240
                                   }
                               },
                               {
                                   "height": 20,
                                   "length": 60,
                                   "width": 100,
                                   "loadsPerAxis": {
                                       "x": 2,
                                       "y": 2,
                                       "z": 17
                                   },
                                   "position": {
                                       "x": 0,
                                       "y": 40,
                                       "z": 240
                                   }
                               },
                               {
                                   "height": 20,
                                   "length": 60,
                                   "width": 100,
                                   "loadsPerAxis": {
                                       "x": 2,
                                       "y": 2,
                                       "z": 17
                                   },
                                   "position": {
                                       "x": 0,
                                       "y": 80,
                                       "z": 240
                                   }
                               },
                               {
                                   "height": 20,
                                   "length": 60,
                                   "width": 100,
                                   "loadsPerAxis": {
                                       "x": 2,
                                       "y": 2,
                                       "z": 6
                                   },
                                   "position": {
                                       "x": 0,
                                       "y": 120,
                                       "z": 240
                                   }
                               },
                               {
                                   "height": 20,
                                   "length": 60,
                                   "width": 100,
                                   "loadsPerAxis": {
                                       "x": 1,
                                       "y": 2,
                                       "z": 1
                                   },
                                   "position": {
                                       "x": 0,
                                       "y": 160,
                                       "z": 240
                                   }
                               }
                           ]
                       }
                   ],
                   "summary": {
                       "freeLdm": 40,
                       "occupiedLdm": 1260
                   },
                   "axis": [
                       {
                           "distanceFromSpaceFront": -200,
                           "emptySpaceLoad": 800,
                           "maxLoad": 10000,
                           "addedLoad": 6265
                       },
                       {
                           "distanceFromSpaceFront": 1000,
                           "emptySpaceLoad": 800,
                           "maxLoad": 10000,
                           "addedLoad": 17735
                       }
                   ]
               }
           ],
           "type": "vehicle"
       }
   ],
   "notFittedLoads": [
       {
           "id": 2,
           "allowToRotate": true,
           "stacking": 2,
           "name": "test load 2",
           "priority": 0,
           "quantity": 70,
           "width": 60,
           "length": 100,
           "height": 20,
           "weight": 100
       }
   ],
   "options": {
       "allowOverweight": false,
       "unit": "cm",
       "keepLoadsTogether": false
   },
   "_links": [
       {
           "rel": "preview",
           "href": "https://app.goodloading.com/session?id=f4a2fe64-0882-4cb9-afa1-1f8e4a29799b"
       }
   ]
}

Documentation front-end

The Goodloading API is embedded using a « script » tag, which can be added directly to the HTML file or dynamically using a separate JavaScript file.

<script async src= »https://app.goodloading.com/embed?api-key=YOUR_API_KEY »></script>

Please enter a valid API token in place of “YOUR_API_KEY”.

Application features

User account information:

Api.account
Type: object

Field Type Value
email string User e-mail
role string User role
firstName string User name
lastName string User surname
companyName string Company name
trucks object Saved loading spaces
trucks.standard array List of standard loading spaces
trucks.user array List of user loading spaces
loads object Saved loads
loads.standard array List of standard loads
loads.user array List of user loads
savedProjects array List of saved projects
country string User country
company object Information about company
company.country string Company country
company.legalName string Company name
company.locality string Company city
company.postalCode string Company postal code
company.streetAddress string Company address
company.vatId string Company VAT ID
isPremium boolean Does the user have premium

Information about the current loading space:

Api.loadingSpace
Type: array

Field Type Value
name string Name of the loading space
dimensions object Dimensions of the loading space
dimensions.width number Width of loading space
dimensions.length number Lenght of loading space
dimensions.height number Height of loading space
loadCapacity number Capacity of loading space
freeLdm number Free LDM
takenLdm number Taken LDM
loadedLoads number Loaded loads
notLoadedLoads number Unladen loads (loads out of space)
occupiedVolume number Occupied volume
freeVolume number Free volume
totalWeight number Total weight of loaded
freeArea number Free space
frontAxi object Front axle information
frontAxi.addedLoad number Front axle load
frontAxi.emptySpaceLoad number Pressure without load
frontAxi.maxLoad number Maximum front axle load
rearAxi object Rear axle information
rearAxi.addedLoad number Rear axle load
rearAxi.emptySpaceLoad number Pressure without load
rearAxi.maxLoad number Maximum rear axle load

Information on current loading

Api.loads
type: object

Field Type Value
cargoSpaces array List of loading space
cargoSpaces.cargoSpace array Lista of loaded loads
cargoSpaces.cargoSpace.name string Loading name
cargoSpaces.cargoSpace.dimensions object Loading dimensions
cargoSpaces.cargoSpace.dimensions.width number Loading width
cargoSpaces.cargoSpace.dimensions.length number Loading lenght
cargoSpaces.cargoSpace.dimensions.height number Loading height
cargoSpaces.cargoSpace.quantity number Number of loads
cargoSpaces.cargoSpace.weight number Loading weight
cargoSpaces.cargoSpace.totalWeight number Total weight of loads
cargoSpaces.cargoSpace.stackingOption boolean Stacking of loads
outsideSpace array List of loads outside the space
outsideSpace.name string Loading name
outsideSpace.dimensions object Loading dimensions
outsideSpace.dimensions.width number Loading width
outsideSpace.dimensions.length number Loading lenght
outsideSpace.dimensions.height number Loading height
outsideSpace.quantity number Number of loads
outsideSpace.weight number Loading weight
outsideSpace.totalWeight number Total weight of loads
outsideSpace.stackingOption boolean Stacking of loads

Adding a loading space

Api.addLoadingSpace()
Type: void

Field Type Value
name string Loading space name
type number Type of loading space:

1 – vehicle

2 – container

3 – other

quantity number Number of loading spaces
length number Loading space length
width number Loading space width
height number Loading space height
limit number Cargo space capacity
set boolean Is the loading space to be a set?
length1? number Trailer length (required for set)
width1? number Trailer width (required for set)
height1? number Trailer height (required for set)
limit1? number Semi-trailer capacity (required for set)
axis? array Axle loads
id? number Loading space ID

Editing the loading space:

Api.updateLoadingSpace()
Type: void

Field Type Value
name string Loading space name
type number Type of loading space:

1 – vehicle

2 – container

3 – other

length number Loading space length
width number Loading space width
height number Loading space height
limit number Cargo space capacity
set boolean Is the loading space to be a set?
length1? number Trailer length (required for set)
width1? number Trailer width (required for set)
height1? number Trailer height (required for set)
limit1? number Semi-trailer capacity (required for set)
id? number Loading space ID

Adding a load:

Api.addLoad()
Type: void

Field Type Value
name string Loading name
length number Loading length
width number Loading width
height number Loading height
weight number Loading weight
quantity number Number of loads
stacking boolean Load stacking
allowToRotate boolean Automatic rotation
maxLoadsOnTop? number Stack quantity
toFirstEmpty? boolean Add to first free

Loading edition

Api.updateGroupLoad()
Type: void

Field Type Value
id number Loading ID
cargoSpaceId number Loading space ID
name? string Name of the loading
length? number Length of loading
width? number Loading width
height? number Loading height
weight? number Loading weight
quantity? number Number of loads
stacking? boolean Load stacking