Create a Personal Access Token and use DigitalOcean API

Inspiration
I am participating in the Hacking Week organized by MHL, which features several exciting challenges. You can find more details about the challenge [here](https://mlh.github.io/DigitalOcean-Challenges-GHW-Open-Source-2024/#challenge-2).
What it does
This project leverages DigitalOcean’s APIs to streamline your workflow directly from the terminal. It allows you to list your active offerings and create new ones with ease. By integrating these functionalities into your terminal, you can manage your DigitalOcean resources more efficiently, saving time and reducing the need for manual intervention through the web interface. This tool is particularly useful for developers and system administrators who prefer command-line operations.
How we built it
Log in to DigitalOcean: Access your DigitalOcean account.
Navigate to API: In the left-hand menu, click on API.

Generate New Token: Under the “Personal access tokens” section, click Generate New Token.
* Fill in Details:
* Token Name: Choose a descriptive name.
* Expiration: Set an expiration date.
* Scopes: Select the permissions you need (e.g., read, write).
Click Generate Token and copy the token. Store it securely as it functions like a password.

Usage Examples
List Droplets
export TOKEN=dop_v1_60b49e2a8032f922d2001ea8a7b6c8ca63aefb197c3a0b83d0f588cfa8de1c8c
curl -X GET "https://api.digitalocean.com/v2/droplets" \
-H "Authorization: Bearer $TOKEN"
SAMPLE OUTPUT:
{"droplets":[],"links":{},"meta":{"total":0}}
Retrieve Account Information
curl -X GET "https://api.digitalocean.com/v2/account" \
-H "Authorization: Bearer $TOKEN"
SAMPLE OUTPUT:
{"account":{"droplet_limit":10,"floating_ip_limit":10,"reserved_ip_limit":10,"volume_limit":3,"email":"[email protected]","name":"xxx xxxx","uuid":"af2a877b-c730–4204-b0f9–31b32c29d971","email_verified":true,"status":"active","status_message":"","team":{"uuid":"0ee87a53–97f8–443d-a124–1cff63a7c040","name":"My Team"}}}
Accomplishments that we’re proud of
We successfully generated a personal access token and utilized the DigitalOcean API to perform various tasks. This achievement demonstrates our ability to integrate and automate cloud services, enhancing our overall productivity and technical proficiency.
What we learned
Throughout this project, we gained valuable insights into the workings of the DigitalOcean API. We learned how to generate and securely manage personal access tokens, and how to use these tokens to authenticate API requests. Additionally, we explored various API endpoints and understood how to perform CRUD operations on DigitalOcean resources. This experience has deepened our understanding of cloud service automation and API integration, equipping us with skills that are highly relevant in the DevOps field.