Topcon Weigh Connect's API provides an interface for you to send in, and manage, weighing tickets for Topcon's Pavelink system. Using this interface, you can create an integration between your existing weigh bridge software (or any software layer on top of it) and Pavelink, while keeping full control over all weighing tickets you send to Pavelink. Our interface allows you to not only send one or multiple weighing tickets in one go, but to also update them if anything changes (e.g. a typo has been made by the operator on the weigh bridge), or even delete them if needed.
Integrating with our Weigh Connect API is as straightforward as any other API out there, thanks to its REST-style design. On this page we will show you how to gain access to our API, how to interact with it, and we give an example of the most common operation on the API: sending in a weighing ticket.
In order to access Weigh Connect's API, a request for API credentials needs to be made. This request can be sent to our support desk at support@topcon.com. In this email, please include:
Our support desk will validate the request, and, if approved, will send you a Client ID and Client Secret. These credentials will be used to authorize with the API. Along with the response, a list of weigh bridge UUIDs will be sent. These UUIDs have to be used whenever sending in a weighing ticket, to indicate the weigh bridge that is the source of the weighing ticket.
After receiving credentials, you can now start interfacing with Weigh Connect's API.
Two distinct Weigh Connect environments exist. Topcon recommends developing and testing your integration with the Sandbox environment, and once deemed stable for rollout, to switch to the Production environment. Credentials for both environments can differ.
Environment Name | URL |
---|---|
Sandbox | https://sandbox-weighing.topcon.io/v2 |
Production | https://weighing.topcon.io/v2 |
Let's use the ClientId and ClientSecret provided to execute a POST request on the API in order to send in a weighing ticket. For this, we can use the /weighing endpoint. The request can look like this:
POST https://sandbox-weighing.topcon.io/v2/weighing
Content-Type | application/json |
X-ClientId | {ClientId} |
X-ClientSecret | {ClientSecret} |
Body
{ "locationId": "e38732d8-6b0e-4975-83ab-94ccb85a2aeb", "externalId": "45678", "type": "delivered", "tripNumber": 5, "nettWeight": { "quantity": 24040, "unit": "kg", "datetime": "2023-01-01T10:00:00.000Z", "serialNumber": 1002871 }, "grossWeight": { "quantity": 24040, "unit": "kg", "datetime": "2023-01-01T10:00:00.000Z", "serialNumber": 1002871 }, "tareWeight": { "quantity": 24040, "unit": "kg", "datetime": "2023-01-01T10:00:00.000Z", "serialNumber": 1002871 }, "cumulativeWeight": { "quantity": 24040, "unit": "kg", "datetime": "2023-01-01T10:00:00.000Z", "serialNumber": 1002871 }, "customer": { "name": "Demo Company Inc.", "reference": "Company reference", "street": "4434 Oakway Lane", "postalCode": "90017", "city": "Los Angeles", "countryCode": "US", "telephone": "818-329-7707", "email": "contact@democompanyinc.com" }, "product": { "identifier": "100460", "name": "Asphalt", "temperature": { "value": 152, "unit": "c", "datetime": "2023-01-01T10:00:00.000Z" } }, "project": { "identifier": "12345", "description": "Demo project", "subProjectIdentifier": "001" }, "vehicle": { "licenseplate": "ABC123", "reference": "Truck 123", "countryCode": "US", "owner": { "name": "Demo Company Inc.", "reference": "Company reference", "street": "4434 Oakway Lane", "postalCode": "90017", "city": "Los Angeles", "countryCode": "US", "telephone": "818-329-7707", "email": "contact@democompanyinc.com" } } }
For the X-ClientId and X-ClientSecret headers, the {ClientId} and {ClientSecret} need to be replaced with the actual credentials you received.
In this example body, there are a few key properties that we will highlight. For all other properties, please check out our API documentation for this specific endpoint. Clicking on 'Schema' in the 'Request body' section will show a detailed explanation of each property and their meaning.
Property | Description |
---|---|
locationId | The UUID of the weigh bridge that has generated the weighing ticket. This UUID has been provided by our Professional Services team when you requested access to our API. |
externalId | A unique identifier generated by the weigh bridge. Usually this is described as a 'ticket number' or a 'ticket receipt number' in the weigh bridge software. Weigh Connect keeps track of all weighing tickets in our system, and if it detects duplicates for the same weigh bridge based on this externalId, it will refuse the incoming weighing ticket. |
nettWeight | The actual weighing information itself, as it denotes the amount that was weighed on the bridge. |
customer | This is the customer that will receive the truck load |
Executing this POST request will result in a response with a weighing object. The response may look like this:
{ "uuid": "e38732d8-6b0e-4975-83ab-94ccb85a2aeb", "createdAt": "2018-01-01T10:00:00.000Z", "modifiedAt": "2018-01-01T10:00:00.000Z", "locationId": "e38732d8-6b0e-4975-83ab-94ccb85a2aeb", "externalId": "45678", "type": "delivered", "tripNumber": 5, "nettWeight": { "quantity": 24040, "unit": "kg", "datetime": "2023-01-01T10:00:00.000Z", "serialNumber": 1002871 }, "grossWeight": { "quantity": 24040, "unit": "kg", "datetime": "2023-01-01T10:00:00.000Z", "serialNumber": 1002871 }, "tareWeight": { "quantity": 24040, "unit": "kg", "datetime": "2023-01-01T10:00:00.000Z", "serialNumber": 1002871 }, "cumulativeWeight": { "quantity": 24040, "unit": "kg", "datetime": "2023-01-01T10:00:00.000Z", "serialNumber": 1002871 } "customer": { "name": "Demo Company Inc.", "reference": "Company reference", "street": "4434 Oakway Lane", "postalCode": "90017", "city": "Los Angeles", "countryCode": "US", "telephone": "818-329-7707", "email": "contact@democompanyinc.com" }, "product": { "identifier": "100460", "name": "Asphalt", "temperature": { "value": 152, "unit": "c", "datetime": "2023-01-01T10:00:00.000Z" } }, "project": { "identifier": "12345", "description": "Demo project", "subProjectIdentifier": "001" }, "vehicle": { "licenseplate": "ABC123", "reference": "Truck 123", "countryCode": "US", "owner": { "name": "Demo Company Inc.", "reference": "Company reference", "street": "4434 Oakway Lane", "postalCode": "90017", "city": "Los Angeles", "countryCode": "US", "telephone": "818-329-7707", "email": "contact@democompanyinc.com" } } }
As you can see, the response is pretty much identical to the weighing data that was sent in, with the addition of the fields uuid, createdAt, and modifiedAt. The uuid field is important if you later want to send in modifications, or even delete the weighing ticket.
Permissions
The credentials provided by Topcon give the authenticated application full read/write permissions within the API. Be aware of this when performing potentially destructive operations with the API.