openapi: 3.2.0 info: title: Akeneo API REFERENCE Reference entity media file API version: 1.0.0 description: 'This is the reference documentation for the Akeneo PIM REST API. It provides detailed information about the available endpoints, request and response formats, and authentication methods. For more information, visit the Akeneo PIM documentation.' license: name: Open Software License 3.0 url: http://opensource.org/licenses/OSL-3.0 contact: name: Akeneo Support url: https://www.akeneo.com/support-help-center/ email: contact@akeneo.com servers: - url: '{your-pim-url}' variables: your-pim-url: default: '' description: 'Set the PIM url you want to target ex: https://my-pim.cloud.akeneo.com or https://localhost:8443' tags: - name: Reference entity media file description: 'A reference entity media file is a file that can be attached to a reference entity record. It can be an image, a video, a PDF, or any other type of file. Reference entity media files are used to enrich the reference entity information and provide additional context to the reference entities.' paths: /api/rest/v1/reference-entities-media-files: post: operationId: post_reference_entity_media_files x-visibility: public summary: Create a new media file for a reference entity or a record description: 'This endpoint allows you to create a new media file and associate it to the image of a reference entity, or to the main image or to an attribute value of a record' tags: - Reference entity media file security: - bearerToken: [] parameters: - in: header name: Content-Type description: 'Equal to ''multipart/form-data'' (with [boundary value](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2)), no other value allowed. ' required: true schema: type: string example: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW x-form-data: true requestBody: required: true description: Media file to upload content: multipart/form-data: schema: type: object required: - file properties: file: type: string format: binary description: The media file to upload example: '' examples: valid-image: summary: Upload a PNG image value: file: '' responses: '201': description: 'This response indicates that the entity was successfully created. The server has fulfilled the request and created a new resource. The response includes a `Location` header that contains the URI of the newly created resource. ' headers: Location: description: URI of the created resource schema: type: string example: https://demo.akeneo.com/api/rest/v1/reference-entities-media-files/3/c/d/6/3cd6a399c51507514d60560f76772bbabacb6564_SampleJPGImage_5mbmb.jpg asset-media-file-code: description: Code of the created asset media file schema: type: string example: 3/c/d/6/3cd6a399c51507514d60560f76772bbabacb6564_SampleJPGImage_5mbmb.jpg '401': description: 'This response indicates that authentication is required to access the requested resource. It can be caused by a missing or expired token, or if the provided credentials are invalid. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 401 message: Full authentication is required to access this resource. '415': description: 'This response indicates that the `Content-type` header of the request is not supported by the server. The server expects the `Content-type` header to be `application/json`, and any other value will result in this error. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 415 message: xxx in `Content-type` header is not valid. Only `application/json` is allowed." '422': description: 'Unprocessable entity. The file is invalid or missing. ' content: application/json: schema: type: object required: - code - message properties: code: type: integer example: 422 message: type: string example: Property "file" is required. example: code: 422 message: Property "file" is required. /api/rest/v1/reference-entities-media-files/{code}: get: operationId: get_reference_entity_media_file_by_code x-visibility: public summary: Download the media file associated to a reference entity or a record description: This endpoint allows you to download a given media file that is associated with a reference entity or a record tags: - Reference entity media file security: - bearerToken: [] parameters: - in: path name: code description: 'This path parameter is used to specify the unique identifier of the entity you want to retrieve or manipulate. It is essential for identifying the specific entity in the API requests. Ensure that the code is correctly formatted and corresponds to an existing entity in the system. ' required: true schema: type: string example: my_entity_code x-content-type: Mime-type of the media file responses: '200': description: Returns the binary of the media file content: image/png: schema: type: string format: binary example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA... image/jpeg: schema: type: string format: binary example: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYa '401': description: 'This response indicates that authentication is required to access the requested resource. It can be caused by a missing or expired token, or if the provided credentials are invalid. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 401 message: Full authentication is required to access this resource. '404': description: 'This response indicates that the requested resource could not be found on the server. It can occur when the resource code given in the URI does not correspond to any existing PIM resource. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 404 message: Resource `my_resource_code` does not exist. components: securitySchemes: basicToken: scheme: basic type: http description: 'HTTP Basic authentication using user credentials. [More information here](https://api.akeneo.com/documentation/authentication.html) ' bearerToken: scheme: bearer type: http description: 'Bearer token obtained via the "Password Grant" flow. This token authenticates a user, is valid for one hour, and can be refreshed using a refresh token. [More information here](https://api.akeneo.com/documentation/authentication.html) ' appToken: scheme: bearer type: http description: 'Bearer token for Apps, obtained via the OAuth 2.0 flow. This permanent token allows an application to make requests on behalf of a user. [More information here](https://api.akeneo.com/apps/authentication-and-authorization.html) ' x-provenance: method: harvested publisher: Akeneo source: https://storage.googleapis.com/akecld-prd-pim-saas-shared-openapi-spec/openapi.yaml note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json); stamped by stamp-openapi-provenance.py (roadmap#793)