Appframe Knowledge Base


1 hits
3

Using Rest API to execute a procedure in Pims

Example of how to use the RestAPI to execute a procedure in Pims: function execProcOnAPI(){ var vData = { "Timeout": 30, "AwaitResult": true, "@DocumentType": "AA", "@Title": "Sample Doc", "@DocGroup": "Administrative", "@FacilityID":"A", "@OriginatorCompany":"AOGD", "@Discipline": "A", "@NewDocumentID":"", "@AddSheetNo":false, "@ContractNo":null, "@WorkPackID":null, "@SubProjectID":null, "@System":null, "@Area":null, "@PONumber":null }; jQuery.ajax({ url: "https://api.pimsdevhosting.com/procedure/dcsCreateNewDocumentID/call", data: JSON.stringify(vData), contentType: "application/json", dataType: "json", type: "POST", beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", "Basic " + btoa("UserName" + ":" + "Password")); }, success: function(resultData) { //here is your json. console.log(resultData); }, error : function(jqXHR, textStatus, errorThrown) { console.log(errorThrown); }, timeout: 120000 }); }

rest api web · Perma link post comment Posted by: Johnny Vik (10-jun-2015)