Skip to content
Developerhome
Sage Distribution and Manufacturing Operations

Check the status of the attachment

  Less than to read

Once the file has been uploaded, the attachment status of the file is updated.

The platform stores the uploaded file in a temporary place where sanity checks (mime type and anti-virus scan) are made.

These checks are made to ensure the file is safe and can be stored in the S3 bucket.

The following table displays an example and the result of checking the status of the attachment. Some of the fields displayed are not mandatory and others have been omitted.

query ($AttachmentId:Id!) { 
    xtremUpload { 
        attachment { 
            read (_id:$AttachmentId) { 
                _sourceId 
                _id 
                key 
                filename 
                mimeType 
                lastModified 
                lastDownloadDate 
                orphanedDate 
                contentLength 
                status 
                rejectReason 
                uploadUrl 
                downloadUrl 
                _etag 
                _createStamp 
                _updateStamp 
            } 
        } 
    } 
}
{ 
    "data": { 
        "xtremSales": { 
            "salesOrder": { 
                "query": { 
                    "edges": [ 
                        "_id": "1916", 
                        "downloadUrl": "https:…", 
                        "status": "verified", 
                        "_sourceId": "", 
                        "key": "D9SXBq1Y0X4CrIbMnmEME", 
                        "filename": "myfile.jpg", 
                        "mimeType": "image/jpeg", 
                        "lastModified": "2024-03-27T00:00:00.000Z", 
                        "lastDownloadDate": null, 
                        "orphanedDate": null, 
                        "contentLength": "40851", 
                        "rejectReason": "", 
                        "uploadUrl": "", 
                        "_etag": "…", 
                        "_createStamp": "2024-05-03T13:46:44.332Z", 
                        "_updateStamp": "2024-05-03T13:47:18.545Z" 
                    ] 
                } 
            }
        } 
    }
}

If the status of the query is set to Verified, it means that all the checks were successful and you can securely link the file to a record.

This query also returns a URL to download the file.