Web API for Projects: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 18: Line 18:
<pre>
<pre>
POST api/projects
POST api/projects
Body:
{
  "identifier": "New project name"
}
</pre>
</pre>
Creates a new empty project. Takes the project entity in the body (read-only properties are ignored). Returns the created project entity. If current user has no rights to create project, unauthorized error is returned.
Creates a new empty project. Takes the project entity in the body (read-only properties are ignored). Returns the created project entity. If current user has no rights to create project, unauthorized error is returned.
Line 23: Line 27:
<pre>
<pre>
PUT api/projects/{id}
PUT api/projects/{id}
Body:
{
  "identifier": "Project name"
}
</pre>
</pre>
Updates properties of an existing project with the given id. If project doesn't exist, not found error is returned. If current user has no rights to modify the project, unauthorized error is returned.
Updates properties of an existing project with the given id. If project doesn't exist, not found error is returned. If current user has no rights to modify the project, unauthorized error is returned.

Latest revision as of 09:02, 29 April 2022

Projects API is used to create projects, delete projects and edit project properties.

Note that the Workspace Elements API supports also projects.

Methods

The projects API has the following methods.

GET api/projects GET

Gets a list of all projects in the system (if no parameter is provided). Supports optional query parameter projectId which is project id where to get projects from.

GET api/projects/{id}

Gets a project entity by the project id. If project doesn't exist, not found error is returned. If current user has no access to the project, unauthorized error is returned.

POST api/projects
Body:
{
  "identifier": "New project name"
}

Creates a new empty project. Takes the project entity in the body (read-only properties are ignored). Returns the created project entity. If current user has no rights to create project, unauthorized error is returned.

PUT api/projects/{id}
Body:
{
  "identifier": "Project name"
}

Updates properties of an existing project with the given id. If project doesn't exist, not found error is returned. If current user has no rights to modify the project, unauthorized error is returned.

DELETE api/projects/{id}

Deletes a project with given id. If the project doesn't exist, not found error is returned. If current user has no rights to delete the project, unauthorized error is returned.