Oscar Silva
Posts: 0
Joined: Mon Feb 09, 2015 9:26 pm

Calling Rest Service from Outside Server

Hi,

I'm new to appery, and what i'm trying to do is this: i want to call a REST Service for push notifications from a server (outside appery).

I've read some tutorials but the examples includes calling from the console, or from another app, in this case, the server is not in the same domain.

I have also read that it is possible to make a service call from a js function (inside an appery app), so i figure if i can make a remote function call it should work.

Thanks in advance for your help.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Calling Rest Service from Outside Server

Hi Oscar,

Here is a code example:

pre

var pushAPIKey = "d8387f9b-d59xxxxxxxx7663f4c956c3";
var payload = {
"message": "tEST 1",
"badge": 1
};
var filter = {
"deviceID":"99000117xxxxxxxx178efcda1"
};
PN.send(pushAPIKey, payload, filter);

/pre

Regards.

Oscar Silva
Posts: 0
Joined: Mon Feb 09, 2015 9:26 pm

Calling Rest Service from Outside Server

Hi Yurii, thanks alot for your reply, it worked great.

Best regards!

Oscar Silva
Posts: 0
Joined: Mon Feb 09, 2015 9:26 pm

Calling Rest Service from Outside Server

Hi Yurii, the TI guy asks me, which port has to be open in the server making the call to the url of the REST service.

Thanks in advance!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Calling Rest Service from Outside Server

Hello!

It's 443 port, https.

Oscar Silva
Posts: 0
Joined: Mon Feb 09, 2015 9:26 pm

Calling Rest Service from Outside Server

Thanks Maryna!.

Regards,

Return to “Issues”