Hello,
Using this WIX code in the http-function:
// Submission Test
let swiftList = “SwiftSubmissionTest” ;
export function post_swiftsubmissionapi ( request ) {
const response = {
“headers” : {
“Content-Type” : “application/json” ,
}
};
// Get name of Data Collection from path[0]
let swiftCollection = request.path [ 0 ]; // “DummyData”
if ( swiftList . includes ( swiftCollection )) {
return wixData . insert ( swiftCollection )
//.limit(1000)
//.find()
. then ( async ( apiResults ) => {
const swifttItem = apiResults.items [ 0 ]
**if** ( apiResults.totalCount > 0 ) {
response.body = {
"id" : swifttItem._id ,
"firstName" : swifttItem.firstName ,
"lastName" : swifttItem.lastName
};
**return** ok ( response );
}
response.body = {
"items" : "No items found in the collection."
};
**return** ok ( response );
})
}
response.body = {
“error” : “Data Collection is not allowed to be used through this API.”
};
return badRequest ( response );
}
I get the following error in XCODE for IOS:
“x-wix-code-user-error-details” = (
“{"isUserError":true,"code":"WD_VALIDATION_ERROR"}”
);
“x-wix-function-user-error” = (
“source=exception”
);
“x-wix-request-id” = (
“1670674501.2583154886188935”
);
Please help as I need to be able to populate my WIX database with from my IOS app. Its been an ongoing issue, so its a bit a of an emergency now. I like WIX but is I don’t get this issue resolved we will have to go fully IOS without the use of an integrated web solution. Your help will be highly appriciated. I’m sure every IOS developer would love to get this info as I don’t see a solution anywhere-else on the web. This would be huge for us.
Thanks in advance!