Question
How to call do api with php?
In the manual
https://www.digitalocean.com/community/tutorials/how-to-use-and-understand-action-objects-and-the-digitalocean-api
curl -X GET -H ‘Content-Type: application/json’ \
-H 'Authorization: Bearer ’$TOKEN’’ \
“https://api.digitalocean.com/v2/actions/36805022”
This will return the requested action object:
{
“action”: {
“id”: 36805022,
“status”: “completed”,
“type”: “snapshot”,
“startedat”: “2014-11-14T16:34:39Z”,
“completedat”: “2014-11-14T16:38:52Z”,
“resourceid”: 3164450,
“resourcetype”: “droplet”,
“region”: “nyc3”
}
}
How to get the same output with pure php code?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Hi dude, i have also find out one good example
Curl GET And POST Method Calls – PHP Example