×

Please give details of the problem

Skip to content

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:

2011-12-06_180553

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

2011-12-06_180046

(right click > get source code of the page under Firefox)

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:

Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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

1
{"list":[{"label":"France","value":"fr"}]}