Using the GetAllTemplates Web Method
3 min
returns the full list of request offerings in the service catalog request syntax publicfrsheatgettemplatesresponse getalltemplates(string sessionkey, string tenantid) parameters sessionkey the session key from the connect web method tenantid the tenant for which the session key is authenticated return value frsheatgettemplatesresponse object, defined as follows public classfrsheatgettemplatesresponse { public string status { get; set; } public string exceptionreason { get; set; } public list\<frsheatservicereqtemplatelistitem> srtlist { get; set; } } the frsheatgettemplatesresponse class has the following fields status provides a status about the state of the connection the table below contains a full description of the available status values exceptionreason contains exception information, if the application throws an exception when running this web method srtlist contains a list of frsheatservicereqtemplatelistitem objects, each of which represents the request offering matching the search criteria the frsheatservicereqtemplatelistitem class is defined as follows public class frsheatservicereqtemplatelistitem { public string strrecid; public string strname; public string strdescription; public string strsubscriptionid; } the frsheatservicereqtemplatelistitem class has the following fields strrecid the recid corresponding to the request offering strname the name of the request offering strdescription the description for the request offering strsubscriptionid the subscription id the following table lists the available status values and describes how to interpret them \<font color="#ffffff">status\</font>\<font color="#ffffff">explanation\</font> success successfully retrieved the list of request offerings in the service catalog this list is available in the srtlist field error an error was encountered during the execution of this web method inspect the corresponding exceptionreason field to determine why the web method has failed example frsheatgettemplatesresponse gettemplatesresponse = frsvc getalltemplates(authsessionkey, tenantid); if (gettemplatesresponse status == "success") { foreach (frsheatservicereqtemplatelistitem srtemplatelistitem in gettemplatesresponse srtlist) { console writeline("request offering ", srtemplatelistitem strsubscriptionid, srtemplatelistitem strname); } }
