Git Product home page Git Product logo

youtrack-php-sdk's Introduction

PHP YouTrack SDK

cog-php-youtrack-sdk

StyleCI Code Climate Releases License

Introduction

YouTrack PHP Software Development Kit provides set of tools to interact with JetBrains YouTrack Issue Tracking and Project Management software.

Contents

Features

Requirements

  • YouTrack >= 3.0 with REST-API enabled (always enabled, by default)
  • PHP >= 8.1
  • Guzzle HTTP Client >= 7.0

Provides packages

Haven't found required functionality? We are open for Pull Requests!

Frameworks support

PHP YouTrack SDK is framework agnostic package and could be easily used in any PHP framework you want.

Framework integrations list

Haven't found your favorite framework in the list? We are open for Pull Requests!

Installation

The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

composer require cybercog/youtrack-php-sdk

Without framework

Be sure to include the autoloader in your project:

require_once '/path/to/your-project/vendor/autoload.php';

Usage

API client

YouTrack REST API PHP Client package documentation.

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Testing

Run the tests in terminal with:

composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributors

@antonkomarev
Anton Komarev

PHP YouTrack SDK contributors list

Alternatives

Feel free to add more alternatives as Pull Request.

License

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research best solutions in product & software development is our passion.

CyberCog

youtrack-php-sdk's People

Contributors

antonkomarev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

youtrack-php-sdk's Issues

POST Request to Create Issue Returns 415

Hi there! I am working on implementing this package in our app. I am able to make GET requests successfully; however, when making POST requests, I am consistently getting HTTP 415 Unsupported Media Type returned. I initially tried implementing the POST request example from the documentation, but got a 404. I have tried this with a number of Guzzle params, including setting Accept-Content and Content-Type, but continually get this error.

The code:

$params = [
	'project'		=> [
		'key'	=> $this->settings['project'],
	],
	'summary'		=> $item->title,
	'description'	=> $item->body,
	"issuetype" => [
		"name" => "Bug"
	],
];

$options = [
	'debug'				=> true,
];

$psrHttpClient = new Guzzle([
	'base_uri' => $this->settings['host'],
]);

// Instantiate YouTrack API HTTP Client Adapter
$httpClient = new YouTrackClient($psrHttpClient);

// Instantiate YouTrack API Token Authorizer
$authorizer = new YouTrackAuthorizer($this->settings['token']);

try {

	$this->connection = new YoutrackConnection($httpClient, $authorizer, 'youtrack/api');

	$response = $this->connection->post(
		'/issues',
		$params,
		$options
	);

	$output = $response->toArray();

	$this->output = $output;

} catch (\Exception $e) {

	$this->error = [
		'code' => $e->getCode(),
		'reason' => $e->getMessage(),
		'error' => $e->getPrevious(),
		// 'body' => $e->getResponseBody(),
	];

	return $this->error();

}

The response:

'code' => 415,
'reason' => '{"error":"Unsupported Media Type","error_description":"HTTP 415 Unsupported Media Type"}',

I am able to make the same call via Postman and it is successful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.