Finish authorization (non-localhost callback)
exchange_codeCompletes Withings OAuth by exchanging a redirected URL or authorization code for tokens saved to a local file, enabling CLI authorization when the callback isn't localhost.
Instructions
Finishes the one-time authorization when the callback URL is not on localhost: pass the full URL the browser was redirected to (or just its code). Withings codes expire after 30 seconds and work once, so the CLI (node server/cli.mjs authorize) is easier. Saves the tokens to the local token file (chmod 600); never returns them.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"redirect_url_or_code": "<redirect_url_or_code>"
},
"name": "exchange_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| redirect_url_or_code | Yes | The URL you were redirected to (contains ?code=...&state=...), or the code itself. |