Teams ***** GET List of Teams ----------------- Provides a json list of teams and the projects the team is assigned to. Teams belong to an organization. Only owners and managers of the organization can create its teams, update them, delete them, or change a team's membership. Moving a team to another organization requires the requester to be an owner or manager of both the current and the new organization. Granting or revoking a team's role on a project additionally requires the requester to be an owner or manager of that project. .. raw:: html
GET /api/v1/teamsExample ^^^^^^^ :: curl -X GET https://api.ona.io/api/v1/teams Optional params: - ``org`` : Filter by organization. Example ^^^^^^^ :: curl -X GET https://api.ona.io/api/v1/teams?org=bruize Response ^^^^^^^^ :: [ { "url": "https://api.ona.io/api/v1/teams/1", "name": "Owners", "organization": "bruize", "projects": [] }, { "url": "https://api.ona.io/api/v1/teams/2", "name": "demo team", "organization": "bruize", "projects": [] } ] GET Team Info for a specific team. ---------------------------------- Shows teams details and the projects the team is assigned to, where: - ``pk`` - unique identifier for the team .. raw:: html
GET /api/v1/teams/{pk}
Example
^^^^^^^
::
curl -X GET https://api.ona.io/api/v1/teams/1
Response
^^^^^^^^
::
{
"url": "https://api.ona.io/api/v1/teams/1",
"name": "Owners",
"organization": "bruize",
"projects": []
}
List members of a team
----------------------
A list of usernames is the response for members of the team.
.. raw:: html
GET /api/v1/teams/{pk}/members
Example
^^^^^^^
::
curl -X GET https://api.ona.io/api/v1/teams/1/members
Response
^^^^^^^^
::
["member1"]
Create a team
-------------
POST ``{"name": "someteam", "organization": "orgusername"}`` to
``/api/v1/teams`` to create a team in an organization. The requester must be
an owner or manager of the organization; other callers receive
``403 FORBIDDEN``.
.. raw:: html
POST /api/v1/teamsExample ^^^^^^^ :: curl -X POST -d name="demo team" -d organization=bruize https://api.ona.io/api/v1/teams Response ^^^^^^^^ :: { "url": "https://api.ona.io/api/v1/teams/2", "name": "demo team", "organization": "bruize", "projects": [] } Add a user to a team -------------------- POST ``{"username": "someusername"}`` to ``/api/v1/teams/
POST /api/v1/teams/{pk}/members
Response
^^^^^^^^
::
["someusername"]
Set team default permissions on a project
-----------------------------------------
POST ``{"role":"readonly", "project": "project_id"}`` to
``/api/v1/teams/
POST /api/v1/teams/{pk}/share
Example
^^^^^^^
::
curl -X POST -d project=3 -d role=readonly https://api.ona.io/api/v1/teams/1/share
Response
^^^^^^^^
::
HTTP 204 NO CONTENT
Remove team default permissions on a project
--------------------------------------------
POST ``{"role":"readonly", "project": "project_id", "remove": "True"}``
to ``/api/v1/teams/
POST /api/v1/teams/{pk}/share
Example
^^^^^^^
::
curl -X POST -d project=3 -d role=readonly -d remove=true https://api.ona.io/api/v1/teams/1/share
Response
^^^^^^^^
::
HTTP 204 NO CONTENT