How do you Base64 encode api key with freshdesk Requests template

The authorization header for FreshDesk serverless app is as follows:

let base64Key=Buffer.from(payload.iparams.fd_api_key).toString('base64')
Authorization: Basic ${base64Key}

How do you do the same in the requests.json?

  "fdGet": {
    "schema": {
      "method": "GET",
      "path": "/api/v2<%= context.path %>",
      "host": "<%= iparam.fd_domain %>",
      "headers": {
        "Content-Type": "application/json",
        "Authorization": "Token token=<%= iparam.fd_api_key %>"
      }
    },
    "options": {
      "retryDelay": 1000,
      "maxAttempts": 5
    }
  },

Hello @stevemc ,

you have to use “encode()” like said in the documentation.

"Authorization": "Something <%= encode(iparam.validIparamName) %>"

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.