Package: affixapi
openapi-clientThe affixapi.com API documentation.IntroductionAffix API is an OAuth 2.1 application that allows developers to access
customer data, without developers needing to manage or maintain
integrations; or collect login credentials or API keys from users for these
third party systems.OAuth 2.1Affix API follows theOAuth 2.1 spec.As an OAuth application, Affix API handles not only both the collection of
sensitive user credentials or API keys, but also builds and maintains the
integrations with the providers, so you don't have to.How to obtain an access tokenin order to get started, you must:register aclient_iddirect your user to the sign in flow  (https://connect.affixapi.comwith the appropriate query
parameters)captureauthorization_codewe will send to your redirect URI after
the sign in flow is complete and exchange thatauthorization_codefor
a Bearer tokenSandbox keys (developer mode)deveyJhbGciOiJFUzI1NiIsImtpZCI6Ims5RmxwSFR1YklmZWNsUU5QRVZzeFcxazFZZ0Zfbk1BWllOSGVuOFQxdGciLCJ0eXAiOiJKV1MifQ.eyJwcm92aWRlciI6InNhbmRib3giLCJzY29wZXMiOlsiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL2NvbXBhbnkiLCIvMjAyMy0wMy0wMS9kZXZlbG9wZXIvZW1wbG95ZWUiLCIvMjAyMy0wMy0wMS9kZXZlbG9wZXIvZW1wbG95ZWVzIiwiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL2lkZW50aXR5IiwiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL3BheXJ1bnMiLCIvMjAyMy0wMy0wMS9kZXZlbG9wZXIvcGF5cnVucy86cGF5cnVuX2lkIiwiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL3RpbWUtb2ZmLWJhbGFuY2VzIiwiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL3RpbWUtb2ZmLWVudHJpZXMiLCIvMjAyMy0wMy0wMS9kZXZlbG9wZXIvdGltZXNoZWV0cyJdLCJ0b2tlbiI6ImQ1OTZhMmYzLWYzNzktNGE1ZC1hMmRhLTk4OWJmYWViYTg1ZCIsImlhdCI6MTcwMjkyMDkwMywiaXNzIjoicHVibGljYXBpLWludGVybWVkaWF0ZS5kZXYuZW5naW5l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LrxhJ8Wc_3tIzuVwemployeesendpoint sample:curl --fail \\
  -X GET \\
  -H 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6Ims5RmxwSFR1YklmZWNsUU5QRVZzeFcxazFZZ0Zfbk1BWllOSGVuOFQxdGciLCJ0eXAiOiJKV1MifQ.eyJwcm92aWRlciI6InNhbmRib3giLCJzY29wZXMiOlsiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL2NvbXBhbnkiLCIvMjAyMy0wMy0wMS9kZXZlbG9wZXIvZW1wbG95ZWUiLCIvMjAyMy0wMy0wMS9kZXZlbG9wZXIvZW1wbG95ZWVzIiwiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL2lkZW50aXR5IiwiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL3BheXJ1bnMiLCIvMjAyMy0wMy0wMS9kZXZlbG9wZXIvcGF5cnVucy86cGF5cnVuX2lkIiwiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL3RpbWUtb2ZmLWJhbGFuY2VzIiwiLzIwMjMtMDMtMDEvZGV2ZWxvcGVyL3RpbWUtb2ZmLWVudHJpZXMiLCIvMjAyMy0wMy0wMS9kZXZlbG9wZXIvdGltZXNoZWV0cyJdLCJ0b2tlbiI6IjI5YjFjYTg4LWNlNjktNDgyZC1iNGZjLTkzMWMzZmJkYWM4ZSIsImlhdCI6MTcwMjkyMTA4MywiaXNzIjoicHVibGljYXBpLWludGVybWVkaWF0ZS5wcm9kLmVuZ2luZWVyaW5nLmFmZml4YXBpLmNvbSIsInN1YiI6ImRldmVsb3BlciIsImF1ZCI6IjA4QkIwODFFLUQ5QUI0RDE0LThERjk5MjMzLTY2NjE1Q0U5In0.2zdpFAmiyYiYk6MOcbXNUwwR4M1Fextnaac340x54AidiWXCyw-u9KeavbqfYF6q8a9kcDLrxhJ8Wc_3tIzuVw' \\
  'https://api.affixapi.com/2023-03-01/developer/employees'WebhooksAn exciting feature for HR/Payroll modes are webhooks.If enabled, yourwebhook_uriis set on yourclient_idfor the
