Skip to content

Sending Requests

Sondre Haugen edited this page Oct 28, 2026 · 5 revisions

Cargonizer has an HTTP REST API.

Base URL

https://api.cargonizer.no

Path / Endpoint

The path section determines which endpoint and resource type you're working with. For example, the URL

https://api.cargonizer.no/customers

is used to work with the Customers endpoint. Referring to a specific resource is done by adding that resource's ID to the URL:

https://api.cargonizer.no/customers/12345

HTTP Methods

The HTTP method determines the action you are performing on the endpoint/resource:

HTTP Method Action
GET Retrieve a resource
POST Create a resource
PATCH Update a resource
DELETE Delete a resource

Identifying Your Integration

Please include a descriptive User-Agent header in all requests. It should contain the name of your product or company, its version, and a contact address.

User-Agent: AcmeWMS/4.2 (support@acme.com)

This helps us identify your integration, give you faster support if something goes wrong, and contact the right people about changes that may affect you.

If you don't set this header, your HTTP library usually sends a generic default (for example python-requests/2.32.3 or Java/17), which doesn't tell us who you are.

Formats

You will encounter two main data formats using our API: XML and JSON. XML will eventually be phased out, and all new endpoints will use JSON.

Specifying format

Response

The format of the response data is specified either by using an extension on the endpoint or by using the Accept header.

GET /customers.xml
GET /customers
Accept: application/xml

Request

When sending data in a POST or PATCH request, the format of that data is specified using the Content-Type header.

POST /customers
Content-Type: application/xml

<customer>
  ...
</customer>

Request + Response

Combining the two, you specify the format of the data you're sending and the format of the data you will receive.

POST /customers.xml
Content-Type: application/xml

<xml/>
POST /customers
Accept: application/xml
Content-Type: application/xml

<xml/>

Extensions and Media Types

Format Extension Media Type
JSON .json application/json
XML .xml application/xml

Query String Parameters

The query string part of the URL can be used to supply parameters that alter the meaning of the request in some way.

GET /customers?country=SE&postcode=55600

Map and list parameters can be supplied using a custom syntax.

Maps

Map values are encoded using [ and ]

In the query string

GET /carOfTheYear?car[name]=Volvo+Amazon&car[stats][model]=1959&car[stats][color]=black&car[discontinued]=true

The parameters correspond to this JSON document:

{
  "car": {
    "name": "Volvo Amazon",
    "stats": {
      "model": "1959",
      "color": "black"
    },
    "discontinued": "true"
  }
}

Lists

Any parameter, including those in maps, can be specified to be part of a list by adding [] at the end of the name.

GET /carOfTheYear?car[notes][]=three-point+seatbelt&car[notes][]=timeless+beauty

{
  "car": {
    "notes": [
      "three-point seatbelt",
      "timeless beauty"
    ]
  }
}

Clone this wiki locally