Skip to content

GetContainerPosition

Returns where a container is in one container yard: its zone and stack position, when its last move was made, whether it is empty and the work order of that move. A yard system, such as a terminal or gate system, uses it to check a container before it moves it, and records the move with ExecuteMove. In TrakIT, the same information is on Yard inventory and Container master.

How to send the key and read the response: API keys, Responses.

GET /api/public/GetContainerPosition?Cont=ABCU1234560&WHKey=your-yard-key
Authorization: Bearer your-api-key

Send the key in an Authorization header with the Bearer scheme. The key must be allowed to query containers (yard.contquery); TrakIT Support sets this up. Without the header, or with another scheme, TrakIT answers HTTP 401 with no body.

Parameter Required Meaning
Cont Yes The container number. Letters, digits, - and _ only. Capitals don’t matter.
WHKey Yes The yard’s key, which TrakIT Support gives you with the API key. URL-encode it.

Both must be in the query string: without one, TrakIT answers HTTP 404.

Rule Info when it fails
Cont is not empty. Cont parameter is required
Cont has only letters, digits, - and _. Container Number must be alphanumeric
The request has an Authorization: Bearer header. No Info: HTTP 401 with no body.
The key is active and allowed to query containers. Key is disabled, not recognized or permission denied
WHKey is a yard’s key. WHKey is missing or invalid
TrakIT knows the container: it is on Container master. Container ... not found, with the number

A successful response is not the envelope: it is the container itself.

{
"ContNum": "ABCU1234560",
"ISO": "45G1",
"Zone": "Block A",
"Position": "B4-R2-T1",
"Bay": 4,
"Row": 2,
"Tier": 1,
"LastMove": "2026-10-20T08:30:12",
"IsEmpty": false,
"WOID": 48211
}

When TrakIT knows the container but it is not in this yard, Position is Not in yard and the other fields, apart from ContNum and ISO, are null.

A refusal is the usual envelope, with Code and Info. Test for ContNum before you read the container.

Field Meaning
ContNum The container number.
ISO The container’s type code, for example 45G1.
Zone The name of the zone the container is in.
Position The stack position, for example B4-R2-T1 for bay 4, row 2, tier 1. A container in the yard without a stack position shows On Truck if its last move was a gate-in or an on-truck move, or In Zone otherwise. Not in yard when it is not in this yard.
Bay, Row, Tier The bay, row and tier of the stack position, or null without one.
LastMove When the container’s last move was carried out, in UTC. See Dates and times.
IsEmpty true if the container was empty on its last move, false if it was full.
WOID The ID of the work order linked to the last move, or null.