cancel
Showing results for 
Search instead for 
Did you mean: 

How to send a REST call from Alfresco to another web application?

h_john
Champ on-the-rise
Champ on-the-rise

I`m trying to communicate with another web application using Alfresco.

I need to take some properties from Alfresco node and send them like a HTTP request to a service named "Binotel"

Can some one help me to create in Alfresco something like this:

https://api.binotel.com/api/2.0/customers/create.json
- содержимое: {"name":John, "numbers":0672361256", "description":Customer, "email":john@_____.com, "assignedToEmployeeNumber":901, signature":"51188e42ba9ee47699699","key":"6pf4-7o"}

How I have a JS which collect data from a node properties

var name = document.properties["zkz:Zayavitel"];
var number = document.properties["zkz:Telefone"];
var description = document.properties["zkz:Rezult"];
var emplnum = document.properties["zkz:Managernum"];
var email = document.properties["zkz:Email"];
But I do not know how to put them into a http request and send to Binotel service.
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

Repository-side JavaScript has - by default - no capabilities to send any HTTP requests. You would have to either write some Java-backed Script API objects to provide this capability yourself or try to use the Java-interoperability features of the JavaScript engine to use Java HTTP capabilities directly.