OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Extend API documentation
Oliver Günthere682a5fb4c37
diff --git a/docs/api/apiv3/introduction.apib b/docs/api/apiv3/introduction.apibindex 84235d9ce54..363f202a95b 100644--- a/docs/api/apiv3/introduction.apib+++ b/docs/api/apiv3/introduction.apib@@ -1,33 +1,41 @@+# OpenProject API-# Group General+Please note that we intend to keep this specification as accurate and stable as possible, however work on the API *v3* is still ongoing+and not all resources and actions in OpenProject are yet accessible through the API.-Please note that everything in this document might be **subject to change** in a future version of OpenProject. We intend to keep this specification-as accurate as possible, however as long as the APIv3 is not in a stable state it is possible that there are intermediary differences between-this specification and the real implementation. While we try to only specify what we want to keep, it might also happen that parts of this-specification will be replaced **incompatibly** until the APIv3 is considered *stable*.+This document will be subject to changes as we add more endpoints and functionality to the API. The development version of this document+may have breaking changes while we work on new endpoints for the application.-# Hypermedia-TODO: Description & Resources+We try to keep stable releases of OpenProject with changes to this API backwards compatible whenever possible.-# Formats-TODO: Description and why only JSON+## Hypermedia REST API-# HAL+JSON+The APIv3 is a hypermedia REST API, a shorthand for "Hypermedia As The Engine Of Application State" (HATEOAS).+This means that each endpoint of this API will have links to other resources or actions defined in the resulting body.++These related resources and actions for any given resource will be context sensitive. For example, only actions that the+authenticated user can take are being rendered. This can be used to dynamically identify actions that the user might take for any+given response.++As an example, if you fetch a work package through the [Work Package endpoint](#work-packages), the `update` link will only+be present when the user you authenticated has been granted a permission to update the work package in the assigned project.++## HAL+JSONHAL is a simple format that gives a consistent and easy way to hyperlink between resources in your API.-Read more: http://stateless.co/hal_specification.html+Read more in the following specification: https://tools.ietf.org/html/draft-kelly-json-hal-08**OpenProject API implementation of HAL+JSON format** enriches JSON and introduces a few meta properties:- `_type` - specifies the type of the resource (e.g.: WorkPackage, Project)- - `_links` - contains all links available for the resource+ - `_links` - contains all related resource and action links available for the resource- `_embedded` - contains all embedded objectsHAL does not guarantee that embedded resources are embedded in their full representation, they might as well bepartially represented (e.g. some properties can be left out).However in this API you have the guarantee that whenever a resource is **embedded**, it is embedded in its **full representation**.-# API response structure+## API response structureAll API responses contain a single HAL+JSON object, even collections of objects are technically represented bya single HAL+JSON object that itself contains its members. More details on collections can be found@@ -61,12 +69,17 @@ curl -u apikey:$API_KEY https://community.openproject.com/api/v3/users/42## OAuth2.0 authentication-OpenProject allows authentication and authorization with OAuth2 through the following flows:+OpenProject allows authentication and authorization with OAuth2 with *Authorization code flow*, as well as *Client credentials* operation modes.++To get started, you first need to register an application in the OpenProject OAuth administration section of your installation.+This will save an entry for your application with a client unique identifier (`client_id`) and an accompanying secret key (`client_secret`).++You can then use one the following guides to perform the supported OAuth 2.0 flows:- [Authorization code flow](https://oauth.net/2/grant-types/authorization-code)- [Client credentials](https://oauth.net/2/grant-types/client-credentials/) - Requires an application to be bound to an impersonating user for non-public access-### Why not username and password?+## Why not username and password?The simplest way to do basic auth would be to use a user's username and password naturally.However, OpenProject already has supported API keys in the past for the API v2, though not through basic auth.