I’m still a newcomer with Corvid.
I’m trying to write to a collection from an external app via HTTPS-PUT requests.
The collection has the following columns (all Text Fields and Form Submission permissions are set):
“Signal”,“Symbol”,“Company”,“Order Type”,“Timestamp”,“System”
Now I’m not sure if my JSON object is correct in this form (error is WD_VALIDATION_ERROR).
Made some further Tests with a Test Collection which has a single Text field holding a stock symbol.
Here’s the complete backend HTTP function:
export function put_updateTest(request) {
let options = {
"headers": {"Content-Type": "application/json"}
};
// get the request body
return request.body.text()
.then( (body) => {
// update the item in a collection
return wixData.update("Test", JSON.parse(body));
} )
.then( (results) => {
options.body = {
"inserted": results
};
return ok(options);
} )
// something went wrong
.catch( (error) => {
options.body = {
"error": error
};
return serverError(options);
} );
}
It seems to stuck on the Wix backend side. The error comes at least from this direction. The GET request works fine (if I change the permissions) but the PUT request has this WD_VALIDATION_ERROR Issue.
Did you get this working in the end? I’ve got an (almost) identical issue, and despite multiple issues of this nature here on the forums, I haven’t seen any solution as of yet…