Apprecio API icon

Apprecio API

Interactúa con la API de Apprecio

Overview

This node interacts with the Apprecio API to perform various user and points management operations. Specifically, for the "Consulta de Saldo de Usuario" (User Balance Inquiry) operation, it allows you to query the current points balance of a user by providing their user ID. This is useful in loyalty or rewards program scenarios where you need to check how many points a user has accumulated.

Practical Example:
You might use this node in an n8n workflow to automatically check a user's points balance before allowing them to redeem a reward, or to display their current balance in a notification email.


Properties

Name Type Meaning
ID Usuario String The unique identifier of the user whose points balance you want to query. This is required for the "Consulta de Saldo de Usuario" operation.

Output

  • The node outputs a json field containing the response from the Apprecio API.
  • The structure of the output depends on the API's response for the balance inquiry (saldo_usuario). Typically, this will include fields such as the user's ID and their current points balance, but the exact structure may vary according to the API specification.

Example output:

{
  "status": "success",
  "data": {
    "rut": "12345678-9",
    "saldo": 1500
  }
}

Note: Field names and structure may differ based on the actual API response.


Dependencies

  • External Service: Requires access to the Apprecio API endpoint.
  • Credentials: Needs an n8n credential named apprecioApi with at least:
    • apiUrl (optional, defaults to https://apiv2.dcanje.com/api)
    • publicToken
    • privateToken
  • Environment: No special environment variables are required beyond the credentials.

Troubleshooting

Common Issues:

  • Invalid Credentials: If the public or private token is incorrect, the API will reject the request.
  • Missing Required Property: If "ID Usuario" is not provided, the node will throw an error indicating that the property is required.
  • API Errors: If the Apprecio API returns an error (e.g., user not found), the node will return an error message from the API.

Error Messages:

  • Error de la API de Apprecio: ... — Indicates an error returned by the Apprecio API. Check the message for details (e.g., invalid user ID).
  • No se recibió respuesta de la API de Apprecio — No response was received; check network connectivity or API availability.
  • Error al realizar la solicitud: ... — A general error occurred during the HTTP request; check the error message for more information.

How to resolve:

  • Double-check your credentials and ensure they are correct.
  • Make sure the user ID exists in the Apprecio system.
  • Verify network connectivity to the API endpoint.

Links and References

Discussion