{"id":15065080,"url":"https://github.com/testmonitor/devops-client","last_synced_at":"2025-04-10T13:13:37.316Z","repository":{"id":47161282,"uuid":"223973950","full_name":"testmonitor/devops-client","owner":"testmonitor","description":"The TestMonitor Azure DevOps client.","archived":false,"fork":false,"pushed_at":"2024-11-27T10:44:25.000Z","size":117,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:56:54.935Z","etag":null,"topics":["api","azure-devops","client"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/testmonitor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2019-11-25T14:56:09.000Z","updated_at":"2024-11-27T10:44:29.000Z","dependencies_parsed_at":"2023-11-14T09:29:08.728Z","dependency_job_id":"4b2c0152-6f94-443c-95d8-0c246a9a1d48","html_url":"https://github.com/testmonitor/devops-client","commit_stats":{"total_commits":51,"total_committers":5,"mean_commits":10.2,"dds":0.3921568627450981,"last_synced_commit":"ec01127396102e56a7d662736f9ef63de607b0ee"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testmonitor%2Fdevops-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testmonitor%2Fdevops-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testmonitor%2Fdevops-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testmonitor%2Fdevops-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testmonitor","download_url":"https://codeload.github.com/testmonitor/devops-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225652,"owners_count":21068078,"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","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":["api","azure-devops","client"],"created_at":"2024-09-25T00:33:29.271Z","updated_at":"2025-04-10T13:13:37.179Z","avatar_url":"https://github.com/testmonitor.png","language":"PHP","readme":"# TestMonitor Azure DevOps Client\n\n[![Latest Stable Version](https://poser.pugx.org/testmonitor/devops-client/v/stable)](https://packagist.org/packages/testmonitor/devops-client)\n[![CircleCI](https://img.shields.io/circleci/project/github/testmonitor/devops-client.svg)](https://circleci.com/gh/testmonitor/devops-client)\n[![StyleCI](https://styleci.io/repos/223973950/shield)](https://styleci.io/repos/223973950)\n[![codecov](https://codecov.io/gh/testmonitor/devops-client/graph/badge.svg?token=OX609Y0IJY)](https://codecov.io/gh/testmonitor/devops-client)\n[![License](https://poser.pugx.org/testmonitor/devops-client/license)](https://packagist.org/packages/testmonitor/devops-client)\n\nThis package provides a very basic, convenient, and unified wrapper for [Microsoft Azure DevOps](https://azure.microsoft.com/en-us/services/devops/).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Examples](#examples)\n- [Tests](#tests)\n- [Changelog](#changelog)\n- [Contributing](#contributing)\n- [Credits](#credits)\n- [License](#license)\n\n## Installation\n\nTo install the client you need to require the package using composer:\n\n\t$ composer require testmonitor/devops-client\n\nUse composer's autoload:\n\n```php\nrequire __DIR__.'/../vendor/autoload.php';\n```\n\nYou're all set up now!\n\n## Usage\n\nThis client only supports **oAuth authentication**. You'll need an Microsoft Entra ID OAuth app to proceed.\nIf you haven't done so, please read up with the [Azure DevOps authentication docs](https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops)\non how to create an application and set the correct permissions.\n\nWhen your OAuth app is up and running, start with the oAuth authorization:\n\n```php\n$oauth = [\n    'clientId' =\u003e '12345',\n    'clientSecret' =\u003e 'abcdef',\n    'appId' =\u003e '12345',\n    'redirectUrl' =\u003e 'https://redirect.myapp.com/',\n];\n\n$devops = new \\TestMonitor\\DevOps\\Client($oauth);\n\nheader('Location: ' . $devops-\u003eauthorizationUrl());\nexit();\n```\n\nThis will redirect the user to a page asking confirmation for your app getting access to Azure DevOps. Make sure your redirectUrl points\nback to your app. This URL should point to the following code:\n\n```php\n$oauth = [\n    'clientId' =\u003e '12345',\n    'clientSecret' =\u003e 'abcdef',\n    'appId' =\u003e '12345',\n    'redirectUrl' =\u003e 'https://redirect.myapp.com/',\n];\n\n$devops = new \\TestMonitor\\DevOps\\Client($oauth);\n\n$token = $devops-\u003efetchToken($_REQUEST['code']);\n```\n\nWhen everything went ok, you should have an access token (available through Token object). It will be valid for **one hour**.\nAfter that, you'll have to refresh the token to regain access:\n\n```php\n$oauth = ['clientId' =\u003e '12345', 'clientSecret' =\u003e 'abcdef', 'appId' =\u003e '12345', 'redirectUrl' =\u003e 'https://redirect.myapp.com/'];\n$token = new \\TestMonitor\\DevOps\\AccessToken('eyJ0...', '0/34ccc...', 1574601877); // the token you got last time\n$organization = 'MyOrg';\n\n$devops = new \\TestMonitor\\DevOps\\Client($oauth, $organization, $token);\n\nif ($token-\u003eexpired()) {\n    $newToken = $devops-\u003erefreshToken();\n}\n```\n\nThe new token will be valid again for the next hour.\n\n## Examples\n\nGet a list of Azure DevOps accounts:\n\n```php\n$accounts = $devops-\u003eaccounts();\n```\n\nOr creating a work item, for example (using a work item type 'Bug' and example project with id 12345):\n\n```php\n$workItem = $devops-\u003ecreateWorkItem(new \\TestMonitor\\DevOps\\Resources\\WorkItem([\n    'title' =\u003e 'Summary of the item',\n    'description' =\u003e 'Some description',\n    'workItemType' =\u003e 'Bug',\n    'stepsToReproduce' =\u003e 'Repro steps',\n]), '12345');\n```\n\n## Tests\n\nThe package contains integration tests. You can run them using PHPUnit.\n\n    $ vendor/bin/phpunit\n\n## Changelog\n\nRefer to [CHANGELOG](CHANGELOG.md) for more information.\n\n## Contributing\n\nRefer to [CONTRIBUTING](CONTRIBUTING.md) for contributing details.\n\n## Credits\n\n* **Thijs Kok** - *Lead developer* - [ThijsKok](https://github.com/thijskok)\n* **Stephan Grootveld** - *Developer* - [Stefanius](https://github.com/stefanius)\n* **Frank Keulen** - *Developer* - [FrankIsGek](https://github.com/frankisgek)\n* **Muriel Nooder** - *Developer* - [ThaNoodle](https://github.com/thanoodle)\n\n## License\n\nThe MIT License (MIT). Refer to the [License](LICENSE.md) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestmonitor%2Fdevops-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestmonitor%2Fdevops-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestmonitor%2Fdevops-client/lists"}