New request method and templates not sending Authorization header

Hi there,

I’m developing a Freshdesk app using platform version 2.3 and FDK 9.0.2. When using the Request method and request templates while running the app locally the Authorization header is not being passed through (testing using requestbin). When I upload the same app code as a custom app (not running locally) the Authorization header is being sent.

Example code:

iparams.json

"api_key": {
  "display_name": "API key",
  "description": "The API key secret",
  "type": "text",
  "required": true,
  "secure": true,
  "default_value": "..."
}

requests.json

{
  "sampleGet": {
    "schema": {
      "method": "GET",
      "host": "xxx.m.pipedream.net",
      "path": "<%= context.endpoint %>",
      "headers": {
        "Authorization": "Bearer <%= iparam.api_key %>",
        "Content-Type": "application/json",
        "API-Version": "<%= iparam.api_version %>"
      }
    }
  }
}

app.js

let response = await client.request.invokeTemplate('sampleGet', {
  context: { ... }
});

The API-Version header comes through in both cases.

What am I doing wrong?

Hi Thanks for reaching out through our forum. So, we don’t handle Authorization header as special case and hence if its working for ‘API-Version’ it should ideally work for Authorization header too.
Can you please share how you confirmed that the header is passed when called once you deployed as a custom app and not while checking locally?
I tested things locally and it is working as expected

{
  "getData": {
    "schema": {
      "method": "GET",
      "protocol": "https",
      "host": "postman-echo.com",
      "path": "/get",
      "headers": {
        "Authorization": "Basic <%= iparam.apikey %>",
        "hello" : "hello"
      }
    },
    "options": {
      "isOAuth": false
    }
  }
}

I get the proper response with Authorization header

{
  "args": {},
  "headers": {
    "x-forwarded-proto": "https",
    "x-forwarded-port": "443",
    "host": "postman-echo.com",
    "x-amzn-trace-id": "Root=1-64ca2561-57078de036c03f3d6cc70b93",
    "authorization": "Basic abcd",
    "hello": "hello"
  },
  "url": "https://postman-echo.com/get"
}

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