Hi,
Need some help. I have to build a page on WIX to accept a call back submission from another system, which will be “accepting” POST calls similar to below. Please note, it’s “accepting” not “sending”. The value of “theToken” is a JWT token generated by the other system, they can also use user id/pwd, but I am not sure how to setup a page on WIX to accept POST submission.
return fetch(URL_on_wix,
{
method: ‘post’,
headers: {
‘Authorization’: 'Bearer '+theToken,
‘content-type’: ‘application/json’
},
body:
‘{“data1”: “1234”, “data2”:“5678” }’
})
.then( (httpResponse) => {
.....
});
I tried to setup a page that is hidden but permission still allows calls from everyone. If I create a simple test.html and submit to the URL, “wixLocation.query” picks up the parameters correctly and have no problem accessing the page directly from browser. However, if I use curl as below, keep getting 403 forbidden error, both with and without the token or user id/pwd provided. Any idea?
$ curl -X POST “https://xxxxxxx.wixsite.com/test1/testing” -H “Content-Type: application/json” -d ‘{“data1”:“1234”,“date2”:“5678”}’
403 Forbidden403 Forbidden
nginx/1.13.7
or
curl -X POST -F ‘username=helloworld’ -F ‘password=something’ “https://xxxxxxx.wixsite.com/test1/testing” -H “Content-Type: application/json”
403 Forbidden403 Forbidden
nginx/1.13.7