Skip to main content

Request a Project avatar upload

POST/v2/projects/{projectId}/avatar
API version
v2
Request method
POST
Operation ID
project-request-project-avatar-upload

Request​

  • projectIdstringrequired

    ID of the Project you want to request an avatar upload for.

Responses​

Format
application/json
Description

OK

  • refIdstring (uuid)required
  • rulesobjectrequired
    • maxSizeInKBinteger (int64)required
    • mimeTypesarray of stringrequired
      • Array[
        • *string
        ]
    • propertiesobject
      • imageDimensionsobject
        • maxobject
          • heightinteger (int64)
          • widthinteger (int64)
        • minobject
          • heightinteger (int64)
          • widthinteger (int64)
Content-Type: application/json

{
"refId": "f0f86186-0a5a-45b2-aa33-502777496347",
"rules": {
"maxSizeInKB": 3000,
"mimeTypes": [
"image/jpeg",
"image/png"
],
"properties": {
"imageDimensions": {
"max": {
"height": 123,
"width": 123
},
"min": {
"height": 123,
"width": 123
}
}
}
}
}
{
"properties": {
"refId": {
"format": "uuid",
"type": "string"
},
"rules": {
"properties": {
"maxSizeInKB": {
"example": 3000,
"format": "int64",
"type": "integer"
},
"mimeTypes": {
"example": [
"image/jpeg",
"image/png"
],
"items": {
"type": "string"
},
"type": "array"
},
"properties": {
"properties": {
"imageDimensions": {
"properties": {
"max": {
"properties": {
"height": {
"format": "int64",
"type": "integer"
},
"width": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"min": {
"properties": {
"height": {
"format": "int64",
"type": "integer"
},
"width": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
},
"required": [
"mimeTypes",
"maxSizeInKB"
],
"type": "object"
}
},
"required": [
"refId",
"rules"
],
"type": "object"
}

Usage examples​

$ curl \
--fail \
--location \
-X POST \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects/string/avatar
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.project.requestProjectAvatarUpload({
"projectId": "string"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Project\RequestProjectAvatarUpload\RequestProjectAvatarUploadRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new RequestProjectAvatarUploadRequest(
projectId: "string"
));
$response = $client->project()->requestProjectAvatarUpload($request);

var_dump($response->getBody();

On this page