Arbitrary Integration Request Content Support

Glyue supports building integration web service APIs that receive any arbitrary binary content (e.g. documents, bulk CSV data files, audio/video streams, archives)

Integration execution endpoints can be passed body content that isn't a single JSON or XML payload. When this occurs, the request's body is converted into one or multiple GlyueFileHandle objects and then passed into Glyue's integration engine for processing.

The term "file upload integration" is used to reference integrations that accept input data that isn't represented as JSON or XML.

Execution requests to file upload integrations are subject to the following rules:

HTTP MethodHTTP Request with Single FileHTTP Request with Multiple Files

POST

supported

supported

PUT

supported

rejected (415 unsupported media type)

PATCH

supported

rejected (415 unsupported media type)

GET

accepted but body is ignored

accepted but body is ignored

DELETE

accepted but body is ignored

accepted but body is ignored

By default, integration endpoints only accept POST requests. Web Service Endpoints must be created to enable integration execution via other HTTP methods as documented in the Building a RESTful CRUD Web Service how-to guide and the Web Service Endpoints reference page.

Content-Type Handling

Glyue parses integration web service HTTP(S) bodies in accordance with the request's Content-Type header value. The following behavior is enforced:

HTTP Request Content-Type(s)Body Parsing Behavior

application/json

Parsed as JSON into Pythonic data structure

application/xml or text/xml

Parsed as XML into Pythonic data structure

multipart/form-data

Parsed into one or more GlyueFileHandle objects in accordance to multipart/form-data standards

*/* or any other value

Parsed into one GlyueFileHandle object

It is possible to submit a single file in a multipart/form-data request.

Multipart / Form-Data Content Requirements

Glyue assumes that the name of the field in the form data is the name of the file in that field.

Non-file form data will appear in input.payload while the files will appear in input.files as shown below.

loan

FISCHER-20230531

note

Documents received from applicant today

driver_license.tiff

(file data)

bank_statement_01.pdf

(file data)

{
    ...
    "headers": {...},
    "payload": {
        "loan": "FISCHER-20230531",
        "note": "Documents received from applicant today"
    },
    "files": {
        "driver_license.tiff": <GlyueFileHandle ... >,
        "bank_statement_01.pdf": <GlyueFileHandle ... >,
    },
    ...
}

Single Binary / File Upload Requirements

Content type for these requests will vary depending on the file being sent. Some common content types that apply are application/zip, application/pdf, image/png, audio/mpeg, video/mp4, application/octet-stream.

Content-Disposition Header

In order for Glyue to be aware of the file's name, the request must include it within the Content-Disposition in a standards-compliant manner like the following:

Content-Disposition

attachment; filename=name_goes_here.docx

The above header would result in an input object with the following files content:

"payload": {},
"files": {
    "name_goes_here.docx": <GlyueFileHandle id=1 name=name_goes_here.docx>
}

Without the header, the default filename file (with no extension) would instead be used:

"files": {
    "file": <GlyueFileHandle id=1 name=file>
}

Last updated