The HelloAsso Python library offers a straightforward way to interact with the HelloAsso API in Python applications. It features a collection of pre-built classes for API resources that automatically adapt to API responses, ensuring flexibility across different versions of the HelloAsso API.
Python 3.8+
If the python package is hosted on a repository, you can install directly using:
pip install helloasso-python
(you may need to run pip
with root permission: sudo pip install helloasso-python
)
Then import the package:
import helloasso_python
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import helloasso_python
Execute pytest
to run the tests.
Please follow the installation procedure and then run the following:
import helloasso_python
from helloasso_python.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.helloasso.com/v5
# See configuration.py for a list of all supported configuration parameters.
configuration = helloasso_python.Configuration(
host = "https://api.helloasso.com/v5"
)
# 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.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with helloasso_python.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = helloasso_python.AnnuaireApi(api_client)
page_size = 20 # int | The number of items per page (optional) (default to 20)
continuation_token = 'continuation_token_example' # str | Continuation Token from which we wish to retrieve results (optional)
hello_asso_api_v5_models_directory_list_forms_request = helloasso_python.HelloAssoApiV5ModelsDirectoryListFormsRequest() # HelloAssoApiV5ModelsDirectoryListFormsRequest | Body which contains the filters to apply (optional)
try:
# Récupérer les formulaires
api_response = api_instance.directory_forms_post(page_size=page_size, continuation_token=continuation_token, hello_asso_api_v5_models_directory_list_forms_request=hello_asso_api_v5_models_directory_list_forms_request)
print("The response of AnnuaireApi->directory_forms_post:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AnnuaireApi->directory_forms_post: %s\n" % e)
All URIs are relative to https://api.helloasso.com/v5
Class | Method | HTTP request | Description |
---|---|---|---|
AnnuaireApi | directory_forms_post | POST /directory/forms | Récupérer les formulaires |
AnnuaireApi | directory_organizations_post | POST /directory/organizations | Récupérer les organisations |
CheckoutApi | organizations_organization_slug_checkout_intents_checkout_intent_id_get | GET /organizations/{organizationSlug}/checkout-intents/{checkoutIntentId} | Récupérer une intention de paiement |
CheckoutApi | organizations_organization_slug_checkout_intents_post | POST /organizations/{organizationSlug}/checkout-intents | Initialisation d'un Checkout |
CommandesApi | items_item_id_get | GET /items/{itemId} | Obtenir le détail d'un article contenu dans une commande |
CommandesApi | orders_order_id_cancel_post | POST /orders/{orderId}/cancel | Annuler les paiements futurs pour une commande (pas de remboursement). |
CommandesApi | orders_order_id_get | GET /orders/{orderId} | Obtenir des informations détaillées sur une commande |
CommandesApi | organizations_organization_slug_forms_form_type_form_slug_items_get | GET /organizations/{organizationSlug}/forms/{formType}/{formSlug}/items | Obtenir une liste d'articles vendus dans un formulaire |
CommandesApi | organizations_organization_slug_forms_form_type_form_slug_orders_get | GET /organizations/{organizationSlug}/forms/{formType}/{formSlug}/orders | Obtenir les commandes d'un formulaire |
CommandesApi | organizations_organization_slug_items_get | GET /organizations/{organizationSlug}/items | Obtenir une liste d'articles vendus par une organisation |
CommandesApi | organizations_organization_slug_orders_get | GET /organizations/{organizationSlug}/orders | Obtenir les commandes d'une organisation |
FormulairesApi | organizations_organization_slug_form_types_get | GET /organizations/{organizationSlug}/formTypes | Obtenir une liste des types de formulaires pour une organisation |
FormulairesApi | organizations_organization_slug_forms_form_type_action_quick_create_post | POST /organizations/{organizationSlug}/forms/{formType}/action/quick-create | Créer un événement simplifié pour un organisme |
FormulairesApi | organizations_organization_slug_forms_form_type_form_slug_public_get | GET /organizations/{organizationSlug}/forms/{formType}/{formSlug}/public | Obtenir des données publiques détaillées sur un formulaire |
FormulairesApi | organizations_organization_slug_forms_get | GET /organizations/{organizationSlug}/forms | Obtenir les formulaires d'une organisation |
ListeDeValeursApi | values_company_legal_status_get | GET /values/company-legal-status | Obtenir la liste des statuts juridiques |
ListeDeValeursApi | values_organization_categories_get | GET /values/organization/categories | Obtenir la liste des catégories du JO |
ListeDeValeursApi | values_tags_get | GET /values/tags | Obtenir la liste des tags publiques |
OrganisationApi | organizations_legal_informations_legal_structures_get | GET /organizations/legal-informations/legal-structures | Obtenir la structure juridique d'une organisation visible. |
OrganisationApi | organizations_legal_informations_organization_slug_configuration_get | GET /organizations/legal-informations/{organizationSlug}/configuration | |
OrganisationApi | organizations_legal_informations_tax_information_texts_get | GET /organizations/legal-informations/tax-information-texts | |
OrganisationApi | organizations_organization_slug_get | GET /organizations/{organizationSlug} | Obtenir le détail d'une organisation |
OrganizationLegalInformationsApi | organizations_legal_informations_organization_slug_configuration_put | PUT /organizations/legal-informations/{organizationSlug}/configuration | |
PaiementsApi | organizations_organization_slug_forms_form_type_form_slug_payments_get | GET /organizations/{organizationSlug}/forms/{formType}/{formSlug}/payments | Obtenir les informations des paiements effectués sur un formulaire |
PaiementsApi | organizations_organization_slug_payments_get | GET /organizations/{organizationSlug}/payments | Obtenir les informations des paiements effectués sur une organisation |
PaiementsApi | organizations_organization_slug_payments_search_get | GET /organizations/{organizationSlug}/payments/search | Rechercher des paiements. |
PaiementsApi | payments_payment_id_get | GET /payments/{paymentId} | Obtenir les informations détaillées d'un paiement. |
PaiementsApi | payments_payment_id_refund_post | POST /payments/{paymentId}/refund | Rembourser un paiement. |
PartenairesApi | partners_me_api_clients_put | PUT /partners/me/api-clients | Mise à jour du domaine |
PartenairesApi | partners_me_api_notifications_delete | DELETE /partners/me/api-notifications | Suppression de l'URL de notification principale |
PartenairesApi | partners_me_api_notifications_organizations_organization_slug_delete | DELETE /partners/me/api-notifications/organizations/{organizationSlug} | Suppression d'une URL de notification liée à une organisation |
PartenairesApi | partners_me_api_notifications_organizations_organization_slug_put | PUT /partners/me/api-notifications/organizations/{organizationSlug} | Mise à jour d'une URL de notification liée à une organisation |
PartenairesApi | partners_me_api_notifications_put | PUT /partners/me/api-notifications | Mise à jour de l'URL de notification principale |
PartenairesApi | partners_me_get | GET /partners/me | Récupération des informations |
PartenairesApi | partners_me_organizations_get | GET /partners/me/organizations | Obtenir toutes les organisations |
TagsApi | tags_tag_name_get | GET /tags/{tagName} | Obtenir le détail d'un tag interne |
TaxReceiptApi | organizations_organization_slug_tax_receipt_configuration_get | GET /organizations/{organizationSlug}/tax-receipt/configuration | |
TaxReceiptApi | organizations_organization_slug_tax_receipt_configuration_put | PUT /organizations/{organizationSlug}/tax-receipt/configuration | |
TaxReceiptApi | organizations_organization_slug_tax_receipt_preview_post | POST /organizations/{organizationSlug}/tax-receipt/preview | |
UtilisateursApi | users_me_organizations_get | GET /users/me/organizations | Obtenir mes organisations |
- HelloAssoApiV5ModelsAccountCompanyLegalStatusModel
- HelloAssoApiV5ModelsAccountOrganismCategoryModel
- HelloAssoApiV5ModelsAccountsClientsApiClientModel
- HelloAssoApiV5ModelsAccountsClientsPublicPutApiClientRequest
- HelloAssoApiV5ModelsApiNotificationsApiNotificationType
- HelloAssoApiV5ModelsApiNotificationsApiUrlNotificationModel
- HelloAssoApiV5ModelsApiNotificationsPostApiUrlNotificationBody
- HelloAssoApiV5ModelsCartsCheckoutIntentResponse
- HelloAssoApiV5ModelsCartsCheckoutPayer
- HelloAssoApiV5ModelsCartsCheckoutTerm
- HelloAssoApiV5ModelsCartsInitCheckoutBody
- HelloAssoApiV5ModelsCartsInitCheckoutResponse
- HelloAssoApiV5ModelsCommonContactModel
- HelloAssoApiV5ModelsCommonDocumentModel
- HelloAssoApiV5ModelsCommonMetaModel
- HelloAssoApiV5ModelsCommonPaginationModel
- HelloAssoApiV5ModelsCommonPlaceModel
- HelloAssoApiV5ModelsDirectoryDirectoryOrganizationPublicModel
- HelloAssoApiV5ModelsDirectoryListFormsRequest
- HelloAssoApiV5ModelsDirectoryListOrganizationsRequest
- HelloAssoApiV5ModelsDirectoryPartnerOrganizationModel
- HelloAssoApiV5ModelsDirectorySynchronizableFormModel
- HelloAssoApiV5ModelsDirectorySynchronizableOrganizationModel
- HelloAssoApiV5ModelsEnumsFieldType
- HelloAssoApiV5ModelsEnumsFormState
- HelloAssoApiV5ModelsEnumsFormType
- HelloAssoApiV5ModelsEnumsItemState
- HelloAssoApiV5ModelsEnumsMembershipValidityType
- HelloAssoApiV5ModelsEnumsOperationState
- HelloAssoApiV5ModelsEnumsOrganizationType
- HelloAssoApiV5ModelsEnumsPaymentCashOutState
- HelloAssoApiV5ModelsEnumsPaymentFrequencyType
- HelloAssoApiV5ModelsEnumsPaymentMeans
- HelloAssoApiV5ModelsEnumsPaymentProviderType
- HelloAssoApiV5ModelsEnumsPaymentState
- HelloAssoApiV5ModelsEnumsPaymentType
- HelloAssoApiV5ModelsEnumsPriceCategory
- HelloAssoApiV5ModelsEnumsRecordActionType
- HelloAssoApiV5ModelsEnumsSortField
- HelloAssoApiV5ModelsEnumsSortOrder
- HelloAssoApiV5ModelsEnumsTagType
- HelloAssoApiV5ModelsEnumsTierType
- HelloAssoApiV5ModelsFormsFormBasicModel
- HelloAssoApiV5ModelsFormsFormLightModel
- HelloAssoApiV5ModelsFormsFormPublicModel
- HelloAssoApiV5ModelsFormsFormQuickCreateModel
- HelloAssoApiV5ModelsFormsFormQuickCreateRequest
- HelloAssoApiV5ModelsFormsTermModel
- HelloAssoApiV5ModelsFormsTierLightModel
- HelloAssoApiV5ModelsFormsTierPublicModel
- HelloAssoApiV5ModelsOrganizationLegalInformationsOrganizationLegalStructuresModel
- HelloAssoApiV5ModelsOrganizationLegalInformationsUpdateOrganizationLegalInformationConfigurationBody
- HelloAssoApiV5ModelsOrganizationOrganizationBasicModel
- HelloAssoApiV5ModelsOrganizationOrganizationLightModel
- HelloAssoApiV5ModelsOrganizationOrganizationModel
- HelloAssoApiV5ModelsPartnerStatisticsModel
- HelloAssoApiV5ModelsPartnersPartnerPublicModel
- HelloAssoApiV5ModelsPaymentPublicPaymentModel
- HelloAssoApiV5ModelsPaymentRefundOperationModel
- HelloAssoApiV5ModelsStatisticsItem
- HelloAssoApiV5ModelsStatisticsItemCustomField
- HelloAssoApiV5ModelsStatisticsItemDetail
- HelloAssoApiV5ModelsStatisticsItemDiscount
- HelloAssoApiV5ModelsStatisticsItemOption
- HelloAssoApiV5ModelsStatisticsItemPayment
- HelloAssoApiV5ModelsStatisticsOrder
- HelloAssoApiV5ModelsStatisticsOrderAmountModel
- HelloAssoApiV5ModelsStatisticsOrderDetail
- HelloAssoApiV5ModelsStatisticsOrderItem
- HelloAssoApiV5ModelsStatisticsOrderLight
- HelloAssoApiV5ModelsStatisticsOrderPayment
- HelloAssoApiV5ModelsStatisticsPayer
- HelloAssoApiV5ModelsStatisticsPayment
- HelloAssoApiV5ModelsStatisticsPaymentDetail
- HelloAssoApiV5ModelsStatisticsPaymentItem
- HelloAssoApiV5ModelsStatisticsRefundOperationLightModel
- HelloAssoApiV5ModelsStatisticsShareItem
- HelloAssoApiV5ModelsStatisticsSharePayment
- HelloAssoApiV5ModelsStatisticsUser
- HelloAssoApiV5ModelsTagsInternalTagModel
- HelloAssoApiV5ModelsTagsPublicTagModel
- HelloAssoModelsAccountsOrganizationLegalInformationsFiscalReceiptFormatOptionModel
- HelloAssoModelsAccountsOrganizationLegalInformationsFiscalReceiptSignatoryModel
- HelloAssoModelsAccountsOrganizationLegalInformationsOrganizationFiscalReceiptOptionsConfiguration
- HelloAssoModelsAccountsOrganizationLegalInformationsOrganizationLegalInformationConfiguration
- HelloAssoModelsAccountsOrganizationLegalInformationsTaxInformationText
- HelloAssoModelsComplianceV2CommonAddressAddressModelSnapshot
- HelloAssoModelsEnumsGlobalRole
- HelloAssoModelsSharedGeoLocation
- ResultsWithPaginationModelFormLightModel
- ResultsWithPaginationModelItem
- ResultsWithPaginationModelOrder
- ResultsWithPaginationModelPartnerOrganizationModel
- ResultsWithPaginationModelPayment
- ResultsWithPaginationModelPublicPaymentModel
- ResultsWithPaginationModelSynchronizableFormModel
- ResultsWithPaginationModelSynchronizableOrganizationModel
We use OAuth2 for authentication, so to avoid reinventing the wheel, we recommend using the Authlib package
Install the Authlib package:
pip install requests
pip install Authlib
from authlib.integrations.requests_client import OAuth2Session
# Configuration
client_id = 'your_client_id'
client_secret = 'your_client_secret'
token_url = 'https://api.helloasso.com/oauth2/token'
# Create an OAuth2 session
client = OAuth2Session(client_id, client_secret)
# Get an access token
def get_access_token():
token = client.fetch_token(token_url, grant_type='client_credentials')
print("Access Token:", token['access_token'])
print("Expires In:", token['expires_in'])
print("Refresh Token:", token['refresh_token'])
return token
# Usage
get_access_token()
from authlib.integrations.requests_client import OAuth2Session
# Configuration
client_id = 'your_client_id'
client_secret = 'your_client_secret'
token_url = 'https://api.helloasso.com/oauth2/token'
# Refresh the token
def refresh_access_token(refresh_token):
client = OAuth2Session(client_id, client_secret)
token = client.refresh_token(token_url, refresh_token=refresh_token)
print("New Access Token:", token['access_token'])
print("Expires In:", token['expires_in'])
print("New Refresh Token:", token['refresh_token'])
return token
# Usage
refresh_access_token('your_refresh_token')
import base64
import hashlib
import os
from authlib.integrations.requests_client import OAuth2Session
# Configuration
client_id = 'your_client_id'
client_secret = 'your_client_secret'
authorize_url = 'https://auth.helloasso.com/authorize'
token_url = 'https://api.helloasso.com/oauth2/token'
redirect_uri = 'https://your-app.com/callback'
# PKCE Helper Functions
def generate_code_verifier():
"""Generate a high-entropy code_verifier."""
return base64.urlsafe_b64encode(os.urandom(32)).rstrip(b'=').decode('utf-8')
def generate_code_challenge(code_verifier):
"""Generate a code_challenge based on the code_verifier."""
code_challenge = hashlib.sha256(code_verifier.encode('utf-8')).digest()
return base64.urlsafe_b64encode(code_challenge).rstrip(b'=').decode('utf-8')
# Step 1: Generate the Authorization URL
def get_authorization_url():
# Generate PKCE parameters
code_verifier = generate_code_verifier()
code_challenge = generate_code_challenge(code_verifier)
client = OAuth2Session(client_id, client_secret, redirect_uri=redirect_uri)
authorization_url, state = client.create_authorization_url(authorize_url, code_challenge=code_challenge, code_challenge_method='S256')
print("Authorization URL: ", authorization_url)
print("Code verifier: ", code_verifier)
# Step 2: Exchange the authorization code for an access token
def get_access_token_from_code(authorization_response, code_verifier):
client = OAuth2Session(client_id, client_secret, redirect_uri=redirect_uri)
token = client.fetch_token(token_url, authorization_response=authorization_response, code_verifier=code_verifier)
print("Access Token: ", token['access_token'])
print("Expires In: ", token['expires_in'])
print("Refresh Token: ", token['refresh_token'])
# Usage
get_authorization_url()
# After user authorizes, exchange the code (passed in the redirect URL callback)
#get_access_token_from_code('your_authorization_code', 'your_code_verifier')
This SDK is automatically generated by the OpenAPI Generator project:
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen