Skip to main content

Get a Token's upload rules

GET/v2/file-token-rules/{token}
API version
v2
Request method
GET
Operation ID
deprecated-file-get-file-token-rules

Request​

  • tokenstring (uuid)required

    Token of the Token's upload rules to be retrieved.

Responses​

Format
application/json
Description

OK

  • extensionsarray of stringrequired
    • Array[
      • *string
      ]
  • fileTypesarray of objectrequired
    • Array[
      • *object
        • extensionsarray of stringrequired
          • Array[
            • *string
            ]
        • mimeTypestringrequired
      ]
  • maxNameLengthintegerrequired
  • maxSizeInBytesinteger (int64)required
  • maxSizeInKBinteger (int64)deprecatedrequired

    deprecated, see maxSizeInBytes

  • maxSizeInKbinteger (int64)deprecatedrequired

    deprecated, see maxSizeInBytes

  • mimeTypesarray of 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"
}

Usage examples​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/file-token-rules/3fa85f64-5717-4562-b3fc-2c963f66afa6
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.deprecatedFileGetFileTokenRules({
"token": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\File\DeprecatedFileGetFileTokenRules\DeprecatedFileGetFileTokenRulesRequest;

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

$request = (new DeprecatedFileGetFileTokenRulesRequest(
token: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
));
$response = $client->file()->deprecatedFileGetFileTokenRules($request);

var_dump($response->getBody();

On this page