gettin this error when attempting to create a new user via API. Using express and bodyParser to parse form body, serialize it into JSON, and then send it to OKTA. tried various formats, but all the same. What am I missing?
'{"profile":
{
"firstName":"Peter",
"lastName":"Parker",
"email":"pparker@mailinator.com",
"login":"pparker@mailinator.com"
},
"groupIds":[
"00giqta1l0kbfK1QO0h7",
"00gj0t0ieicAW2Iss0h7"
]}'
my code:
req.body.user.profile.login = req.body.user.profile.email;
let data = JSON.stringify(req.body.user)
rp.post({
uri: `https://dev-451953.oktapreview.com/api/v1/users`,
json: true,
headers: {Authorization: `SSWS ${process.env.OKTA_TOKEN}`},
body: `'${data}'`
})
the error:
StatusCodeError: 400 -
{"errorCode":"E0000003",
"errorSummary":"The request body was not well-formed.",
"errorLink":"E0000003",
"errorId":"oaeus1TJwgrSI2dKIPypAmZVA",
"errorCauses":[]}