respective environment:dev | prodWebhooks are configured to make live requests to the underlying integration
1x/hr, and if a difference is detected since the last request, we will send a
request to yourwebhook_uriwith this shape:{

  added: <api.v20230301.Employees>[
    <api.v20230301.Employee>{
      ...,
      date_of_birth: '2010-08-06',
      display_full_name: 'Daija Rogahn',
      employee_number: '57993',
      employment_status: 'pending',
      employment_type: 'other',
      employments: [
        {
          currency: 'eur',
          effective_date: '2022-02-25',
          employment_type: 'other',
          job_title: 'Dynamic Implementation Manager',
          pay_frequency: 'semimonthly',
          pay_period: 'YEAR',
          pay_rate: 96000,
        },
      ],
      first_name: 'Daija',
      ...
    }
  ],
  removed: [],
  updated: [
    <api.v20230301.Employee>{
      ...,
      date_of_birth: '2009-11-09',
      display_full_name: 'Lourdes Stiedemann',
      employee_number: '63189',
      employment_status: 'leave',
      employment_type: 'full_time',
      employments: [
        {
          currency: 'gbp',
          effective_date: '2023-01-16',
          employment_type: 'full_time',
          job_title: 'Forward Brand Planner',
          pay_frequency: 'semimonthly',
          pay_period: 'YEAR',
          pay_rate: 86000,
        },
      ],
      first_name: 'Lourdes',
    }
  ]
}the following headers will be sent with webhook requests:x-affix-api-signature: ab8474e609db95d5df3adc39ea3add7a7544bd215c5c520a30a650ae93a2fba7

x-affix-api-origin:  webhooks-employees-webhook

user-agent:  affixapi.comBefore trusting the payload, you should sign the payload and verify the
signature matches the signature sent by theaffixapi.comservice.This secures that the data sent to yourwebhook_uriis from theaffixapi.comserver.The signature is created by combining the signing secret (yourclient_secret) with the body of the request sent using a standard
HMAC-SHA256 keyed hash.The signature can be created via:create anHMACwith yourclient_secretupdate theHMACwith the payloadget the hex digest -> this is the signatureSampletypescriptcode that follows this recipe:import { createHmac } from 'crypto';

