The HelloAsso node library offers a straightforward way to interact with the HelloAsso API in node 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.
For Node.js
Install it via:
npm install helloasso-node --save
Finally, you need to build the module:
npm run build
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var helloasso = require('helloasso-node');
var defaultClient = helloasso.ApiClient.instance;
// Configure OAuth2 access token for authorization: OAuth2
var OAuth2 = defaultClient.authentications['OAuth2'];
OAuth2.accessToken = "YOUR ACCESS TOKEN"
var api = new helloasso.AnnuaireApi()
var opts = {
'pageSize': 20, // {Number} The number of items per page
'continuationToken': "continuationToken_example", // {String} Continuation Token from which we wish to retrieve results
'helloAssoApiV5ModelsDirectoryListFormsRequest': new helloasso.HelloAssoApiV5ModelsDirectoryListFormsRequest() // {HelloAssoApiV5ModelsDirectoryListFormsRequest} Body which contains the filters to apply
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.directoryFormsPost(opts, callback);
All URIs are relative to https://api.helloasso.com/v5
Class | Method | HTTP request | Description |
---|---|---|---|
HelloAssoApi.AnnuaireApi | directoryFormsPost | POST /directory/forms | Récupérer les formulaires |
HelloAssoApi.AnnuaireApi | directoryOrganizationsPost | POST /directory/organizations | Récupérer les organisations |
HelloAssoApi.CheckoutApi | organizationsOrganizationSlugCheckoutIntentsCheckoutIntentIdGet | GET /organizations/{organizationSlug}/checkout-intents/{checkoutIntentId} | Récupérer une intention de paiement |
HelloAssoApi.CheckoutApi | organizationsOrganizationSlugCheckoutIntentsPost | POST /organizations/{organizationSlug}/checkout-intents | Initialisation d'un Checkout |
HelloAssoApi.CommandesApi | itemsItemIdGet | GET /items/{itemId} | Obtenir le détail d'un article contenu dans une commande |
HelloAssoApi.CommandesApi | ordersOrderIdCancelPost | POST /orders/{orderId}/cancel | Annuler les paiements futurs pour une commande (pas de remboursement). |
HelloAssoApi.CommandesApi | ordersOrderIdGet | GET /orders/{orderId} | Obtenir des informations détaillées sur une commande |
HelloAssoApi.CommandesApi | organizationsOrganizationSlugFormsFormTypeFormSlugItemsGet | GET /organizations/{organizationSlug}/forms/{formType}/{formSlug}/items | Obtenir une liste d'articles vendus dans un formulaire |
HelloAssoApi.CommandesApi | organizationsOrganizationSlugFormsFormTypeFormSlugOrdersGet | GET /organizations/{organizationSlug}/forms/{formType}/{formSlug}/orders | Obtenir les commandes d'un formulaire |
HelloAssoApi.CommandesApi | organizationsOrganizationSlugItemsGet | GET /organizations/{organizationSlug}/items | Obtenir une liste d'articles vendus par une organisation |
HelloAssoApi.CommandesApi | organizationsOrganizationSlugOrdersGet | GET /organizations/{organizationSlug}/orders | Obtenir les commandes d'une organisation |
HelloAssoApi.FormulairesApi | organizationsOrganizationSlugFormTypesGet | GET /organizations/{organizationSlug}/formTypes | Obtenir une liste des types de formulaires pour une organisation |
HelloAssoApi.FormulairesApi | organizationsOrganizationSlugFormsFormTypeActionQuickCreatePost | POST /organizations/{organizationSlug}/forms/{formType}/action/quick-create | Créer un événement simplifié pour un organisme |
HelloAssoApi.FormulairesApi | organizationsOrganizationSlugFormsFormTypeFormSlugPublicGet | GET /organizations/{organizationSlug}/forms/{formType}/{formSlug}/public | Obtenir des données publiques détaillées sur un formulaire |
HelloAssoApi.FormulairesApi | organizationsOrganizationSlugFormsGet | GET /organizations/{organizationSlug}/forms | Obtenir les formulaires d'une organisation |
HelloAssoApi.ListeDeValeursApi | valuesCompanyLegalStatusGet | GET /values/company-legal-status | Obtenir la liste des statuts juridiques |
HelloAssoApi.ListeDeValeursApi | valuesOrganizationCategoriesGet | GET /values/organization/categories | Obtenir la liste des catégories du JO |
HelloAssoApi.ListeDeValeursApi | valuesTagsGet | GET /values/tags | Obtenir la liste des tags publiques |
HelloAssoApi.OrganisationApi | organizationsLegalInformationsLegalStructuresGet | GET /organizations/legal-informations/legal-structures | Obtenir la structure juridique d'une organisation visible. |
HelloAssoApi.OrganisationApi | organizationsLegalInformationsOrganizationSlugConfigurationGet | GET /organizations/legal-informations/{organizationSlug}/configuration | |
HelloAssoApi.OrganisationApi | organizationsLegalInformationsTaxInformationTextsGet | GET /organizations/legal-informations/tax-information-texts | |
HelloAssoApi.OrganisationApi | organizationsOrganizationSlugGet | GET /organizations/{organizationSlug} | Obtenir le détail d'une organisation |
HelloAssoApi.OrganizationLegalInformationsApi | organizationsLegalInformationsOrganizationSlugConfigurationPut | PUT /organizations/legal-informations/{organizationSlug}/configuration | |
HelloAssoApi.PaiementsApi | organizationsOrganizationSlugFormsFormTypeFormSlugPaymentsGet | GET /organizations/{organizationSlug}/forms/{formType}/{formSlug}/payments | Obtenir les informations des paiements effectués sur un formulaire |
HelloAssoApi.PaiementsApi | organizationsOrganizationSlugPaymentsGet | GET /organizations/{organizationSlug}/payments | Obtenir les informations des paiements effectués sur une organisation |
HelloAssoApi.PaiementsApi | organizationsOrganizationSlugPaymentsSearchGet | GET /organizations/{organizationSlug}/payments/search | Rechercher des paiements. |
HelloAssoApi.PaiementsApi | paymentsPaymentIdGet | GET /payments/{paymentId} | Obtenir les informations détaillées d'un paiement. |
HelloAssoApi.PaiementsApi | paymentsPaymentIdRefundPost | POST /payments/{paymentId}/refund | Rembourser un paiement. |
HelloAssoApi.PartenairesApi | partnersMeApiClientsPut | PUT /partners/me/api-clients | Mise Ă jour du domaine |
HelloAssoApi.PartenairesApi | partnersMeApiNotificationsDelete | DELETE /partners/me/api-notifications | Suppression de l'URL de notification principale |
HelloAssoApi.PartenairesApi | partnersMeApiNotificationsOrganizationsOrganizationSlugDelete | DELETE /partners/me/api-notifications/organizations/{organizationSlug} | Suppression d'une URL de notification liée à une organisation |
HelloAssoApi.PartenairesApi | partnersMeApiNotificationsOrganizationsOrganizationSlugPut | PUT /partners/me/api-notifications/organizations/{organizationSlug} | Mise à jour d'une URL de notification liée à une organisation |
HelloAssoApi.PartenairesApi | partnersMeApiNotificationsPut | PUT /partners/me/api-notifications | Mise Ă jour de l'URL de notification principale |
HelloAssoApi.PartenairesApi | partnersMeGet | GET /partners/me | Récupération des informations |
HelloAssoApi.PartenairesApi | partnersMeOrganizationsGet | GET /partners/me/organizations | Obtenir toutes les organisations |
HelloAssoApi.TagsApi | tagsTagNameGet | GET /tags/{tagName} | Obtenir le détail d'un tag interne |
HelloAssoApi.TaxReceiptApi | organizationsOrganizationSlugTaxReceiptConfigurationGet | GET /organizations/{organizationSlug}/tax-receipt/configuration | |
HelloAssoApi.TaxReceiptApi | organizationsOrganizationSlugTaxReceiptConfigurationPut | PUT /organizations/{organizationSlug}/tax-receipt/configuration | |
HelloAssoApi.TaxReceiptApi | organizationsOrganizationSlugTaxReceiptPreviewPost | POST /organizations/{organizationSlug}/tax-receipt/preview | |
HelloAssoApi.UtilisateursApi | usersMeOrganizationsGet | GET /users/me/organizations | Obtenir mes organisations |
- HelloAssoApi.HelloAssoApiV5ModelsAccountCompanyLegalStatusModel
- HelloAssoApi.HelloAssoApiV5ModelsAccountOrganismCategoryModel
- HelloAssoApi.HelloAssoApiV5ModelsAccountsClientsApiClientModel
- HelloAssoApi.HelloAssoApiV5ModelsAccountsClientsPublicPutApiClientRequest
- HelloAssoApi.HelloAssoApiV5ModelsApiNotificationsApiNotificationType
- HelloAssoApi.HelloAssoApiV5ModelsApiNotificationsApiUrlNotificationModel
- HelloAssoApi.HelloAssoApiV5ModelsApiNotificationsPostApiUrlNotificationBody
- HelloAssoApi.HelloAssoApiV5ModelsCartsCheckoutIntentResponse
- HelloAssoApi.HelloAssoApiV5ModelsCartsCheckoutPayer
- HelloAssoApi.HelloAssoApiV5ModelsCartsCheckoutTerm
- HelloAssoApi.HelloAssoApiV5ModelsCartsInitCheckoutBody
- HelloAssoApi.HelloAssoApiV5ModelsCartsInitCheckoutResponse
- HelloAssoApi.HelloAssoApiV5ModelsCommonContactModel
- HelloAssoApi.HelloAssoApiV5ModelsCommonDocumentModel
- HelloAssoApi.HelloAssoApiV5ModelsCommonMetaModel
- HelloAssoApi.HelloAssoApiV5ModelsCommonPaginationModel
- HelloAssoApi.HelloAssoApiV5ModelsCommonPlaceModel
- HelloAssoApi.HelloAssoApiV5ModelsDirectoryDirectoryOrganizationPublicModel
- HelloAssoApi.HelloAssoApiV5ModelsDirectoryListFormsRequest
- HelloAssoApi.HelloAssoApiV5ModelsDirectoryListOrganizationsRequest
- HelloAssoApi.HelloAssoApiV5ModelsDirectoryPartnerOrganizationModel
- HelloAssoApi.HelloAssoApiV5ModelsDirectorySynchronizableFormModel
- HelloAssoApi.HelloAssoApiV5ModelsDirectorySynchronizableOrganizationModel
- HelloAssoApi.HelloAssoApiV5ModelsEnumsFieldType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsFormState
- HelloAssoApi.HelloAssoApiV5ModelsEnumsFormType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsItemState
- HelloAssoApi.HelloAssoApiV5ModelsEnumsMembershipValidityType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsOperationState
- HelloAssoApi.HelloAssoApiV5ModelsEnumsOrganizationType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsPaymentCashOutState
- HelloAssoApi.HelloAssoApiV5ModelsEnumsPaymentFrequencyType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsPaymentMeans
- HelloAssoApi.HelloAssoApiV5ModelsEnumsPaymentProviderType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsPaymentState
- HelloAssoApi.HelloAssoApiV5ModelsEnumsPaymentType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsPriceCategory
- HelloAssoApi.HelloAssoApiV5ModelsEnumsRecordActionType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsSortField
- HelloAssoApi.HelloAssoApiV5ModelsEnumsSortOrder
- HelloAssoApi.HelloAssoApiV5ModelsEnumsTagType
- HelloAssoApi.HelloAssoApiV5ModelsEnumsTierType
- HelloAssoApi.HelloAssoApiV5ModelsFormsFormBasicModel
- HelloAssoApi.HelloAssoApiV5ModelsFormsFormLightModel
- HelloAssoApi.HelloAssoApiV5ModelsFormsFormPublicModel
- HelloAssoApi.HelloAssoApiV5ModelsFormsFormQuickCreateModel
- HelloAssoApi.HelloAssoApiV5ModelsFormsFormQuickCreateRequest
- HelloAssoApi.HelloAssoApiV5ModelsFormsTermModel
- HelloAssoApi.HelloAssoApiV5ModelsFormsTierLightModel
- HelloAssoApi.HelloAssoApiV5ModelsFormsTierPublicModel
- HelloAssoApi.HelloAssoApiV5ModelsOrganizationLegalInformationsOrganizationLegalStructuresModel
- HelloAssoApi.HelloAssoApiV5ModelsOrganizationLegalInformationsUpdateOrganizationLegalInformationConfigurationBody
- HelloAssoApi.HelloAssoApiV5ModelsOrganizationOrganizationBasicModel
- HelloAssoApi.HelloAssoApiV5ModelsOrganizationOrganizationLightModel
- HelloAssoApi.HelloAssoApiV5ModelsOrganizationOrganizationModel
- HelloAssoApi.HelloAssoApiV5ModelsPartnerStatisticsModel
- HelloAssoApi.HelloAssoApiV5ModelsPartnersPartnerPublicModel
- HelloAssoApi.HelloAssoApiV5ModelsPaymentPublicPaymentModel
- HelloAssoApi.HelloAssoApiV5ModelsPaymentRefundOperationModel
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsItem
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsItemCustomField
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsItemDetail
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsItemDiscount
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsItemOption
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsItemPayment
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsOrder
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsOrderAmountModel
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsOrderDetail
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsOrderItem
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsOrderLight
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsOrderPayment
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsPayer
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsPayment
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsPaymentDetail
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsPaymentItem
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsRefundOperationLightModel
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsShareItem
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsSharePayment
- HelloAssoApi.HelloAssoApiV5ModelsStatisticsUser
- HelloAssoApi.HelloAssoApiV5ModelsTagsInternalTagModel
- HelloAssoApi.HelloAssoApiV5ModelsTagsPublicTagModel
- HelloAssoApi.HelloAssoModelsAccountsOrganizationLegalInformationsFiscalReceiptFormatOptionModel
- HelloAssoApi.HelloAssoModelsAccountsOrganizationLegalInformationsFiscalReceiptSignatoryModel
- HelloAssoApi.HelloAssoModelsAccountsOrganizationLegalInformationsOrganizationFiscalReceiptOptionsConfiguration
- HelloAssoApi.HelloAssoModelsAccountsOrganizationLegalInformationsOrganizationLegalInformationConfiguration
- HelloAssoApi.HelloAssoModelsAccountsOrganizationLegalInformationsTaxInformationText
- HelloAssoApi.HelloAssoModelsComplianceV2CommonAddressAddressModelSnapshot
- HelloAssoApi.HelloAssoModelsEnumsGlobalRole
- HelloAssoApi.HelloAssoModelsSharedGeoLocation
- HelloAssoApi.ResultsWithPaginationModelFormLightModel
- HelloAssoApi.ResultsWithPaginationModelItem
- HelloAssoApi.ResultsWithPaginationModelOrder
- HelloAssoApi.ResultsWithPaginationModelPartnerOrganizationModel
- HelloAssoApi.ResultsWithPaginationModelPayment
- HelloAssoApi.ResultsWithPaginationModelPublicPaymentModel
- HelloAssoApi.ResultsWithPaginationModelSynchronizableFormModel
- HelloAssoApi.ResultsWithPaginationModelSynchronizableOrganizationModel
We use OAuth2 for authentication, so to avoid reinventing the wheel, we recommend using the simple-oauth2 package
Install the simple-oauth2 package:
npm i simple-oauth2
const { ClientCredentials } = require('simple-oauth2');
// Create the client credentials instance
const client = new ClientCredentials({
client: {
id: 'your_client_id',
secret: 'your_client_secret',
},
auth: {
tokenHost: 'https://api.helloasso.com',
tokenPath: '/oauth2/token',
},
});
// Get an access token
async function getAccessToken() {
try {
const token = await client.getToken();
console.log('Access Token:', token.token);
return token.token;
} catch (error) {
console.error('Error getting access token:', error.message);
}
}
// Usage
getAccessToken();
const { AuthorizationCode } = require('simple-oauth2');
// Create the authorization code instance
const client = new AuthorizationCode({
client: {
id: 'your_client_id',
secret: 'your_client_secret',
},
auth: {
tokenHost: 'https://api.helloasso.com',
tokenPath: '/oauth2/token',
},
});
// Refresh the token
async function refreshAccessToken(refreshToken) {
try {
const tokenObject = client.createToken({ refresh_token: refreshToken });
const newToken = await tokenObject.refresh();
console.log('New Access Token:', newToken.token);
return newToken.token;
} catch (error) {
console.error('Error refreshing token:', error.message);
}
}
// Usage
refreshAccessToken('your_refresh_token');
const { AuthorizationCode } = require('simple-oauth2');
const crypto = require('crypto');
// Create the authorization code instance
const authorisationClient = new AuthorizationCode({
client: {
id: 'your_client_id',
secret: 'your_client_secret',
},
auth: {
tokenHost: 'https://auth.helloasso.com/',
authorizePath: '/authorize',
},
});
const tokenClient = new AuthorizationCode({
client: {
id: 'your_client_id',
secret: 'your_client_secret',
},
auth: {
tokenHost: 'https://api.helloasso.com/',
tokenPath: '/oauth2/token'
},
});
// Generate a Code Verifier and Code Challenge
function generatePKCE() {
const codeVerifier = crypto.randomBytes(32).toString('hex'); // Create a random string
const codeChallenge = crypto
.createHash('sha256')
.update(codeVerifier)
.digest('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=+$/, ''); // Base64 URL encode
return { codeVerifier, codeChallenge };
}
// Step 1: Generate the authorization URL
function getAuthorizationUrl() {
const { codeVerifier, codeChallenge } = generatePKCE();
const authorizationUri = client.authorizeURL({
redirect_uri: 'https://your-app.com/callback',
state: 'random_state_string',
code_challenge: codeChallenge,
code_challenge_method: 'S256',
});
console.log('Authorization URL:', authorizationUri);
console.log('Code verifier:', codeVerifier);
// Save the codeVerifier for later (e.g., in session or database)
return { authorizationUri, codeVerifier };
}
// Step 2: Exchange the authorization code for an access token
async function getAccessTokenFromCode(authorizationCode, codeVerifier) {
try {
const token = await tokenClient.getToken({
code: authorizationCode,
redirect_uri: 'https://your-app.com/callback',
code_verifier: codeVerifier
});
console.log('Access Token:', token.token);
return token.token;
} catch (error) {
console.error('Error getting access token:', error.message);
}
}
// Usage
const { authorizationUri, codeVerifier } = getAuthorizationUrl();
// After user authorizes, exchange the code (passed in the redirect URL callback)
// getAccessTokenFromCode('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.JavascriptClientCodegen