1

API Usage -403 error

Trying to make a simple GET request, what am I doing wrong?

7 replies

null
    • iOS Developer
    • Rob
    • 1 yr ago
    • Reported - view

    The "reason" field in the the response explains it: you're not authenticated.

    And indeed; you have set "Authentication" to "None", so you're not passing your API key.

    https://nextdns.github.io/api/#authentication

    • galeej
    • 1 yr ago
    • Reported - view

    I did try that as well

     

      • iOS Developer
      • Rob
      • 1 yr ago
      • Reported - view

       This simple cURL works fine for me:

      curl -X GET -H "X-Api-Key: ..." "https://api.nextdns.io/profiles/..."
      
    • Mypi
    • 1 yr ago
    • Reported - view

    I am having the same exact issue with n8n workflow. Most likely it is related to this:

    https://help.nextdns.io/t/83hcmrr/nextdns-api-is-working-on-express-backend-but-not-on-react-frontend

    @nextdns would you able to chime in on this matter? 

    • NextDNs
    • 1 yr ago
    • Reported - view

    Please double check your API key. This error may indicate an incorrect key to access the resource requested.

      • Mypi
      • 1 yr ago
      • Reported - view

       I have checked the API key multiple times, copy pasted it and no dice on n8n workflow editor (http request is sent from browser). The API key works perfectly fine from CLI using curl. Question is, what takes? 🤔 I have checked the headers, x-api-key is correctly passer. Content-type is application/json. There is something about the http request that your API doesn't like, can it be encoding, followAllRedirects, gzip or something else? 

    • Mypi
    • 1 yr ago
    • Reported - view

    So, it seems it is n8n http request config issue. To resolve this on n8n, you need to specify Options > Response > Response Format = JSON. As it seems, by default n8n uses json: false flag on their http requests. 

Content aside

  • 1 Likes
  • 1 yr agoLast active
  • 7Replies
  • 146Views
  • 4 Following