Jump to content

API Authentication Failure


openmind

Recommended Posts

OK something odd is up here. Basically I cannot authenticate successfully with the API. All the following have been checked:

 

The admin user has access to the API

The username being sent is correct

The password being sent is in MD5 format and is correct

The API URL is right

 

I've confirmed this on two installs both running the latest version and still get the authentication field.

 

Any ideas?

 

This is my code:

<cfquery datasource="helmdsn" name="getuser">
   SELECT *
   FROM account
   WHERE accountnumber=<cfqueryparam value="helmUserName" cfsqltype="cf_sql_varchar">
</cfquery>
<cfset adminpassword=lcase(hash("myadminpassword", 'MD5'))>
<cfhttp url="http://www.whmcsinstallation.com/portal/includes/api.php" method="post">
   <cfhttpparam type="formfield" name="username" value="myadminuser">
   <cfhttpparam type="formfield" name="#adminpassword#" value="#adminpassword#">
   <cfhttpparam type="formfield" name="action" value="addclient">
   <cfhttpparam type="formfield" name="firstname" value="#getuser.firstname#">
   <cfhttpparam type="formfield" name="lastname" value="#getuser.lastname#">
   <cfhttpparam type="formfield" name="companyname" value="#getuser.companyname#">
   <cfhttpparam type="formfield" name="email" value="#getuser.primaryemail#">
   <cfhttpparam type="formfield" name="address1" value="#getuser.address1#">
   <cfhttpparam type="formfield" name="address2" value="#getuser.address2#">
   <cfhttpparam type="formfield" name="city" value="#getuser.town#">
   <cfhttpparam type="formfield" name="state" value="#getuser.county#">
   <cfhttpparam type="formfield" name="postcode" value="#getuser.postcode#">
   <cfhttpparam type="formfield" name="country" value="#getuser.countrycode#">
   <cfhttpparam type="formfield" name="phonenumber" value="#getuser.workphone#">
   <cfhttpparam type="formfield" name="password2" value="temppass">
</cfhttp>

Edited by openmind
Link to comment
Share on other sites

The main problem I have at the moment is getting the password for the Helm account as you simply cannot do it through the H3 API.

 

You can reset it or use the API to authenticate yourself but you can't get the password nor can you decode it (that I know of;))

 

So the upshot is that the password field is blank for the client hosting account which means whmcs will not suspend the account when overdue. Saying that though it won't suspend domains, just the account, so it's fairly pointless anyway...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated