API for Dummies

tlchost

Verified User
Joined
Apr 4, 2007
Messages
320
As loath as I am to admit it, I must have a mental block about the API syntax. I see many posts with things like:

CMD_API_DATABASES

no parameters:
lists the databases with encoded url: list[]=username_db1&list[]=username_db2

action=create
name=dbname (username_ will be added)
user=user (username_ will be added)
passwd=pass
passwd2=pass

action=delete
select0=username_dbname
(select1=username_db2, etc...)

I think I would call this by mydomain.com:2222/CMD_API_DATABASES

But then what?

Is there a tutorial for the API stuff? If not, can someone point me to an API call that shows how I pass the information above and one that uses a webform for input?

Thanks...it's bad enough not understanding what everyoine else does, it's even worse to admit it in public.:confused:
 

Thanks...I took a quick look and it's still over my head....

For instance

Create Admin:
Function To create a new admin account
Command CMD_ACCOUNT_ADMIN
Method GET or POST
Success Returns Text
Failure Returns Text
Form Values:
Name Value
action create
username The Admin's username. 4-8 characters, alphanumeric
email A valid email address
passwd The admins password. 5+ characters, ascii
passwd2 Password double check. 5+ characters, ascii
notify yes or no. If yes, an email will be sent to email

Are the variable names and values enterted into the browser, ala some cgi scripts ?Name=DoDo,Action=create

Can it be done via a webpage form?

Please forgive the simple questions...but this stuff is obviously in one of my personal blind spots
 
I think you will understand the api once you figure out how to write a http GET or POST. These are done differently depending on what program you are using.

Here is an example of how a user would be created

htp://username:password@server_ip:2222/CMD_API_ACCOUNT_USER?action=create&package=package_name&add=Submit&notify=no&username=new_username&email=new_user_email&passwd=new_user_password&passwd2=new_user_password&ip=server_ip

This would create a new user using the GET command. How you implement this depends on what programming language you are using. It can be done via a GET or a POST.

This would not work in a browser because you cannot pass the username and password in the url. But a script can. And even if the script cannot you would then just create a http post instead.

Tell us what language you would prefer to write in and one of us can show you an example if you need it.
 
Back
Top