How to use the API?

The app is terrible and won't even open. The unofficial app just says error and I don't know enough about programming and web design to use any CLI tools yet. Anyone have help?

Posted Apr 14, 2016, 8:19 PM UTC

25
Just-A-City-Boy•

What are you trying to accomplish? If you're trying to setup some commands to run on demand or something I can help with that.

However, your post talks about trying to use mobile apps. Which I have no experience with.

1
shellkekOP•

Yeah my issue was with the apps. Though for fun I asked if they'll get windows 10? ticket said NO, BUT feel free to upgrade yourself.

Opened a ticket since I needed vmware tools after they told me to upgrade. I found the link but for fun asked if they could link the official copy. Same guy from ticket 1 got mad that I didn't wait for their "official" template lol and said they don't have a link for vmware tools

1
alpain•

ive tried two different IP's at separate times (home and a shell elsewheres) and ive tried resetting the API key still cant get this to work with the appropriate key and email

curl https://panel.cloudatcost.com/api/v1/listtemplates.php?key=KEY&[email protected]

gives me

{"status":"error","time":1461201039,"error":103,"error_description":"invalid user login"}

should key and login be in any quotes or anything?

1
Just-A-City-Boy•

I checked out what you said you were trying. It failed for me too if I did a standard curl call with the url. Here's what I did to get it to work...

First the prep work:

  • Make sure your key status is set to enable

  • Verify you have the correct IP's in the whitelist on the panel settings. You can add multiple IP's if you seperate them with comma's. ^((They must be the external IP's not any 192.168's)^)

Then the command is in the following format:

curl -Gk --data "key=(KEY)&login=(EMAIL)" --url "https://panel.cloudatcost.com/api/v1/(PAGE)"

The arguments we are using are:

  • -G: Must be capitol, tells curl to send a GET request instead of POST when using --data Note: If the API page you are requesting requires POST then disregard this argument.

  • -k: Allows insecure SSL connections since the API requests are through https with what appears to be an invalid certificate

  • --data: The API parameters

  • --url: The request URL, ending with .php. No ? required.

An example:

curl -gk --data "key=a1B2cD&login=[email protected]" --url "https://panel.cloudatcost.com/api/v1/listtemplates.php"

{"status":"ok","time":1234567890,"api":"v1","action":"listtemplates","data":[{"ce_id":"1","name":"CentOS 6.7 64bit"},{"ce_id":"3","name":"Debian-8-64bit"},{"ce_id":"9","name":"Windows 7 64bit"},{"ce_id":"24","name":"Windows 2008 R2 64bit"},{"ce_id":"25","name":"Windows 2012 R2 64bit"},{"ce_id":"26","name":"CentOS-7-64bit"},{"ce_id":"27","name":"Ubuntu-14.04.1-LTS-64bit"},{"ce_id":"28","name":"Minecraft-CentOS-7-64bit"},{"ce_id":"74","name":"FreeBSD-10-1-64bit"},{"ce_id":"75","name":"Docker-64bit"}]}

I probably simplified this too much for you, but with such a generic topic title as "How to use the API", I figured I could future proof this for any users who search that term on this subreddit and stumble upon this thread.

1
alpain•

I think it might be as simple as the quotes you are using.

their examples dont show the quotes but you do..

ill try that later.

thanks.

1