Skip to content

Latest commit

 

History

History
250 lines (187 loc) · 10.4 KB

ProjectAvatarsApi.md

File metadata and controls

250 lines (187 loc) · 10.4 KB

ProjectAvatarsApi

All URIs are relative to https://your-domain.atlassian.com

Method HTTP request Description
createProjectAvatar POST /rest/api/3/project/{projectIdOrKey}/avatar2 Load project avatar
deleteProjectAvatar DELETE /rest/api/3/project/{projectIdOrKey}/avatar/{id} Delete project avatar
getAllProjectAvatars GET /rest/api/3/project/{projectIdOrKey}/avatars Get all project avatars
updateProjectAvatar PUT /rest/api/3/project/{projectIdOrKey}/avatar Set project avatar

createProjectAvatar

Avatar createProjectAvatar(body, projectIdOrKey, x, y, size)

Load project avatar

Loads an avatar for a project. Specify the avatar's local file location in the body of the request. Also, include the following headers: * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see Special Headers. * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. For example: `curl --request POST ` `--user [email protected]:<api_token> ` `--header 'X-Atlassian-Token: no-check' ` `--header 'Content-Type: image/< image_type>' ` `--data-binary &quot;<@/path/to/file/with/your/avatar>&quot; ` `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2&#x27;&#x60; The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image. The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. After creating the avatar use Set project avatar to set it as the project's displayed avatar. Permissions required: Administer projects project permission.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectAvatarsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectAvatarsApi apiInstance = new ProjectAvatarsApi();
Object body = null; // Object | 
String projectIdOrKey = "projectIdOrKey_example"; // String | The ID or (case-sensitive) key of the project.
Integer x = 0; // Integer | The X coordinate of the top-left corner of the crop region.
Integer y = 0; // Integer | The Y coordinate of the top-left corner of the crop region.
Integer size = 56; // Integer | The length of each side of the crop region.
try {
    Avatar result = apiInstance.createProjectAvatar(body, projectIdOrKey, x, y, size);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectAvatarsApi#createProjectAvatar");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body Object
projectIdOrKey String The ID or (case-sensitive) key of the project.
x Integer The X coordinate of the top-left corner of the crop region. [optional] [default to 0]
y Integer The Y coordinate of the top-left corner of the crop region. [optional] [default to 0]
size Integer The length of each side of the crop region. [optional]

Return type

Avatar

Authorization

OAuth2basicAuth

HTTP request headers

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

deleteProjectAvatar

deleteProjectAvatar(projectIdOrKey, id)

Delete project avatar

Deletes a custom avatar from a project. Note that system avatars cannot be deleted. Permissions required: Administer projects project permission.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectAvatarsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectAvatarsApi apiInstance = new ProjectAvatarsApi();
String projectIdOrKey = "projectIdOrKey_example"; // String | The project ID or (case-sensitive) key.
Long id = 789L; // Long | The ID of the avatar.
try {
    apiInstance.deleteProjectAvatar(projectIdOrKey, id);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectAvatarsApi#deleteProjectAvatar");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
projectIdOrKey String The project ID or (case-sensitive) key.
id Long The ID of the avatar.

Return type

null (empty response body)

Authorization

OAuth2basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getAllProjectAvatars

ProjectAvatars getAllProjectAvatars(projectIdOrKey)

Get all project avatars

Returns all project avatars, grouped by system and custom avatars. This operation can be accessed anonymously. Permissions required: Browse projects project permission for the project.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectAvatarsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectAvatarsApi apiInstance = new ProjectAvatarsApi();
String projectIdOrKey = "projectIdOrKey_example"; // String | The ID or (case-sensitive) key of the project.
try {
    ProjectAvatars result = apiInstance.getAllProjectAvatars(projectIdOrKey);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectAvatarsApi#getAllProjectAvatars");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
projectIdOrKey String The ID or (case-sensitive) key of the project.

Return type

ProjectAvatars

Authorization

OAuth2basicAuth

HTTP request headers

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

updateProjectAvatar

Object updateProjectAvatar(body, projectIdOrKey)

Set project avatar

Sets the avatar displayed for a project. Use Load project avatar to store avatars against the project, before using this operation to set the displayed avatar. Permissions required: Administer projects project permission.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectAvatarsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectAvatarsApi apiInstance = new ProjectAvatarsApi();
Avatar body = new Avatar(); // Avatar | 
String projectIdOrKey = "projectIdOrKey_example"; // String | The ID or (case-sensitive) key of the project.
try {
    Object result = apiInstance.updateProjectAvatar(body, projectIdOrKey);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectAvatarsApi#updateProjectAvatar");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body Avatar
projectIdOrKey String The ID or (case-sensitive) key of the project.

Return type

Object

Authorization

OAuth2basicAuth

HTTP request headers

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