[TIP] User Token API Permissions #104
Replies: 4 comments 3 replies
-
I created my API token with these permissions, but I still get |
Beta Was this translation helpful? Give feedback.
-
Could you elaborate what the hostname should be while entering the ddns information in the unifi controller? Is it the domain name from Cloudflare? I am getting this error in my worker log. "Error updating DNS record: The "hostname" parameter is required and cannot be empty." |
Beta Was this translation helpful? Give feedback.
-
This was very helpful for creating the worker. It might have been obvious to others but it wasn't to me. You can't use this API Token as the password in the Unifi dialog, you have to create a different one that only permits the dns zone edit. I have multiple zones in my profile, and when I used the token that I created the worker with, it failed saying it couldn't figure out the right zone. So create a new token, that only has the dns zone edit permission, and use that for the password and it will work. |
Beta Was this translation helpful? Give feedback.
-
@Francis-Gurr did you ever resolve the "Internal Server Error" issue? I'm encountering the same thing with a fresh install of the latest and greatest. If I run curl -v I see a more detailed error from cloudflare: "Error updating DNS record: InvalidCharacterError: atob() called with invalid base64-encoded data. (Only whitespace, '+', '/', alphanumeric ASCII, and up to two terminal '=' signs when the input data length is divisible by 4 are allowed.)" |
Beta Was this translation helpful? Give feedback.
-
This API token will affect the below accounts and zones, along with their respective permissions
- Workers KV Storage:Edit, Workers Scripts:Edit
- Zone:Read, DNS:Edit
All users - Memberships:Read, User Details:Read
When creating a custom token:
Account - Workers KV Storage - Edit
Account - Workers Scripts - Edit
User - Memberships - Read
User - User Details - Read
Zone - Zone - Read
Zone - DNS - Edit
Need to get Account ID from the Domain page under API.
Sharing this so that others can deploy successfully as well.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions