This script provides a simple integration with the BOSSDesk API, specifically targeting the Configuration Management Database (CMDB) endpoint to fetch and count available laptops.
- Python 3.x
- requests library: For making HTTP requests.
- python-dotenv library: For loading environment variables from a .env file.
- Clone this repository:
git clone [URL of your repo]- Navigate to the project directory:
cd [project-directory]- Install the required packages:
pip install requests python-dotenv- Ensure that you have set up your .env file as described in the Configuration section.
- Run the script:
python [script-name].pyThe script will output the number of available laptops based on the API's response.
Configuration is managed through a .env file. Create a .env file in the root directory of the project and specify the required environment variables:
BOSSDESK_API_TOKEN=your_token
API_ENDPOINT=https://mycompany.bossdesk.io/api/v1/cmdb- BOSSDESK_API_TOKEN: Your BOSSDesk API token for authentication
- API_ENDPOINT: The endpoint URL of the BOSSDesk API you are targeting.
Note: Ensure that you never commit the .env file to the version control to keep sensitive data secure
- Fork the repository.
- Create a new branch for you changes
- Make your changes and commit them with meaningful commit messages
- Open a pull request
Remember to replace placeholders like [URL of your repo] and [script-name].py with appropriate values for your repository and script.