{"id":31447928,"url":"https://github.com/teamwork/desksdkgo","last_synced_at":"2025-10-01T02:14:18.949Z","repository":{"id":309960606,"uuid":"1038196615","full_name":"Teamwork/desksdkgo","owner":"Teamwork","description":"A Go SDK for interacting with the Teamwork Desk API. This SDK provides a simple and intuitive way to interact with Teamwork Desk's REST API.","archived":false,"fork":false,"pushed_at":"2025-09-24T03:11:54.000Z","size":6835,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-24T05:25:42.020Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Teamwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-14T19:24:32.000Z","updated_at":"2025-09-24T03:11:58.000Z","dependencies_parsed_at":"2025-08-16T10:47:02.688Z","dependency_job_id":null,"html_url":"https://github.com/Teamwork/desksdkgo","commit_stats":null,"previous_names":["teamwork/desksdkgo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Teamwork/desksdkgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teamwork%2Fdesksdkgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teamwork%2Fdesksdkgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teamwork%2Fdesksdkgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teamwork%2Fdesksdkgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Teamwork","download_url":"https://codeload.github.com/Teamwork/desksdkgo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teamwork%2Fdesksdkgo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277782799,"owners_count":25876209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-01T02:00:09.286Z","response_time":88,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-01T02:14:14.865Z","updated_at":"2025-10-01T02:14:18.944Z","avatar_url":"https://github.com/Teamwork.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Teamwork Desk Go SDK\n\nA Go SDK for interacting with the Teamwork Desk API. This SDK provides a simple and intuitive way to interact with Teamwork Desk's REST API.\n\n## Features\n\n- Support for all major Teamwork Desk API endpoints\n- Simple and intuitive client interface\n- Built-in logging and debugging support\n- Command-line interface for quick operations\n- Environment variable support for configuration\n- `.env` file support for easy configuration\n\n## Installation\n\n```bash\ngo get github.com/teamwork/desksdkgo\n```\n\n## Usage\n\n### Basic Client Usage\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"log/slog\"\n    \"github.com/teamwork/desksdkgo/client\"\n)\n\nfunc main() {\n    // Create a new client\n    c := client.NewClient(\n        \"https://yourcompany.teamwork.com/desk/api/v2\",\n        client.WithAPIKey(\"your-api-key\"), // Get this in your profile settings\n        client.WithLogLevel(slog.LevelDebug),\n    )\n\n    // Use the client\n    ctx := context.Background()\n\n    // List tickets\n    tickets, err := c.Tickets.List(ctx, nil)\n    if err != nil {\n        panic(err)\n    }\n\n    // Get a specific ticket\n    ticket, err := c.Tickets.Get(ctx, 123)\n    if err != nil {\n        panic(err)\n    }\n}\n```\n\n### Using a Custom Logger\n\nYou can provide your own log/slog logger to the client:\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"log/slog\"\n    \"os\"\n    \"github.com/teamwork/desksdkgo/client\"\n)\n\nfunc main() {\n    // Create a custom logger\n    customLogger := slog.New(slog.NewTextHandler(os.Stdout, \u0026slog.HandlerOptions{\n        Level: slog.LevelInfo,\n        AddSource: true,\n    }))\n\n    // Create client with custom logger\n    c := client.NewClient(\n        \"https://yourcompany.teamwork.com/desk/api/v2\",\n        client.WithAPIKey(\"your-api-key\"),\n        client.WithLogger(customLogger), // Use your custom logger\n    )\n\n    // The client will now use your custom logger for all HTTP request/response logging\n    ctx := context.Background()\n    tickets, err := c.Tickets.List(ctx, nil)\n    if err != nil {\n        panic(err)\n    }\n}\n```\n\n### Available Resources\n\nThe SDK supports the following resources:\n\n- **Business Hours**: Manage business hours\n- **Companies**: Manage company information\n- **Customers**: Manage customer information\n- **Help Doc Articles**: Manage help documentation articles\n- **Help Doc Sites**: Manage help documentation sites\n- **SLAs**: Manage service level agreements\n- **Tags**: Manage ticket tags\n- **Ticket Priorities**: Manage ticket priorities\n- **Ticket Statuses**: Manage ticket statuses\n- **Ticket Types**: Manage ticket types\n- **Tickets**: Manage support tickets\n- **Users**: Manage user accounts\n\nEach resource supports the following operations:\n\n- `Get`: Retrieve a single resource by ID\n- `List`: Retrieve a list of resources with optional filters\n- `Create`: Create a new resource\n- `Update`: Update an existing resource\n\n### Command Line Interface\n\nThe SDK includes a command-line interface for quick operations:\n\n```bash\n# List tickets\n./desksdkgo --api-key YOUR_API_KEY --resource tickets --action list\n\n# Get a specific ticket\n./desksdkgo --api-key YOUR_API_KEY --resource tickets --action get --id 123\n\n# Create a new ticket\n./desksdkgo --api-key YOUR_API_KEY --resource tickets --action create --data '{\"subject\": \"New Ticket\", \"description\": \"Ticket description\"}'\n\n# Update a ticket\n./desksdkgo --api-key YOUR_API_KEY --resource tickets --action update --id 123 --data '{\"status\": \"resolved\"}'\n```\n\n### Configuration\n\nThe CLI supports the following configuration options:\n\n- `--api-key`: Teamwork Desk API key (required)\n- `--base-url`: Teamwork Desk API base URL (default: https://mycompany.teamwork.com/desk/api/v2)\n- `--resource`: Resource to interact with (default: tickets)\n- `--action`: Action to perform (get, list, create, update) (default: list)\n- `--id`: Resource ID for get/update actions\n- `--debug`: Enable debug logging\n- `--data`: JSON data to merge with default values for create/update actions\n\nAll configuration options can be set in multiple ways, in order of precedence:\n\n1. Command-line flags\n2. Environment variables\n3. `.env` file\n\n#### Environment Variables\n\nThe following environment variables are supported:\n\n- `DESK_API_KEY`\n- `DESK_BASE_URL`\n- `DESK_RESOURCE`\n- `DESK_ACTION`\n- `DEBUG`\n\n#### .env File Support\n\nYou can create a `.env` file in your project directory to set default values. Copy `.env.example` to `.env` and modify the values:\n\n```bash\n# Copy the example file\ncp .env.example .env\n\n# Edit the .env file with your values\n```\n\nExample `.env` file:\n\n```env\n# Desk API Configuration\nDESK_API_KEY=your_api_key_here\nDESK_BASE_URL=https://yourcompany.teamwork.com/desk/api/v2\n\n# Default Resource and Action\nDESK_RESOURCE=tickets\nDESK_ACTION=list\n\n# Debug Mode (true/false)\nDEBUG=false\n```\n\n### Filtering\n\nThe SDK includes a filter builder for creating complex queries:\n\n```go\nfilter := client.NewFilter().\n    Eq(\"status\", \"open\").\n    And(\n        client.NewFilter().Gt(\"created_at\", \"2023-01-01\"),\n        client.NewFilter().Lt(\"created_at\", \"2023-12-31\"),\n    )\n\ntickets, err := c.Tickets.List(ctx, filter.Build())\n```\n\nAvailable filter operators:\n\n- `$eq`: Equal to\n- `$ne`: Not equal to\n- `$lt`: Less than\n- `$lte`: Less than or equal to\n- `$gt`: Greater than\n- `$gte`: Greater than or equal to\n- `$in`: In list\n- `$nin`: Not in list\n- `$and`: Logical AND\n- `$or`: Logical OR\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamwork%2Fdesksdkgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamwork%2Fdesksdkgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamwork%2Fdesksdkgo/lists"}