POST /api/{version}/notice/attachment/submit

This operation allows users to upload a single attachment per request. This uploaded attachment can then be referenced in the notice reception XML to make it part of the Attachments section on the notice.

Requires Authorization

The endpoint requires a Basic Auth in the http authorization header. For details, please see the Authentication section.

Request Information

URI Parameters

None.

Body Parameters

Details of the publish request.

NameDescriptionTypeFormatMax lengthExample
attachment

XML file base64 encoded

string

(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})

140 MB

d2VsbGRvbmU

filename

Name of uploaded file

string

.+

255 characters

example.txt

mediaType

MIME type of uploaded file

string mediaType

n/a

text/plain

Request Formats

application/x-www-form-urlencoded

Sample:
    attachment=d2VsbGRvbmU&filename=example.txt&mediaType=text%2Fplain
		

Response Information

Resource Description

A JSON object containing the id of the attachment.

Response Formats

In the case of successful response.

application/json, text/json

Sample:
{
  "attachment_id": "A-1",
  "received_at": "2022-07-19T12:16:06+01:00"
  "status": "RECEIVED",
}
            

In the case the file name is too long.

application/json, text/json

Sample:
{
  "timestamp": "2022-07-19T12:16:06+01:00",
  "status": 400,
  "error": "Invalid request",
  "message": "File name must be 255 characters or less",
  "path": "/api/latest/notice/attachment/submit",
}
			

In the case the file extension is invalid.

application/json, text/json

Sample:
{
  "timestamp": "2022-07-19T12:16:06+01:00",
  "status": 400,
  "error": "Invalid request",
  "message": "File extension must be on allowed list - see documentation",
  "path": "/api/latest/notice/attachment/submit",
}
			

In the case the media type is invalid.

application/json, text/json

Sample:
{
  "timestamp": "2022-07-19T12:16:06+01:00",
  "status": 400,
  "error": "Invalid request",
  "message": "Media type must be on allowed list - see documentation",
  "path": "/api/latest/notice/attachment/submit",
}
			

In the case the file extension and media type do not match.

application/json, text/json

Sample:
{
  "timestamp": "2022-07-19T12:16:06+01:00",
  "status": 400,
  "error": "Invalid request",
  "message": "File extension must align with the media type - see documentation",
  "path": "/api/latest/notice/attachment/submit",
}
			

In the case the attachment exceeds the maximum size.

application/json, text/json

Sample:
{
  "timestamp": "2022-07-19T12:16:06+01:00",
  "status": 400,
  "error": "Invalid request",
  "message": "attachment must be smaller than 100MB before encoding",
  "path": "/api/latest/notice/attachment/submit",
}
			

In the case virus is found in the attachment.

application/json, text/json

Sample:
{
  "timestamp": "2022-07-19T12:16:06+01:00",
  "status": 400,
  "error": "Invalid request",
  "message": "File must not contain a virus",
  "path": "/api/latest/notice/attachment/submit",
}
			

In the case the attachment is a CSV file and it include cells starting with special chararters.

application/json, text/json

Sample:
{
  "timestamp": "2022-07-19T12:16:06+01:00",
  "status": 400,
  "error": "Invalid request",
  "message": "CSV files must not include cells starting with =, +, - or @",
  "path": "/api/latest/notice/attachment/submit",
}
			

In the case the attachment is empty.

application/json, text/json

Sample:
{
  "timestamp": "2022-07-19T12:16:06+01:00",
  "status": 400,
  "error": "Invalid request",
  "message": "File must not be empty",
  "path": "/api/latest/notice/attachment/submit",
}
			

In the case the attachment body is not base64 encoded.

application/json, text/json

Sample:
{
    "timestamp": "2022-07-19T12:16:06+01:00",
    "status": 400,
    "error": "Invalid request",
    "message": "The attachment must be base64 encoded",
    "path": "/api/latest/notice/attachment/submit",
}
        

mediaTypes

Valid file and media types:

ExtensionMedia typeDescription
DOC

application/msword

Word (old)

DOT

application/msword

Word (old)

DOCX

application/vnd.openxmlformats-officedocument.wordprocessingml.document

Word (new)

DOCM

application/vnd.ms-word.document.macroEnabled.12

Word (new macro)

DOTX

application/vnd.openxmlformats-officedocument.wordprocessingml.template

Word (new template)

DOTM

application/vnd.ms-word.template.macroEnabled.12

Word (new macro template)

XLS

application/vnd.ms-excel

Excel (old)

XLT

application/vnd.ms-excel

Excel (old)

XLSM

application/vnd.ms-excel.sheet.macroEnabled.12

Excel (new macro)

XLTM

application/vnd.ms-excel.template.macroEnabled.12

Excel (new macro template)

XLSB

application/vnd.ms-excel.sheet.binary.macroEnabled.12

Excel (new binary)

XLSX

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Excel (new)

XLTX

application/vnd.openxmlformats-officedocument.spreadsheetml.template

Excel (new template)

PPT

application/vnd.ms-powerpoint

PowerPoint (old)

POT

application/vnd.ms-powerpoint

PowerPoint (old)

PPTX

application/vnd.openxmlformats-officedocument.presentationml.presentation

PowerPoint (new)

PPTM

application/vnd.ms-powerpoint.presentation.macroEnabled.12

PowerPoint (new macro)

POTX

application/vnd.openxmlformats-officedocument.presentationml.template

PowerPoint (new template)

POTM

application/vnd.ms-powerpoint.template.macroEnabled.12

PowerPoint (new macro template)

PUB

application/x-mspublisher, application/vnd.ms-publisher

Publisher

MPP

application/vnd.ms-project

Project

VSD

application/vnd.visio2013, application/vnd.visio, application/vnd.ms-visio.viewer

Visio (old)

VST

application/vnd.visio2013, application/vnd.visio, application/vnd.ms-visio.viewer

Visio (old)

VSDX

application/vnd.visio2013, application/vnd.visio, application/vnd.ms-visio.viewer

Visio (new)

VSDM

application/vnd.visio2013, application/vnd.visio, application/vnd.ms-visio.viewer

Visio (new macro)

VSTX

application/vnd.visio2013, application/vnd.visio, application/vnd.ms-visio.viewer

Visio (new template)

VSTM

application/vnd.visio2013, application/vnd.visio, application/vnd.ms-visio.viewer

Visio (new macro template)

ODT

application/vnd.oasis.opendocument.text

Text

OTT

application/vnd.oasis.opendocument.text-template

Text (template)

ODS

application/vnd.oasis.opendocument.spreadsheet

Spreadsheet

OTS

application/vnd.oasis.opendocument.spreadsheet-template

Spreadsheet (template)

ODP

application/vnd.oasis.opendocument.presentation

Presentation

OTP

application/vnd.oasis.opendocument.presentation-template

Presentation (template)

ODG

application/vnd.oasis.opendocument.graphics

Graphics

OTG

application/vnd.oasis.opendocument.graphics-template

Graphics (template)

PDF

application/pdf

PDF

XPS

application/vnd.ms-xpsdocument

XPS

TXT

text/plain

Text

HTM

text/html

HTML

HTML

text/html

HTML

XML

application/xml, text/xml

XML

CSV

text/csv, application/vnd.ms-excel

CSV

RTF

text/rtf, application/rtf, application/msword

RTF

EML

message/rfc822

Email

JPG

image/jpeg

JPEG

JPEG

image/jpeg

JPEG

PNG

image/png

PNG

TIF

image/tiff

TIFF

TIFF

image/tiff

TIFF

ZIP

application/zip, application/x-zip-compressed

Zip