Create a new media file

POST /api/rest/v1/retailer/media-files

This endpoint allows you to create a new media file and associate it to an attribute value of a given retailer product.

Headers

  • Content-type string Required

    Equal to 'multipart/form-data', no other value allowed

Body

  • parent string Required

    The parent retailer product to which the media file is associated.

  • attribute string Required

    The image attribute to which the media file is associated.

  • file string(binary)

    The binaries of the image file.

  • url string

    The url of the image file.

Responses

  • Created

    Hide headers attribute Show headers attribute
  • Bad request

    Hide response attributes Show response attributes object
    • code integer

      HTTP status code

    • message string

      Message explaining the error

  • Authentication required

    Hide response attributes Show response attributes object
    • code integer

      HTTP status code

    • message string

      Message explaining the error

  • Access forbidden

    Hide response attributes Show response attributes object
    • code integer

      HTTP status code

    • message string

      Message explaining the error

  • Unsupported Media type

    Hide response attributes Show response attributes object
    • code integer

      HTTP status code

    • message string

      Message explaining the error

  • Unprocessable entity

    Hide response attributes Show response attributes object
    • code integer

      HTTP status code

    • message string

      Message explaining the error

POST /api/rest/v1/retailer/media-files
curl \
 -X POST https://content.winkelstraat.nl/api/rest/v1/retailer/media-files \
 -H "Content-type: string" \
 -d '{"parent":"string","attribute":"string","file":"@file","url":"string"}'
Request example
# Headers
Content-type: string

# Payload
{
  "parent": "string",
  "attribute": "string",
  "file": "@file",
  "url": "string"
}
Response examples (400)
400
"Invalid JSON message received"
Response examples (400)
{
  "code": 42,
  "message": "string"
}
Response examples (401)
401
"Authentication is required"
Response examples (401)
{
  "code": 42,
  "message": "string"
}
Response examples (403)
403
"Access forbidden. You are not allowed to list categories."
Response examples (403)
{
  "code": 42,
  "message": "string"
}
Response examples (415)
415
"‘xxx’ in ‘Content-type’ header is not valid.  Only ‘multipart/form-data’ is allowed."
Response examples (415)
{
  "code": 42,
  "message": "string"
}
Response examples (422)
422
"Property \"labels\" expects an array as data, \"NULL\" given. Check the API reference documentation."
{
  "documentation": {
    "href": "http://api.akeneo.com/api-reference.html"
  }
}
Response examples (422)
{
  "code": 42,
  "message": "string"
}