Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to connect with cloudflare API #4

Open
ligol opened this issue Sep 6, 2019 · 8 comments
Open

Not able to connect with cloudflare API #4

ligol opened this issue Sep 6, 2019 · 8 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@ligol
Copy link
Contributor

ligol commented Sep 6, 2019

When I put the Clouflare Api Key, I got that error

cannot get upstream records: error from makeRequest: HTTP status 400: content "{"success":false,"errors":[{"code":6003,"message":"Invalid request headers","error_chain":[{"code":6111,"message":"Invalid format for Authorization header"}]}],"messages":[],"result":null}"

Any idea where it could come from?

@siennathesane
Copy link
Owner

I have no idea, sorry. Can you provide some steps on how you got your API key from Cloudflare? My API key has Zone edit permissions, that might be a cause? Howe old is your API key?

@ligol
Copy link
Contributor Author

ligol commented Sep 6, 2019

With this key, i got "cannot get upstream records: error from makeRequest: HTTP status 403: insufficient permissions"
Capture d’écran 2019-09-06 à 20 52 09

@siennathesane
Copy link
Owner

On your API key, if you click the dropdown box, there's a View Summary option, can you click it and verify it has this permission?

image

That's the permission my API key has, and it works for me. Maybe @jgrahamc can connect us with someone that can help if that's not the case. I'm not an expert in their permissions, sorry!

@siennathesane siennathesane self-assigned this Sep 6, 2019
@siennathesane siennathesane added bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed labels Sep 6, 2019
@ligol
Copy link
Contributor Author

ligol commented Sep 7, 2019

Yes it has that permission. Concerning the ZoneId, you found it in the web url while being on the dns tab of the cloudflare website right?

@ligol
Copy link
Contributor Author

ligol commented Sep 7, 2019

Okay, I found the issue, I'm sorry, my ZoneId was incorrect, I thought it was the key on the url but it seems not.

Maybe the documentation could be improved to tell where is the ZoneId located on cloudflare website.
Or maybe the project could add the option to auto discover the ZoneId by calling the ZoneIDByName method.

I could make a PR for that if you want.

@siennathesane
Copy link
Owner

Or maybe the project could add the option to auto discover the ZoneId by calling the ZoneIDByName method.

Sure, if you want to make a PR for it, that'd be great. :)

@yaazkal
Copy link

yaazkal commented Sep 9, 2019

Hi, I got the same issue. I've checked that the zone id is correct.

In some way the request is malformed as the HTTP 400 suggest.

@siennathesane
Copy link
Owner

So I made a massive update recently, and I'm also getting the HTTP 400 errors, but I'm not 100% sure why. I did some debugging but I didn't see anything that stood out. I'll keep an eye on it, but if you could try the most recent update, that'd be great. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants