Difference between revisions of "AWBS API"

From AWBS Wiki
Jump to: navigation, search
(resetpassword)
(adduser)
Line 4: Line 4:
 
! PARAMETER !! DESCRIPTION
 
! PARAMETER !! DESCRIPTION
 
|-
 
|-
|'''activate''' ||(1=Active 2=Canceled 3=Pending 4=Suspended 5=Fraud 9=Flagged)
+
|'''activate''' ||1=Active 2=Canceled 3=Pending 4=Suspended 5=Fraud 9=Flagged
 
|-
 
|-
|'''address1''' ||
+
|'''address1''' ||User's Postal Address Line 1
 
|-
 
|-
|'''address2''' ||
+
|'''address2''' ||User's Postal Address Line 2
 
|-
 
|-
|'''city''' ||
+
|'''city''' ||User's City
 
|-
 
|-
|'''company''' ||
+
|'''company''' ||Company Name
 
|-
 
|-
|'''country''' || (2 letter country code)
+
|'''country''' || 2 letter country code
 
|-
 
|-
|'''countrycode''' || (2 or 3 digit country dialing code)
+
|'''countrycode''' || 2 or 3 digit country dialing code
 
|-
 
|-
 
|'''custom1''' ||
 
|'''custom1''' ||
Line 24: Line 24:
 
|'''custom3''' ||
 
|'''custom3''' ||
 
|-
 
|-
|'''email''' ||
+
|'''email''' ||User's E-Mail Address
 
|-
 
|-
|'''fax''' ||
+
|'''fax''' ||User's Fax Number
 
|-
 
|-
|'''first_name''' ||
+
|'''first_name''' ||User's First Name
 
|-
 
|-
|'''groupname''' || (group id number)
+
|'''groupname''' ||User group ID number
 
|-
 
|-
|'''jobtitle''' ||
+
|'''jobtitle''' ||User's Job Title
 
|-
 
|-
|'''language''' || (default=english)
+
|'''language''' ||Language for User (default=english)
 
|-
 
|-
|'''last_login''' || (unix time)
+
|'''last_login''' ||Last login time for user, must be in unix time
 
|-
 
|-
|'''last_name''' ||
+
|'''last_name''' ||User's Last Name
 
|-
 
|-
|'''last_transaction''' || (unix time)
+
|'''last_transaction''' ||Last Transaction time by user, must be in unix time
 
|-
 
|-
|'''lpanswer''' || (secret answer)
+
|'''lpanswer''' ||Secret Answer
 
|-
 
|-
|'''lpquestion''' || (secret question)
+
|'''lpquestion''' ||Secret Question
 
|-
 
|-
|'''mail_type''' || (1=text 2=html)
+
|'''mail_type''' ||1=Text 2=HTML
 
|-
 
|-
|'''maillist''' || (add to maillist 1=yes 0=no)
+
|'''maillist''' ||Add to mailing list 1=Yes 0=No
 
|-
 
|-
|'''password''' || (md5 encoded password)
+
|'''password''' ||MD5 Encoded Password for User
 
|-
 
|-
|'''phone''' ||
+
|'''phone''' ||User's Phone Number (no spaces, or hyphens)
 
|-
 
|-
|'''ppassword''' || (password in plain text)
+
|'''ppassword''' ||User's Password in plain text
 
|-
 
|-
|'''province''' ||
+
|'''province''' ||User's Province of Residence
 
|-
 
|-
|'''refill_notify''' || (1=yes 0=no)
+
|'''refill_notify''' ||1=Yes 0=No
 
|-
 
|-
 
|'''resellermaxaccts''' ||
 
|'''resellermaxaccts''' ||

Revision as of 13:56, April 1, 2010

Available Commands

adduser

PARAMETER DESCRIPTION
activate 1=Active 2=Canceled 3=Pending 4=Suspended 5=Fraud 9=Flagged
address1 User's Postal Address Line 1
address2 User's Postal Address Line 2
city User's City
company Company Name
country 2 letter country code
countrycode 2 or 3 digit country dialing code
custom1
custom2
custom3
email User's E-Mail Address
fax User's Fax Number
first_name User's First Name
groupname User group ID number
jobtitle User's Job Title
language Language for User (default=english)
last_login Last login time for user, must be in unix time
last_name User's Last Name
last_transaction Last Transaction time by user, must be in unix time
lpanswer Secret Answer
lpquestion Secret Question
mail_type 1=Text 2=HTML
maillist Add to mailing list 1=Yes 0=No
password MD5 Encoded Password for User
phone User's Phone Number (no spaces, or hyphens)
ppassword User's Password in plain text
province User's Province of Residence
refill_notify 1=Yes 0=No
resellermaxaccts
rspchoice (1=state 2=province 3=no choice)
second_email
sendmail
state
username
zip

addhosting

PARAMETER DESCRIPTION
addtoqueue
afid (affiliate id)
bw (bandwidth in MB)
domain
hplan (case sensitive hosting plan)
ip
next_invoice (next invoice generation date (unixtime))
ns1 (nameserver1)
ns2 (nameserver2)
owner (owners username)
price_override (override amount)
renew_date (next renew date (unixtime))
renewed_on (last renew (unixtime))
server (case sensitive)
start_date (default=today)
status (1=Active 2=Canceled 3=Pending 4=Suspended)
term (Monthly, Quarterly, BiAnnually, Annually)
uname (control panel username)
upass (control panel password)

adddomain

PARAMETER DESCRIPTION
afid (affiliate id)
auto_renew '1'
domainid
expiredate
feature1 '1'
feature2 '1'
feature3 '1'
feature4 '1'
feature5 '0'
owner (owners username)
regdate 'Today'
registrar (Enom, Directi, Irrp, Generic, Nominet, Custom1)
regstatus ((Case Sensitive) Closed, Completed, Pending, Error, Canceled, Locked, Lost,Failed)
regtype ((Case sensitive) New, Renew, Transfer, DNS)
sld
tld

suspendhosting

PARAMETER DESCRIPTION
domain
owner (owners username)
reseller
send_email

unsuspendhosting

PARAMETER DESCRIPTION
domain
owner (owners username)
reseller
send_email

cancelhosting

PARAMETER DESCRIPTION
domain
owner (owners username)
reseller
send_email

addhostingpackage

PARAMETER DESCRIPTION
annually
biannually
description
monthly
planname
quarterly
serverplan
setupfee

addhostingserver

PARAMETER DESCRIPTION
serverip
servername

resetpassword

PARAMETER DESCRIPTION
newpassword (plain text)
user
userid

checkserverstats

Note: checkserverstats will return a list of open/pending items separated by a pipe (|) character. helpdesk|others|reminders|contact_form|package_queue|users

checkapi

addinvoice

getcart

checkdomain

getuser

payinvoice

updatecc

verifyuser

Usage Instructions

  1. Edit your Extended System Config and allow API access from your IP in the remote_list field. Note: Each allowed IP is separated by a | (pipe)
  2. Set your Private Key in AWBS System Setup/System Options.

The API currently accepts HTTP POST only.

Sample cURL Post

$data="command=adduser&help=1&accesskey=mykey";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$data");
curl_setopt($ch, CURLOPT_URL, "https://www.yoursite.com/interface.php");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15); 
$ret = curl_exec($ch);
curl_close($ch);

Note: You can alternatively send: &maccesskey=[md5 encoded key as shown on the System Config page] if you wish to not send the key in plain text

Return and Options

Posting help=1 will get you help on the function sent in the command.

When not sending help=1, you will receive either a "SUCCESS" response, or if the call failed, you will receive an "ERROR,error description" response.

You can also send the &altout=1 command. This will cause the api to return the insert_id for sql injections instead of the usual SUCCESS. Sending &checkapi=1 will return SUCCESS if you validate on the api (and pass ip check).