Zum Hauptinhalt springen

Add a deviating avatar to a contributor

POST/v2/contributors/{contributorId}/avatar
API-Version
v2
Request-Methode
POST
Operation-ID
contributor-request-deviating-contributor-avatar-upload

Request​

  • contributorIdstringrequired

Responses​

Format
application/json
Beschreibung

The Upload of an avatar for the contributor has been requested.

  • avatarRefIdstring (uuid)required

    Use the avatarRefId as updload token at /v2/files/{logoRefId}.

  • rulesobjectrequired

    Constraints for the logo image upload.

    • extensionsArray von stringrequired
      • Array[
        • *string
        ]
    • fileTypesArray von objectrequired
      • Array[
        • *object
          • extensionsArray von stringrequired
            • Array[
              • *string
              ]
          • mimeTypestringrequired
        ]
    • maxSizeInBytesintegerrequired
    • mimeTypesArray von stringrequired
      • Array[
        • *string
        ]
    • propertiesobject
      • imageDimensionsobject
        • maxobjectrequired
          • heightinteger
          • widthinteger
        • minobjectrequired
          • heightinteger
          • widthinteger
Content-Type: application/json

{
"avatarRefId": "f0f86186-0a5a-45b2-aa33-502777496347",
"rules": {
"extensions": [
".png"
],
"fileTypes": [
{
"extensions": [
".png"
],
"mimeType": "image/png"
}
],
"maxSizeInBytes": 123,
"mimeTypes": [
"image/png"
],
"properties": {
"imageDimensions": {
"max": {
"height": 123,
"width": 123
},
"min": {
"height": 123,
"width": 123
}
}
}
}
}
{
"properties": {
"avatarRefId": {
"description": "Use the avatarRefId as updload token at `/v2/files/{logoRefId}`.",
"format": "uuid",
"type": "string"
},
"rules": {
"description": "Constraints for the logo image upload.",
"properties": {
"extensions": {
"items": {
"example": ".png",
"type": "string"
},
"type": "array"
},
"fileTypes": {
"items": {
"properties": {
"extensions": {
"items": {
"example": ".png",
"type": "string"
},
"type": "array"
},
"mimeType": {
"example": "image/png",
"type": "string"
}
},
"required": [
"mimeType",
"extensions"
],
"type": "object"
},
"type": "array"
},
"maxSizeInBytes": {
"type": "integer"
},
"mimeTypes": {
"items": {
"example": "image/png",
"type": "string"
},
"type": "array"
},
"properties": {
"properties": {
"imageDimensions": {
"properties": {
"max": {
"properties": {
"height": {
"type": "integer"
},
"width": {
"type": "integer"
}
},
"type": "object"
},
"min": {
"properties": {
"height": {
"type": "integer"
},
"width": {
"type": "integer"
}
},
"type": "object"
}
},
"required": [
"min",
"max"
],
"type": "object"
}
},
"type": "object"
}
},
"required": [
"mimeTypes",
"extensions",
"fileTypes",
"maxSizeInBytes"
],
"type": "object"
}
},
"required": [
"avatarRefId",
"rules"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/contributors/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.marketplace.contributorRequestDeviatingContributorAvatarUpload({
"contributorId": "string"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ContributorRequestDeviatingContributorAvatarUpload\ContributorRequestDeviatingContributorAvatarUploadRequest;

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

$request = (new ContributorRequestDeviatingContributorAvatarUploadRequest(
contributorId: "string"
));
$response = $client->marketplace()->contributorRequestDeviatingContributorAvatarUpload($request);

var_dump($response->getBody();

Auf dieser Seite