I must be stupid…I’m staring at the user_id
and, as far as I know, the syntax is correct. What am I doing wrong here??
const body = {
"user_id": "9876", //test user
"duration": 30,
"reason": "no reason"
}
fetch(timeoutUrl, {
method: 'POST',
headers: {
'Client-ID': 'xxx',
'Authorization': 'Bearer xxx',
'Content-Type': 'application/json',
},
body: JSON.stringify(body)
}).then(res => res.json())
.then(json => console.log(json));
Here’s what I get on the response:
{
error: 'Bad Request',
status: 400,
message: 'Missing required parameter "user_id"'
}
I’ve tried putting the user_id
in every conceivable combination within the parameters with no luck. Any thoughts? Thank you for your time.