Sunday 18 August 2013

Making a request to an API in php

Making a request to an API in php

So I want a way to start up and shutdown my droplet with Digital ocean,
they have their own API but im not quite sure how to do it
basically I want to be able to click a button on my website, The server
starts up and the JSON response is displayed. The API url is this
https://api.digitalocean.com/droplets/?client_id=[your_client_id]&api_key=[your_api_key]
and the example output is this:
{ "status": "OK", "droplets": [ { "id": 100823, "name": "test222",
"image_id": 420, "size_id":33, "region_id": 1, "backups_active": false,
"ip_address": "127.0.0.1", "locked": false, "status": "active"
"created_at": "2013-01-01T09:30:00Z" } ] }
Any help is apreciated

No comments:

Post a Comment