|
Version: 7C
HC7 Build: 7.00.0012 and later
API Build: 1.00.0001 and later
Plan Manager -SetPlanDetails updates a specified plan. This web service call can be made as http://your-domain.com/HC7API/PlanManager.asmx?op=SetPlanDetails.
Input Parameters
HostUserName
HostPassword
OwnerName - user name under which you want to edit plan
PlanName - name of plan to be updated
OptionalParam
PlanDescription - detailed description of plan to be created
CancellationPolicy - detailed cancellation policy of plan to be created
Status
SetupPrice
PromotionalPrice
PromotionalDuration - duration in months i.e. 1,4,5
MonthlyRecurringPrice - price to be charged, if plan will be sold on monthly basis
QuarterlyRecurringPrice - price to be charged, if plan will be sold on quarterly basis
BiannualRecurringPrice - price to be charged, if plan will be sold on biannual basis
YearlyRecurringPrice - price to be charged, if plan will be sold on yearly basis
OtherRecurringDuration - any recurring duration other than mentioned above
OtherRecurringPrice - price to be charged, if plan will be sold for other recurring duration
DefaultDuration - duration to be selected when plan will be sold without user interaction like on Website/User Creation
ResourceList - list of resources to be updated
Language
Output Parameters
XML error report in case of Quota Violation embedded in Result Node of Response packet.
Sample Optional Parameters
<Parameters>
<Parameter Name = "PlanDescription">ThisPlan</Parameter>
<Parameter Name = "Status">Available</Parameter>
<Parameter Name = "SetupPrice">2.30</Parameter>
<Parameter Name = "RecurringPrice">4.90</Parameter>
<Parameter Name = "DefaultDuration">1</Parameter>
<Parameter Name = "PromotionalPrice">2.30</Parameter>
<Parameter Name = "PromotionalDuration">1</Parameter>
<Parameter Name = "ResourceList">
<Parameters>
<Parameter Name = "User Accounts">10</Parameter>
<Parameter Name = "Domains">50</Parameter>
<Parameters>
</Parameter>
</Parameters>
Sample SOAP Request
POST /HC7API/PlanManager.asmx HTTP/1.1
Host: your-domain.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/SetPlanDetails"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SetPlanDetailsxmlns="http://tempuri.org/">
<HostUserName>host</HostUserName>
<HostPassword>host123</HostPassword>
<OwnerName>david</OwnerName>
<PlanName>MyPlan</PlanName>
<OptionalParam>xml</OptionalParam>
</SetPlanDetails>
</soap:Body>
</soap:Envelope>
Sample HTTP Request
POST /HC7API/PlanManager.asmx/SetPlanDetailsHTTP/1.1
Host: your-domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
HostUserName=host&HostPassword=host123&OwnerName=david&PlanName=MyPlan&OptionalParam=xml
Sample C# Code
public PlanManager.Response SetPlanDetails(string strHostUserName, string strHostPassword, string strOwnerName, string strPlanName)
{
try
{
PlanManager.PlanManager oPlan = new PlanManager.PlanManager();
PlanManager.Response oResponse = new PlanManager.Response();
XmlDocument oDoc = new XmlDocument();
//Adding root node
XmlNode xOptionalParam = oDoc.CreateNode(XmlNodeType.Element,"Parameters","");
//Adding sub nodes
XmlNode xParameter = oDoc.CreateNode(XmlNodeType.Element,"Parameter","");
XmlAttribute xAttribute = oDoc.CreateAttribute("Name");
xAttribute.Value = "PlanDescription";
xParameter.Attributes.Append(xAttribute);
xParameter.InnerText = "ThisPlan";
xOptionalParam.AppendChild(xParameter);
.......
.......
.......
oResponse = oPlan.SetPlanDetails(strHostUserName, strHostPassword, strOwnerName, strPlanName,
OptionalParam);
}
catch
{
}
return oResponse;
}
Sample Response
<Response>
<Method>SetPlanDetails</Method>
<Status>false</Status>
<ErrorCode>70100030</ErrorCode>
<ErrorDescription>Update failed; some Resource exceed the allocated quantity.</ ErrorDescription>
<Result>
<ResultReport xmlns="">
<ViolatedResources>
<RecordCount>23</RecordCount>
<RecordRow>
<ResourceName>User Accounts</ResourceName>
<DesiredQuantity>Unlimited</DesiredQuantity>
<AllocatedQuantity>10</AllocatedQuantity>
<SoldQuantity>3 + 1 (Reseller's)</SoldQuantity>
<RemainingQuantity>6</RemainingQuantity>
</RecordRow>
.......
.......
.......
</ViolatedResources>
</ResultReport>
</Result>
</Response>