Page 1 of 1

Calling Rest Service from Outside Server

Posted: Mon Feb 09, 2015 9:26 pm
by Oscar Silva

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.


Calling Rest Service from Outside Server

Posted: Tue Feb 10, 2015 6:04 am
by Yurii Orishchuk

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.


Calling Rest Service from Outside Server

Posted: Tue Feb 10, 2015 2:15 pm
by Oscar Silva

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

Best regards!


Calling Rest Service from Outside Server

Posted: Tue Feb 10, 2015 8:08 pm
by Oscar Silva

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!


Calling Rest Service from Outside Server

Posted: Wed Feb 11, 2015 10:19 am
by Maryna Brodina

Hello!

It's 443 port, https.


Calling Rest Service from Outside Server

Posted: Thu Feb 12, 2015 7:17 pm
by Oscar Silva

Thanks Maryna!.

Regards,