export const computeSignature = ({
  str,
  signingSecret,
}: {
  signingSecret: string;
  str: string;
}): string => {
  const hmac = createHmac('sha256', signingSecret);
  hmac.update(str);
  const signature = hmac.digest('hex');

  return signature;
};Rate limitsOpen endpoints (not gated by an API key) (applied at endpoint level):15 requests every 1 minute (by IP address)25 requests every 5 minutes (by IP address)Gated endpoints (require an API key) (applied at endpoint level):40 requests every 1 minute (by IP address)40 requests every 5 minutes (byclient_id)Things to keep in mind:Open endpoints (not gated by an API key) will likely be called by your
users, not you, so rate limits generally would not apply to you.As a developer, rate limits are applied at the endpoint granularity.For example, say the rate limits below are 10 requests per minute by ip.
from that same ip, within 1 minute, you get:10 requests per minute on/orders,another 10 requests per minute on/items,and another 10 requests per minute on/identity,for a total of 30 requests per minute.This Python package is automatically generated by theOpenAPI Generatorproject:API version: 2023-03-01Package version: 1.0.0Build package: org.openapitools.codegen.languages.PythonClientCodegenRequirements.Python >= 3.6Installation & Usagepip installIf the python package is hosted on a repository, you can install directly using:pipinstallgit+https://github.com/GIT_USER_ID/GIT_REPO_ID.git(you may need to runpipwith root permission:sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)Then import the package:importopenapi_clientSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)Then import the package:importopenapi_clientGetting StartedPlease follow theinstallation procedureand then run the following:importtimeimportopenapi_clientfrompprintimportpprintfromopenapi_client.apiimport2023_03_01_apifromopenapi_client.model.companies20230301_responseimportCompanies20230301Responsefromopenapi_client.model.create_employee_requestimportCreateEmployeeRequestfromopenapi_client.model.employee_responseimportEmployeeResponsefromopenapi_client.model.employees20230301_responseimportEmployees20230301Responsefromopenapi_client.model.groups20230301_responseimportGroups20230301Responsefromopenapi_client.model.identity_responseimportIdentityResponsefromopenapi_client.model.inline_response400importInlineResponse400fromopenapi_client.model.inline_response401importInlineResponse401fromopenapi_client.model.message_responseimportMessageResponsefromopenapi_client.model.payruns20230301_responseimportPayruns20230301Responsefromopenapi_client.model.payslips20230301_responseimportPayslips20230301Responsefromopenapi_client.model.time_off_balances20230301_responseimportTimeOffBalances20230301Responsefromopenapi_client.model.time_off_entries20230301_responseimportTimeOffEntries20230301Responsefromopenapi_client.model.timesheets20230301_responseimportTimesheets20230301Responsefromopenapi_client.model.work_locations20230301_responseimportWorkLocations20230301Response# Defining the host is optional and defaults to https://api.affixapi.com# See configuration.py for a list of all supported configuration parameters.configuration=openapi_client.Configuration(host="https://api.affixapi.com")# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Examples for each auth method are provided below, use the example that# satisfies your auth use case.# Configure API key authorization: access-tokenconfiguration.api_key['access-token']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['access-token'] = 'Bearer'# Enter a context with an instance of the API clientwithopenapi_client.ApiClient(configuration)asapi_client:# Create an instance of the API classapi_instance=2023_03_01_api.20230301Api(api_client)try:# Companyapi_response=api_instance.developer_companies20230301()pprint(api_response)exceptopenapi_client.ApiExceptionase:print("Exception when calling 20230301Api->developer_companies20230301:%s\n"%e)Documentation for API EndpointsAll URIs are relative tohttps://api.affixapi.comClassMethodHTTP requestDescription20230301Apideveloper_companies20230301GET/2023-03-01/developer/companyCompany20230301Apideveloper_create_employee20230301POST/2023-03-01/developer/employeeCreate employee20230301Apideveloper_employees20230301GET/2023-03-01/developer/employeesEmployees20230301Apideveloper_groups20230301GET/2023-03-01/developer/groupsGroups20230301Apideveloper_identity20230301GET/2023-03-01/developer/identityIdentity20230301Apideveloper_payruns20230301GET/2023-03-01/developer/payrunsPayruns20230301Apideveloper_payslips20230301GET/2023-03-01/developer/payruns/{payrun_id}Payslips20230301Apideveloper_time_off_balances20230301GET/2023-03-01/developer/time-off-balancesTime off balances20230301Apideveloper_time_off_entries20230301GET/2023-03-01/developer/time-off-entriesTime off entries20230301Apideveloper_timesheets20230301GET/2023-03-01/developer/timesheetsTimesheets20230301Apideveloper_work_locations20230301GET/2023-03-01/developer/work-locationsWork locations20230301Apiofficial_companies20230301GET/2023-03-01/official/companyCompany20230301Apiofficial_create_employee20230301POST/2023-03-01/official/employeeCreate Employee20230301Apiofficial_employees20230301GET/2023-03-01/official/employeesEmployees20230301Apiofficial_groups20230301GET/2023-03-01/official/groupsGroups20230301Apiofficial_time_off_balances20230301GET/2023-03-01/official/time-off-balancesTime off balances20230301Apiofficial_time_off_entries20230301GET/2023-03-01/official/time-off-entriesTime off entries20230301Apiofficial_timesheets20230301GET/2023-03-01/official/timesheetsTimesheets20230301Apiofficial_work_locations20230301GET/2023-03-01/official/work-locationsWork locations20230301Apiofficialdentity20230301GET/2023-03-01/official/identityIdentityCoreApiprovidersGET/providersProvidersDeveloperApideveloper_companies20230301GET/2023-03-01/developer/companyCompanyDeveloperApideveloper_create_employee20230301POST/2023-03-01/developer/employeeCreate employeeDeveloperApideveloper_employees20230301GET/2023-03-01/developer/employeesEmployeesDeveloperApideveloper_groups20230301GET/2023-03-01/developer/groupsGroupsDeveloperApideveloper_identity20230301GET/2023-03-01/developer/identityIdentityDeveloperApideveloper_payruns20230301GET/2023-03-01/developer/payrunsPayrunsDeveloperApideveloper_payslips20230301GET/2023-03-01/developer/payruns/{payrun_id}PayslipsDeveloperApideveloper_time_off_balances20230301GET/2023-03-01/developer/time-off-balancesTime off balancesDeveloperApideveloper_time_off_entries20230301GET/2023-03-01/developer/time-off-entriesTime off entriesDeveloperApideveloper_timesheets20230301GET/2023-03-01/developer/timesheetsTimesheetsDeveloperApideveloper_work_locations20230301GET/2023-03-01/developer/work-locationsWork locationsManagementApiclientGET/2023-03-01/management/clientClientManagementApidisconnectPOST/2023-03-01/management/disconnectDisconnect tokenManagementApiintrospectGET/2023-03-01/management/introspectInspect tokenManagementApitokenPOST/2023-03-01/management/tokenCreate tokenManagementApitokensGET/2023-03-01/management/tokensTokensManagementApiupdate_clientPOST/2023-03-01/management/clientUpdate clientOfficialApiofficial_companies20230301GET/2023-03-01/official/companyCompanyOfficialApiofficial_create_employee20230301POST/2023-03-01/official/employeeCreate EmployeeOfficialApiofficial_employees20230301GET/2023-03-01/official/employeesEmployeesOfficialApiofficial_groups20230301GET/2023-03-01/official/groupsGroupsOfficialApiofficial_time_off_balances20230301GET/2023-03-01/official/time-off-balancesTime off balancesOfficialApiofficial_time_off_entries20230301GET/2023-03-01/official/time-off-entriesTime off entriesOfficialApiofficial_timesheets20230301GET/2023-03-01/official/timesheetsTimesheetsOfficialApiofficial_work_locations20230301GET/2023-03-01/official/work-locationsWork locationsOfficialApiofficialdentity20230301GET/2023-03-01/official/identityIdentityDocumentation For ModelsAddressNoNonNullRequestAddressResponseClientRequestClientResponseCompanies20230301ResponseCompanyResponseCreateEmployeeRequestCreateEmployeeRequestBankAccountCreateEmployeeRequestManagerCurrencyRequestCurrencyResponseDisconnectResponseEmployeeResponseEmployees20230301ResponseEmploymentNoNullEnumRequestEmploymentResponseGroupNoNullEnumRequestGroupResponseGroups20230301ResponseGroupsNoNullEnumRequestIdAndMessageResponseIdentityResponseInlineResponse400InlineResponse401InlineResponse409IntrospectResponseLocationNoNonNullRequestLocationResponseMessageResponseModeRequestModeResponsePayrunResponsePayruns20230301ResponsePayslipResponsePayslipResponseContributionsPayslipResponseDeductionsPayslipResponseEarningsPayslipResponseTaxesPayslips20230301ResponseProviderRequestProviderResponseProvidersResponseScopesRequestScopesResponseTimeOffBalanceResponseTimeOffBalances20230301ResponseTimeOffEntries20230301ResponseTimeOffEntryResponseTimesheetResponseTimesheets20230301ResponseTokenRequestTokenResponseTokensResponseWorkLocations20230301ResponseDocumentation For Authorizationaccess-tokenType: API keyAPI key parameter name: AuthorizationLocation: HTTP headerbasicType: API keyAPI key parameter name: AuthorizationLocation: HTTP headerAuthordevelopers@affixapi.comNotes for Large OpenAPI documentsIf the OpenAPI document is large, imports in openapi_client.apis and openapi_client.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:Solution 1:
Use specific imports for apis and models like:from openapi_client.api.default_api import DefaultApifrom openapi_client.model.pet import PetSolution 2:
Before importing the package, adjust the maximum recursion limit as shown below:import sys
sys.setrecursionlimit(1500)
import openapi_client
from openapi_client.apis import *
from openapi_client.models import *