- API-Referenz
- Datei
- Get a FileUploadType's rules
Get a FileUploadType's rules
Request
- fileUploadTypestring (einer von: avatar, extensionAssetImage, extensionAssetVideo, anchorIcon, conversation)required
FileUploadType to retrieve rules for.
Responses
OK
- extensionsArray von stringrequired
- Array[
- *string
]
- fileTypesArray von objectrequired
- Array[
- *object
- extensionsArray von stringrequired
- Array[
- *string
]
- mimeTypestringrequired
]
- maxNameLengthintegerrequired
- maxSizeInBytesinteger (int64)required
- maxSizeInKBinteger (int64)deprecatedrequired
deprecated, see maxSizeInBytes
- maxSizeInKbinteger (int64)deprecatedrequired
deprecated, see maxSizeInBytes
- mimeTypesArray von stringrequired
- Array[
- *string
]
- propertiesobject
- imageDimensionsobject
- maxobject
- heightinteger (int64)
- widthinteger (int64)
- minobject
- heightinteger (int64)
- widthinteger (int64)
Content-Type: application/json
{
"extensions": [
".png",
".jpeg",
".jpg"
],
"fileTypes": [
{
"extensions": [
".jpe",
".jpeg",
".jpg"
],
"mimeType": "image/jpeg"
}
],
"maxNameLength": 80,
"maxSizeInBytes": 1000000,
"mimeTypes": [
"image/png",
"image/jpeg"
],
"properties": {
"imageDimensions": {
"max": {
"height": 123,
"width": 123
},
"min": {
"height": 123,
"width": 123
}
}
}
}
{
"properties": {
"extensions": {
"example": [
".png",
".jpeg",
".jpg"
],
"items": {
"type": "string"
},
"type": "array"
},
"fileTypes": {
"items": {
"properties": {
"extensions": {
"example": [
".jpe",
".jpeg",
".jpg"
],
"items": {
"type": "string"
},
"type": "array"
},
"mimeType": {
"example": "image/jpeg",
"type": "string"
}
},
"required": [
"mimeType",
"extensions"
],
"type": "object"
},
"type": "array"
},
"maxNameLength": {
"example": 80,
"type": "integer"
},
"maxSizeInBytes": {
"example": 1000000,
"format": "int64",
"type": "integer"
},
"maxSizeInKB": {
"deprecated": true,
"description": "deprecated, see maxSizeInBytes",
"example": 1000,
"format": "int64",
"type": "integer"
},
"maxSizeInKb": {
"deprecated": true,
"description": "deprecated, see maxSizeInBytes",
"example": 1000,
"format": "int64",
"type": "integer"
},
"mimeTypes": {
"example": [
"image/png",
"image/jpeg"
],
"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": [
"maxSizeInBytes",
"maxSizeInKB",
"maxSizeInKb",
"mimeTypes",
"fileTypes",
"extensions",
"maxNameLength"
],
"type": "object"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
The requested resource was not found
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/file-upload-types/avatar/rules
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.file.getFileUploadTypeRules({
"fileUploadType": "avatar"
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTypeRules\GetFileUploadTypeRulesRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new GetFileUploadTypeRulesRequest(
fileUploadType: "avatar"
));
$response = $client->file()->getFileUploadTypeRules($request);
var_dump($response->getBody();