How to access RunMyProcess resource with JQuery
Access RunMyProcess resources using jQuery
Example: access the content of a RunMyProcess custom list.
Go to the custom list view, click on the custom list to access, you'll get its url:
The full url is https://live.runmyprocess.com/ + the suffix url above.
If you enter the full url in the url bar of your browser, you'll get
Now, you know the path to access the content of the list : feed > entry > content > decode the content
To access to access and parse this feed:
-
Include jQuery library as a resource in your Web Interface.
-
Use the following Javascript code:
Code
var rmp_login = your_rmp_login;
var rmp_password = your_rmp_password;
var auth='Basic '+Base64.encode (rmp_login+':'+rmp_password);
var url_rmp_resource = url_of_the_custom_list;
//example : "https://live.runmyprocess.com/live/123456789/data/a7cb4d30-201b-11e1-aeed-123139225512";
$.ajax({
type:"GET"
,url: url_rmp_resource
,data:{}
,cache:false
,dataType: "xml"
, success: xml_parser
,beforeSend: function(xhr){
xhr.setRequestHeader('Content-Type', 'application/xml+atom');
xhr.setRequestHeader('Authorization', auth);
xhr.setRequestHeader('Accept', 'application/xml');
}
});
function xml_parser(xml) {
var rmp_list = $(xml).find("feed").find("entry").find("content").text();
alert(rmp_list);
}
Will return the content of the list
{"list":[{"label":"France","value":"fr"}]}
Please give details of the problem