Service Manager
Using the GetAllTemplates Web Method
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.
Status |
Explanation |
---|---|
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: {0} {1}", srTemplateListItem.strSubscriptionId, srTemplateListItem.strName);
}
}
Was this article useful?
Copyright © 2020, Ivanti. All rights reserved.