1. Home
  2. Docs
  3. Custom API
  4. Variables

Variables

In DigiXport, if you want to save the queries, most of the configuration is saved in the Saved Queries sheet. So if you are using custom api where you need to pass api key or secret key or any other credentials, they will also be stored in the sheet.

If the addon is used by multiple users in the organization, then exposing those credentials in the sheet will be too risky. 

To counter this, you can use environment variables, you can follow the steps below to get started.

How to set up environment variables?

  • You can click on the “+Add variables” link at the bottom of the headers field.

customapi_variables_link

  • Once clicked, a new modal named “Environment variables” will open up. 
  • Now you can enter the variable name at the left box and the key in the right box.

customapi_variables_ui

  • Once done, you can click on save
  • Now you can refer these credentials as variables within double curly braces. (Eg: {{token}}, {{api_key}} as in the above image)

 

Where can we use these environment variables?

The environment variables can be used in the following fields

  • API Url
  • Headers
  • Authorization Fields
  • Request Payload

customapi_variables_used_in_fields

Leave a Reply

Your email address will not be published. Required fields are marked *