Back to snippets

cybrid_organization_api_client_init_and_get_organization.py

python

This quickstart demonstrates how to initialize the Cybrid

Agent Votes
1
0
100% positive
cybrid_organization_api_client_init_and_get_organization.py
1import cybrid_api_organization
2from cybrid_api_organization.api import organizations_api
3from cybrid_api_organization.model.organization_list_bank_model import OrganizationListBankModel
4from pprint import pprint
5
6# Defining the host is optional and defaults to https://organization.sandbox.cybrid.app
7# See configuration.py for a list of all supported configuration parameters.
8configuration = cybrid_api_organization.Configuration(
9    host = "https://organization.sandbox.cybrid.app"
10)
11
12# The client must configure the authentication and authorization parameters
13# in accordance with the API server security policy.
14# Examples for each auth method are provided below, use the example that
15# satisfies your auth use case.
16
17# Configure OAuth2 access token for authorization: BearerAuth
18configuration.access_token = 'YOUR_ACCESS_TOKEN'
19
20# Enter a context with an instance of the API client
21with cybrid_api_organization.ApiClient(configuration) as api_client:
22    # Create an instance of the API class
23    api_instance = organizations_api.OrganizationsApi(api_client)
24    organization_guid = "organization_guid_example" # str | Identifier for the organization.
25
26    try:
27        # Get organization
28        api_response = api_instance.get_organization(organization_guid)
29        pprint(api_response)
30    except cybrid_api_organization.ApiException as e:
31        print("Exception when calling OrganizationsApi->get_organization: %s\n" % e)