Skip to main content

Clappform Python API wrapper

Project description

clappform-integrations

git pull --recurse-submodules git submodule update --recursive --remote

Itris API Wrapper Documentation

The Itris API wrapper facilitates interaction with the Itris system through both REST and SOAP protocols. It allows users to fetch data from various endpoints and handle cases efficiently.

Installation

First, you need to download the Python package via pip::

$ pip install clappform_integrations==1.0.26

Import package

from clappform_integrations import Itris
import pandas as pd

Initialization

REST Part

To initialize the REST part of the wrapper:

# Formatting of the REST credentials
BASEURL_REST = "https://acc-webservices.itris.net/services/acc-istl-vip"
CLIENT_ID_REST = ""
CLIENT_SECRET_REST = ""
USERNAME_REST = ""
PASSWORD_REST = ""
headers_rest = {
    'accept': 'application/json',
    'Authorization': '', 
}
timeout_rest = 600

itrisrest = Itris.ItrisREST(
    BASEURL_REST,
    CLIENT_ID_REST,
    CLIENT_SECRET_REST,
    USERNAME_REST,
    PASSWORD_REST,
    headers_rest,
    timeout_rest
)

SOAP Part

Similarly for the SOAP part of the API, initialize the ItrisSOAP object with the following parameters:

# Formatting of the SOAP credentials
BASEURL_LOGIN_SOAP= 'https://acc-webservices.itris.net/services/acc-istl-soap?WSDL'
BASEURL_SOAP= 'https://acc-webservices.itris.net/services/acc-istl-cad'
PASSWORD_SOAP= ''
PLAINPASSWD_SOAP= ''
SOAPUSERID_SOAP= ''
USERNAME_SOAP= ''
headers_soap= {
'Content-Type' : 'text/xml'
},
timeout_soap= 600

itrissoap = Itris.ItrisSOAP(
    BASEURL_LOGIN_SOAP,
    BASEURL_SOAP,
    USERNAME_SOAP,
    PASSWORD_SOAP,
    SOAPUSERID_SOAP,
    PLAINPASSWD_SOAP,
    headers_soap,
    timeout_soap
)

Fetching Data

REST Part

  • To retrieve data in JSON format, use fetch_data_from_endpoint.
  • To retrieve data in DataFrame format, use fetch_data_as_dataframe.

SOAP Part

Call the desired endpoint directly using call_endpoint. It will return the data in XML format.

Filters

When fetching data from the REST API, several filters can be applied:

  • $expand: Retrieve related data along with the main data.
  • $skip: Pagination for fetching data in chunks or pages.

Predefined Endpoints

REST Part

The wrapper includes predefined endpoints such as:

  • FetchRentalObjectsWithHierarchy is utilized alongside the "$expand" filter, pertaining to the hierarchy of rental objects. Within this hierarchy, we retrieve both the units and the complexes they correspond to.

For example:

qParams = { "$expand": "Hierarchie_verhuurbare_objecten", "$skip":0} 
unit_df = itrisrest.fetch_data_as_dataframe("FetchRentalObjectsWithHierarchy", qParams)

Custom Endpoints

Users can interact with endpoints not explicitly defined by providing the endpoint's identifier.

For example the Contracten endpoint is a new endpoint:

qParams = { }
contracts = itrisrest.fetch_data_as_dataframe("Contracten", qParams)

SOAP Part

Predefined SOAP endpoints include:

  • GetCaseTypeDefinitions
  • GetCases
  • GetCaseStartState

For example to get the complaints from the SOAP part you can use:

qParams = { }
response_GetCaseTypeDefinitions = itrissoap.call_endpoint("GetCaseTypeDefinitions", qParams)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clappform_integrations-1.0.31.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

clappform_integrations-1.0.31-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file clappform_integrations-1.0.31.tar.gz.

File metadata

File hashes

Hashes for clappform_integrations-1.0.31.tar.gz
Algorithm Hash digest
SHA256 72f668bb3bdda2d1ae5ce024751aa6f425882f8165d778837261914d8d1b6728
MD5 873ae83232ab34bf7236cf201ce1ff17
BLAKE2b-256 317d888e4ca3f2b82e0b3f5bcc523cfd5b4af6032f504385157ab3d329a727aa

See more details on using hashes here.

File details

Details for the file clappform_integrations-1.0.31-py3-none-any.whl.

File metadata

File hashes

Hashes for clappform_integrations-1.0.31-py3-none-any.whl
Algorithm Hash digest
SHA256 3a1a222c4bee3be08e72cf8b69dbb9ac681df6c57c4f4f5adae16f4c0844978f
MD5 4f1fbabc2ce1c17edba21e325fefa7d7
BLAKE2b-256 e4476be84fb7b2750e29a218453868a191271f8536a59ef11bd41cfab60d8e4e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page