|
Version: 7C
HC7 Build: 7.00.0012 and later
API Build: 1.00.0001 and later
User Manager - SetUserProfile updates profile of a specified user. This web service call can be used as http://your-domain.com/HC7API/UserManager.asmx?op=SetUserProfile.
Input Parameters
HostUserName
HostPassword
OwnerName - owner name of the user whose profile you want to update
UserName - user name whose profile you want to update
OptionalParam
SetBillingProfile True/False - True if you want to update billing profile, default value will be False
FirstName
LastName
EmailAddress
CountryName
StateName
CityName
StreetAddress
PostalCode
PhoneNo
FaxNo
Company
SocialSecurityNo
CreditCardNumber
CreditCardType - Visa / Master Card / Discover / American Express
ExpiryMonth - mm
ExpiryYear - yyyy
CVV2
Discount
CreditLimit
Language
Output Parameters
N/A
Sample Optional Parameters
<Parameters>
<Parameter Name = "SetBillingProfile">True</Parameter>
<Parameter Name = "FirstName">john</Parameter>
<Parameter Name = "LastName">smith</Parameter>
<Parameter Name = "Email">john@hosting.net</Parameter>
<Parameter Name ="Language">English</Parameter>
</Parameters>
Sample SOAP Request
POST /HC7API/UserManager.asmx HTTP/1.1 Host: your-domain.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/SetUserProfile" <?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> <SetUserProfile xmlns="http://tempuri.org/"> <HostUserName>host</HostUserName> <HostPassword>host123</HostPassword> <OwnerName>david</OwnerName> <UserName>john</UserName> <OptionalParam>xml</OptionalParam> </SetUserProfile> </soap:Body> </soap:Envelope>
Sample HTTP Request
POST /HC7API/UserManager.asmx/SetUserProfileHTTP/1.1 Host: your-domain.com Content-Type: application/x-www-form-urlencoded Content-Length: length HostUserName=host&HostPassword=host123&OwnerName=david&UserName=john&OptionalParam=xml
Sample C# Code
public UserManager.Response SetUserProfile(string strHostUserName, string strHostPassword, string strOwnerName, string strUserName) { try { UserManager.UserManager oUser = new UserManager.UserManager(); UserManager.Response oResponse = new UserManager.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 = "SetBillingProfile"; xParameter.Attributes.Append(xAttribute); xParameter.InnerText = "True"; xOptionalParam.AppendChild(xParameter); ....... ....... ....... oResponse = oUser.SetUserProfile(strHostUserName, strHostPassword,strUserName,OptionalParam); } catch { } return oResponse; }
Sample Response
<Response> <Method>SetUserProfile</Method> <Status>true</Status> <ErrorCode>70500021</ErrorCode> <ErrorDescription>User edited successfully.</ErrorDescription> <Result/> </Response>