Using the GetSubscriptionId Web Method
3 min
returns the subscription id corresponding to the request offering for the current user request syntax publicfrsheatgetsubscriptionidresponse getsubscriptionid(string sessionkey, string tenantid, string name) parameters sessionkey the session key from the connect web method tenantid the tenant for which the session key is authenticated name the name of the request offering return value frsheatgetsubscriptionidresponse object, defined as follows public class frsheatgetsubscriptionidresponse { public string status { get; set; } public string exceptionreason { get; set; } public string subscriptionid { get; set; } } the frsheatgetsubscriptionidresponse 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 subscriptionid contains the subscription id corresponding to the request offering for the current user 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 subscription id of the specified request offering this is contained in the subscriptionid field notfound the tenant does not contain a request offering with the specified name ensure that the name of the request offering is spelled correctly 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 frsheatgetsubscriptionidresponse subscriptionidresponse = frsvc getsubscriptionid(authsessionkey, tenantid, offeringname); string offeringname = "domain password reset"; if (subscriptionidresponse status == "success") { string subscriptionid = subscriptionidresponse subscriptionid; console writeline("the subscription id for the \\" \\" request offering is ", offeringname, subscriptionid); }
