HTTP Request Node returning 403

I’m attempting to send a GET request to the Discogs API using the HTTP Request Node. When I send the request, I get a 403 Forbidden response. The URL does not require authorization, and when I send the GET through Postman I get a 200 response. Has anyone ran into an issue like this before?

URL Sent (I have tried both https and http):
GET https://api.discogs.com/users/PurelyNicole/collection/folders

Response:

{
  "_msgid":"9b6369ee.629e58",
  "topic":"",
  "payload":"Forbidden\n",
  "statusCode":403,
  "headers":{
    "date":"Tue, 12 Nov 2019 18:17:12 GMT",
    "content-type":"text/html",
    "transfer-encoding":"chunked",
    "connection":"close",
    "vary":"Accept-Encoding, Accept-Encoding",
    "strict-transport-security":"max-age=15724800",
    "x-node-red-request-node":"d22b46ac"
  },
  "responseUrl":"https://api.discogs.com/users/PurelyNicole/collection/folders",
  "redirectList":[]
}

In case anyone else runs into this issue, I the issue was there was no User-Agent set in the header and the Discogs API was rejecting the request because of that. I was able to fix this by adding a header following the example in the Node-RED Cookbook.

1 Like