Run cloud code by URL only

47 views
Skip to first unread message

vell...@gmail.com

unread,
Dec 22, 2019, 4:21:59 AM12/22/19
to Back4App
Hi,
I have a social networking app where you can only specify a URL (no headers). How can I make a call to cloud code by URL only? 

Andrey.

Davi Macêdo

unread,
Dec 23, 2019, 2:24:24 AM12/23/19
to Back4App
You need to send a POST request to https://parseapi.back4app.com/functions/yourfunctionname, You will have to include your app id and rest key in the X-Parse-Application-Id and X-Parse-REST-Key headers.

vell...@gmail.com

unread,
Dec 29, 2019, 9:39:15 AM12/29/19
to Back4App
I know about that. But the problem is that I don't have the ability to add headers in this case. It is only possible to specify a clean URL.

понедельник, 23 декабря 2019 г., 10:24:24 UTC+3 пользователь Davi Macêdo написал:

Davi Macêdo

unread,
Jan 4, 2020, 2:50:48 PM1/4/20
to Back4App
You can also do a POST request to https://yourappid:javascript-key=yourjava...@yourcustomdomain.back4app.io/functions/yourfunctionname so you don't need to include the headers. You can enable your custom domain at ServerSettings -> Web Hosting.

vell...@gmail.com

unread,
May 9, 2020, 10:10:26 AM5/9/20
to Back4App
Thank you!

суббота, 4 января 2020 г., 22:50:48 UTC+3 пользователь Davi Macêdo написал:
You can also do a POST request to https://yourappid:javascript-key=yourjavascriptkey@yourcustomdomain.back4app.io/functions/yourfunctionname so you don't need to include the headers. You can enable your custom domain at ServerSettings -> Web Hosting.

vell...@gmail.com

unread,
Jun 12, 2020, 10:08:41 AM6/12/20
to Back4App
Hi all,
Now I have an incomprehensible problem. I call the code in the cloud using this POST request with https://yourappid:javascript-key=.. etc. 
It runs my function, but.. He doesn't go inside under any conditions. Only the last line of code is always executed.
The disabled code - is me because I didn't know what to do.

Parse.Cloud.define("Pay", function(request, response)
{
   // var userId = request.params.userId;

    var query = new Parse.Query("User");
   //query.equalTo("socialId", userId);
   query.limit(1);
   query.first({
       useMasterKey: true,
       success: function(userData)
        {
           response.success({"Result": "OK!"});
           return;
       }, error: function(error) {
           response.success({"Result": "FAILED!"});
           return;
       }
   });

    response.success({"Result": "WHAT??"});
   return;
});





воскресенье, 22 декабря 2019 г., 12:21:59 UTC+3 пользователь vell...@gmail.com написал:

суббота, 4 января 2020 г., 22:50:48 UTC+3 пользователь Davi Macêdo написал:
You can also do a POST request to https://yourappid:javascript-key=yourjavascriptkey@yourcustomdomain.back4app.io/functions/yourfunctionname so you don't need to include the headers. You can enable your custom domain at ServerSettings -> Web Hosting.

vell...@gmail.com

unread,
Jun 12, 2020, 10:34:58 AM6/12/20
to Back4App
okay, I think I'm stupid. It's alright. I need to rest sometimes..


пятница, 12 июня 2020 г., 17:08:41 UTC+3 пользователь vell...@gmail.com написал:
Reply all
Reply to author
Forward
0 new messages