How to call the APIs

Providing an User-Agent header in your requests

In order to identify who is sending requests to the byrd backend and to give you a better support we require every API client connection to send an easy to identify user agent header.

We recommend using the following format (reference): User-Agent: <product> / <product-version> <comment>

How your User-Agent string could look like

Let's say your company is called WingTip Toys and you are using Python and requests. This is how your UA string could look like:

wingtiptoys/1.0.0 ([email protected]) Python/3.7.0 requests/2.22.0

πŸ“˜

Sending User-Agent header is needed!

In case we see any issues with requests you are sending, we can use this information to get in touch with you in order to work on a fix, rather then just blocking your IP address or user.

byrd API basics

  • The byrd API follows the REST API architecture.
  • Use HTTPS, SSL, and TLS v1.2 or above when calling any of the endpoints.
  • Set the Content-type HTTP header to application/json.
  • Transmit your token as a bearer token in the Authorization HTTP header.

Pass arguments as:

GET, DELETEquerystring parameters
POST, PATCH, PUTparameters presented as application/json

Error specific to passing JSON

If the posted JSON is invalid, you'll receive the error Request.InvalidSchema.
Please read carefully the content of the error details to try to understand why the request has failed. If you are not able to solve the issue by your means, feel free to contact our tech team.

Example of error when sending an invalid country_code under destination_address:

{
    "code": "Request.InvalidSchema",
    "message": "The input data did not pass the schema validation.",
    "errors": [
        {
            "code": "SchemaError.destination_address",
            "message": "Invalid list item.",
            "extra": {
                "field": "destination_address"
            },
            "tags": {},
            "errors": [
                {
                    "code": "SchemaError.country_code",
                    "message": "String does not match expected pattern.",
                    "extra": {
                        "field": "country_code"
                    },
                    "tags": {},
                    "errors": []
                }
            ]
        }
    ]
}