Update README.md

This commit is contained in:
rafal 2026-01-30 10:39:07 +00:00
parent f94c5fa921
commit 86e0a81f88

View File

@ -102,3 +102,36 @@ If exists: Checks if IP matches. If not, performs PUT (Update).
If missing: Performs POST (Create).
### ERROR
This error (400 Invalid API key format) means that the IONOS server rejected the key because its structure is incorrect.
The most common causes are:
Extra spaces (accidentally copied when pasting).
Manually adding a dot in the config file (the script adds the dot automatically).
Using the wrong type of key (Cloud API key instead of Hosting/DNS API key).
Here is how to fix it step by step.
```
sudo nano /opt/ionos-ddns/config.json
```
Make sure the quotation marks are placed directly against the characters, with no spaces.
WRONG (note the spaces):
```
"api_prefix": " 23498723498 ",
"api_secret": " a1b2c3d4 "
```
CORRECT:
```
"api_prefix": "23498723498",
"api_secret": "a1b2c3d4"
```
STEP 2: Do not add a dot in config.json
The Python script contains this line:
```
"X-API-Key": f"{prefix}.{secret}"
```
It automatically joins these two values with a dot.
If you entered in config.json something like:
prefix: "myPrefix."
then the script sends:
"myPrefix..secret" (two dots), which causes the error.
api_prefix: Only the first part of the key.
api_secret: Only the second, long part of the key.