Attachment Print - Base64

Download a document - via JSON base64 string

Attachment Print - Base64

ParameterMandatoryDescriptionExamplesMore Info
APIYesThe API areaattachments.json
GeneralYesParameters described in overviewAuthorization: Bearer <access_token> header — see Synergist API AuthenticationStructure of an API call
ActionYesThe action to performaction=attachmentview
IdentifierYesAttachment ID or UUIDattachment=5471

If the attachment is stored in S3 (cloud) it has to download from AWS to the 4D Server and converted into base64.

Example request (OAuth 2.0):

Authorization: Bearer <access_token>
http://&lt;SERVER&gt;/jsonapi/attachments.json?&&version=6&company=1&attachment=5471&action=attachmentview

Example request (legacy username/password):

http://&lt;SERVER&gt;/jsonapi/attachments.json?&&version=6&company=1&attachment=5471&action=attachmentview&user=<username>&password=<password>

Example response:

{
  "responsecode": 1,
  "responsestatus": "OK",
  "errorcode": 0,
  "errormessage": "",
  "totalrows": 1,
  "totalpages": 1,
  "responsemessage": "",
  "pagerows": 0,
  "pagenumber": 1,
  "success": true,
  "data": [
    {
      "attachmentUuid": "E4A7C32FC8A5D849BED41CDA8256DBF2",
      "attachmentTimestampModified": 1501773244,
      "attachmentRecordVersionNumber": 1,
      "attachmentOriginalFilename": "tmp.csv",
      "attachmentBase64": "SEVSRSBJUyBTT01FIFRFWFQNCg==",
      "attachmentContentDisposition": "attachment; filename=\"tmp.csv\"",
      "attachmentContentType": "application/csv"
    }
  ]
}