Python SDK

This guide explains how to interact with the API using the Python client.


Installation

pip install fortisx

or, if you prefer a local install:

pip install -e .

Initialization

from fortisx import API

api = API(api_key="YOUR_API_KEY")

Constructor options

Name
Type
Default
Description

api_key

str

API key used for authorization

base_url

str

https://api.fortisx.fi/v1

Override if using a custom environment

timeout

int

10

Request timeout in seconds


Methods

Method
Arguments
Returns
Description

get(endpoint, params=None)

str, dict?

dict

Performs a GET request

post(endpoint, data=None)

str, dict?

dict

Performs a POST request

put(endpoint, data=None)

str, dict?

dict

Performs a PUT request

delete(endpoint)

str

dict

Performs a DELETE request

All methods automatically include the following headers:


Error Handling

When a network or server error occurs, an exception of type APIError is raised.

Field
Type
Description

message

str

Short description of the error

status

int

HTTP status code

details

dict

Full response body if available

Example:


Example: /ping Endpoint

Last updated