Page 1 of 1

How to call REST from javascript

Posted: Sat Jun 07, 2014 4:43 am
by B510

Dear All,

How to call REST from javascript .. I try codes below .. but it does not work..
what I missed?

function sendMail(to,cc,bcc,subject,body,attc)
{
var res;
res = this.rsSendMail.execute({to,cc,bcc,subject,body,attc});
}


How to call REST from javascript

Posted: Sat Jun 07, 2014 4:53 am
by Igor

Hello,

To invoke any service directly from JavaScript, you can use below code:
pre
serviceInstanceName.execute({});
/pre
where serviceInstanceName is the name of the service instance from Data view.

You can find a lot examples how to execute service with parameters on this forum.

This link may be helpful:
http://devcenter.appery.io/documentat...


How to call REST from javascript

Posted: Sat Jun 07, 2014 5:09 am
by B510

thanks, but how if I want to call the service with parameters?


How to call REST from javascript

Posted: Sat Jun 07, 2014 5:17 am
by Alena Prykhodko

Hello,

Most likely every tutorial has an example of such service execution http://devcenter.appery.io/tutorials/....
For instance,
pre

serviceInstanceName.execute({data:{object_id: task.id}});
/pre

Also this will be useful https://getsatisfaction.com/apperyio/...