Issue connecting to Bandwidth.com API with Basic Auth

I’ve just started having issues with connecting to the Bandwidth.com api (I’m on v189.1) and get a 401 error returned from their api. I’ve tested using the exact same api call and basic auth credentials. Below is the code of the node:

Here’s the working code from Postman with the same basic auth credentials:
GET /api/tns HTTP/1.1
Host: dashboard.bandwidth.com
Authorization: Basic base64encodedstring

Is there something that changed or that I’m missing? I’ve tried doing the auth via the Basic Auth dropdown and just by adding a Basic Auth header and get the same error.

Hi @jhambach, so connecting to this API works for you when using n8n’s basic auth, but not when manually specifying the header?

If so, you might want to simply sent the working request to a URL provided by a service like webhook.site, and then take a look at the exact request header (which you can then copy):

image

1 Like

Sorry if my post was confusing, it neither works when using the basic auth or when manually specifying the header. I’ve tried it both ways and get the same error, but Postman works just fine.

I’m sorry to hear that. Any chance you can export the curl command from your working postman request and share it with me (you can, of course, redact username + password)? This should help with checking what might be missing from the HTTP Request.