Skip to content

Latest commit

 

History

History
227 lines (164 loc) · 6.42 KB

TeamApi.md

File metadata and controls

227 lines (164 loc) · 6.42 KB

TeamApi

All URIs are relative to https://api.legislate.tech

Method HTTP request Description
getTeamUsingGET GET /v1/teams/{teamId} Get team details.
getTeamsUsingGET GET /v1/users/{userId}/teams Get teams.
postTeamUsingPOST POST /v1/users/{userId}/teams Create a team for a given user.
updateTeamUsingPATCH PATCH /v1/teams/{teamId} Updates a team.

getTeamUsingGET

TeamResponseDTO getTeamUsingGET(teamId)

Get team details.

This operation will retrieve details about a given team.

Example

// Import classes:
//import com.legislate.ApiClient;
//import com.legislate.ApiException;
//import com.legislate.Configuration;
//import com.legislate.auth.*;
//import com.legislate.api.TeamApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: auth0_jwt
OAuth auth0_jwt = (OAuth) defaultClient.getAuthentication("auth0_jwt");
auth0_jwt.setAccessToken("YOUR ACCESS TOKEN");

TeamApi apiInstance = new TeamApi();
Long teamId = 789L; // Long | teamId
try {
    TeamResponseDTO result = apiInstance.getTeamUsingGET(teamId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TeamApi#getTeamUsingGET");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
teamId Long teamId

Return type

TeamResponseDTO

Authorization

auth0_jwt

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getTeamsUsingGET

List<TeamResponseDTO> getTeamsUsingGET(userId)

Get teams.

This operation will retrieve all teams for a given user.

Example

// Import classes:
//import com.legislate.ApiClient;
//import com.legislate.ApiException;
//import com.legislate.Configuration;
//import com.legislate.auth.*;
//import com.legislate.api.TeamApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: auth0_jwt
OAuth auth0_jwt = (OAuth) defaultClient.getAuthentication("auth0_jwt");
auth0_jwt.setAccessToken("YOUR ACCESS TOKEN");

TeamApi apiInstance = new TeamApi();
Long userId = 789L; // Long | The unique Id of the user you'd whose teams you'd like to query.
try {
    List<TeamResponseDTO> result = apiInstance.getTeamsUsingGET(userId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TeamApi#getTeamsUsingGET");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
userId Long The unique Id of the user you'd whose teams you'd like to query.

Return type

List<TeamResponseDTO>

Authorization

auth0_jwt

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

postTeamUsingPOST

TeamResponseDTO postTeamUsingPOST(body, userId)

Create a team for a given user.

This operation will create a team for a given user.

Example

// Import classes:
//import com.legislate.ApiClient;
//import com.legislate.ApiException;
//import com.legislate.Configuration;
//import com.legislate.auth.*;
//import com.legislate.api.TeamApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: auth0_jwt
OAuth auth0_jwt = (OAuth) defaultClient.getAuthentication("auth0_jwt");
auth0_jwt.setAccessToken("YOUR ACCESS TOKEN");

TeamApi apiInstance = new TeamApi();
CreateTeamRequestDTO body = new CreateTeamRequestDTO(); // CreateTeamRequestDTO | createTeamRequest
Long userId = 789L; // Long | The unique Id of the user for whom you'd like to create a team.
try {
    TeamResponseDTO result = apiInstance.postTeamUsingPOST(body, userId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TeamApi#postTeamUsingPOST");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body CreateTeamRequestDTO createTeamRequest
userId Long The unique Id of the user for whom you'd like to create a team.

Return type

TeamResponseDTO

Authorization

auth0_jwt

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateTeamUsingPATCH

TeamResponseDTO updateTeamUsingPATCH(body, teamId)

Updates a team.

This operation will update a team details.

Example

// Import classes:
//import com.legislate.ApiClient;
//import com.legislate.ApiException;
//import com.legislate.Configuration;
//import com.legislate.auth.*;
//import com.legislate.api.TeamApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: auth0_jwt
OAuth auth0_jwt = (OAuth) defaultClient.getAuthentication("auth0_jwt");
auth0_jwt.setAccessToken("YOUR ACCESS TOKEN");

TeamApi apiInstance = new TeamApi();
UpdateTeamRequestDTO body = new UpdateTeamRequestDTO(); // UpdateTeamRequestDTO | updateTeamRquest
Long teamId = 789L; // Long | The unique Id of the team you'd like to update.
try {
    TeamResponseDTO result = apiInstance.updateTeamUsingPATCH(body, teamId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TeamApi#updateTeamUsingPATCH");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body UpdateTeamRequestDTO updateTeamRquest
teamId Long The unique Id of the team you'd like to update.

Return type

TeamResponseDTO

Authorization

auth0_jwt

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json