This endpoint retrieves a specific document file from the FSS (File Storage Service) API and returns it as a PDF. The document is fetched as a binary buffer and streamed to the client.
This endpoint requires authentication and authorization via the access control plugin.Required Permission:accessFinanceDocumentAllowed Roles:
Chief Executive Officer (CEO)
Head of Finance (HOF)
Finance Officer (FO)
Head of Waste (HOW)
Waste Officer (WO)
Users without the required permission will receive a 403 Forbidden response. All requests are logged for audit purposes with the action kind DocumentAccessed.
Validates the id parameter (required, trimmed string)
Checks authorization via the access control plugin
Fetches the document file from FSS API: {fssApiUrl}/now/attachment/{id}/file
Converts the response to an array buffer
Returns the PDF with appropriate Content-Type header
Logs the action for audit purposes with outcome (Success/Failure)
The FSS API endpoint /now/attachment/{id}/file is a ServiceNow attachment API that returns the raw file data. The x-sn-apikey header is used for authentication with the FSS API.