Overview
This node integrates with the Apprecio API to perform various operations related to user points and gift cards. Specifically, for the "Consulta Gift Card" operation, it allows users to query detailed information about a specific gift card by its ID. This is useful in scenarios where you need to verify the status, balance, or other details of a gift card within automated workflows.
Practical examples include:
- Checking the validity or remaining balance of a gift card before processing a transaction.
- Automating customer support queries about gift card details.
- Integrating gift card information retrieval into loyalty or rewards systems.
Properties
| Name | Meaning |
|---|---|
| ID Gift Card | The unique identifier of the gift card to be queried. |
Output
The node outputs a JSON object containing the response from the Apprecio API regarding the gift card information. The exact structure depends on the API response but typically includes details such as gift card status, balance, expiration, and other metadata.
If the API returns binary data (not indicated in this code), it would be handled accordingly, but this node primarily deals with JSON responses.
Dependencies
- Requires an API key credential for the Apprecio API, including:
- A public token
- A private token
- The base API URL (defaulting to
https://apiv2.dcanje.com/apiif not provided)
- Uses the
axioslibrary for HTTP requests. - Uses
cryptofor generating MD5 hashes required for API authentication. - Uses
form-datato format POST request payloads as multipart/form-data.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Incorrect or non-existent gift card IDs will result in API errors indicating the gift card was not found.
- Network connectivity problems can prevent reaching the Apprecio API endpoint.
Error messages:
"Error de la API de Apprecio: <message>": Indicates the API responded with an error message. Check the gift card ID and credentials."No se recibió respuesta de la API de Apprecio": The request was sent but no response was received. Verify network connectivity and API availability."Error al realizar la solicitud: <message>": General request failure, possibly due to misconfiguration or network issues.
To resolve these errors:
- Ensure API credentials are correctly configured in n8n.
- Verify the gift card ID is valid and exists.
- Check network access to the API endpoint.
- Review API documentation for any changes or additional requirements.
Links and References
- Apprecio API Documentation (assumed base URL; consult actual docs for details)
- Axios HTTP Client
- Node.js Crypto Module
- FormData npm package