Package: codat-platform
PlatformManage the building blocks of Codat, including companies, connections, and more.SDK Installationpipinstallcodat-platformExample UsageSDK Example UsageExampleimportcodatplatformfromcodatplatform.modelsimportshareds=codatplatform.CodatPlatform(security=shared.Security(auth_header="<YOUR_API_KEY_HERE>",),)req=shared.CreateAPIKey(name='azure-invoice-finance-processor',)res=s.settings.create_api_key(req)ifres.api_key_detailsisnotNone:# handle responsepassAvailable Resources and Operationssettingscreate_api_key- Create API keydelete_api_key- Delete API keyget_profile- Get profileget_sync_settings- Get sync settingslist_api_keys- List API keysupdate_profile- Update profileupdate_sync_settings- Update all sync settingscompaniescreate- Create companydelete- Delete a companyget- Get companylist- List companiesupdate- Update companyconnectionscreate- Create connectiondelete- Delete connectionget- Get connectionlist- List connectionsunlink- Unlink connectionupdate_authorization- Update authorizationcustom_data_typeconfigure- Configure custom data typeget_configuration- Get custom data configurationlist- List custom data type recordsrefresh- Refresh custom data typepush_dataget_model_options- Get push optionsget_operation- Get push operationlist_operations- List push operationsrefresh_dataall- Refresh all databy_data_type- Refresh data typeget- Get data statusget_pull_operation- Get pull operationlist_pull_operations- List pull operationsgroupsadd_company- Add companycreate- Create grouplist- List groupsremove_company- Remove companyintegrationsget- Get integrationget_branding- Get brandinglist- List integrationssupplemental_dataconfigure- Configureget_configuration- Get configurationwebhookscreate- Create webhookget- Get webhooklist- List webhooksRetriesSome of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.To change the default retry strategy for a single API call, simply provide aRetryConfigobject to the call:importcodatplatformfromcodatplatform.modelsimportsharedfromcodatplatform.utilsimportBackoffStrategy,RetryConfigs=codatplatform.CodatPlatform(security=shared.Security(auth_header="<YOUR_API_KEY_HERE>",),)req=shared.CreateAPIKey(name='azure-invoice-finance-processor',)res=s.settings.create_api_key(req,RetryConfig('backoff',BackoffStrategy(1,50,1.1,100),False))ifres.api_key_detailsisnotNone:# handle responsepassIf you'd like to override the default retry strategy for all operations that support retries, you can use theretry_configoptional parameter when initializing the SDK:importcodatplatformfromcodatplatform.modelsimportsharedfromcodatplatform.utilsimportBackoffStrategy,RetryConfigs=codatplatform.CodatPlatform(retry_config=RetryConfig('backoff',BackoffStrategy(1,50,1.1,100),False)security=shared.Security(auth_header="<YOUR_API_KEY_HERE>",),)req=shared.CreateAPIKey(name='azure-invoice-finance-processor',)res=s.settings.create_api_key(req)ifres.api_key_detailsisnotNone:# handle responsepassError HandlingHandling errors in this SDK should largely match your expectations.  All operations return a response object or raise an error.  If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.Error ObjectStatus CodeContent Typeerrors.ErrorMessage400,401,402,403,409,429,500,503application/jsonerrors.SDKError4x-5xx/Exampleimportcodatplatformfromcodatplatform.modelsimporterrors,shareds=codatplatform.CodatPlatform(security=shared.Security(auth_header="<YOUR_API_KEY_HERE>",),)req=shared.CreateAPIKey(name='azure-invoice-finance-processor',)res=Nonetry:res=s.settings.create_api_key(req)excepterrors.ErrorMessagease:# handle exceptionraise(e)excepterrors.SDKErrorase:# handle exceptionraise(e)ifres.api_key_detailsisnotNone:# handle responsepassServer SelectionSelect Server by IndexYou can override the default server globally by passing a server index to theserver_idx: intoptional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:#ServerVariables0https://api.codat.ioNoneExampleimportcodatplatformfromcodatplatform.modelsimportshareds=codatplatform.CodatPlatform(server_idx=0,security=shared.Security(auth_header="<YOUR_API_KEY_HERE>",),)req=shared.CreateAPIKey(name='azure-invoice-finance-processor',)res=s.settings.create_api_key(req)ifres.api_key_detailsisnotNone:# handle responsepassOverride Server URL Per-ClientThe default server can also be overridden globally by passing a URL to theserver_url: stroptional parameter when initializing the SDK client instance. For example:importcodatplatformfromcodatplatform.modelsimportshareds=codatplatform.CodatPlatform(server_url="https://api.codat.io",security=shared.Security(auth_header="<YOUR_API_KEY_HERE>",),)req=shared.CreateAPIKey(name='azure-invoice-finance-processor',)res=s.settings.create_api_key(req)ifres.api_key_detailsisnotNone:# handle responsepassCustom HTTP ClientThe Python SDK makes API calls using therequestsHTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a customrequests.Sessionobject.For example, you could specify a header for every request that this sdk makes as follows:importcodatplatformimportrequestshttp_client=requests.Session()http_client.headers.update({'x-custom-header':'someValue'})s=codatplatform.CodatPlatform(client:http_client)AuthenticationPer-Client Security SchemesThis SDK supports the following security scheme globally:NameTypeSchemeauth_headerapiKeyAPI keyYou can set the security parameters through thesecurityoptional parameter when initializing the SDK client instance. For example:importcodatplatformfromcodatplatform.modelsimportshareds=codatplatform.CodatPlatform(security=shared.Security(auth_header="<YOUR_API_KEY_HERE>",),)req=shared.CreateAPIKey(name='azure-invoice-finance-processor',)res=s.settings.create_api_key(req)ifres.api_key_detailsisnotNone:# handle responsepassSupportIf you encounter any challenges while utilizing our SDKs, please don't hesitate to reach out for assistance.
You can raise any issues by contacting your dedicated Codat representative or reaching out to oursupport team.
We're here to help ensure a smooth experience for you.Library generated bySpeakeasy