File Data Layout
How file objects appear in graphiteConnect profile data, and how to retrieve and upload files via the public API.
File Data Layout
Files stored as part of company data in graphiteConnect are represented in the profile data as JSON objects with a mimeType field, rather than inline binary content.
File Object Structure
When a supplier has uploaded a file in response to a question, the answer value for that question is a JSON object similar to the following:
{
"fileId": "5f8a2c1e4b3d7f9a0c2e6b4d",
"mimeType": "application/pdf",
"fileName": "W9_Form_2024.pdf",
"graphiteUrl": "https://app.graphiteconnect.com/connections/US1234/CONN5678?answerKey=W9_Document"
}URL-Type Files
If mimeType is set to "url", the fileId field contains a URL supplied directly by the vendor rather than a file stored in graphiteConnect. These URLs are not validated by Graphite.
{
"fileId": "https://example.com/vendor-certifications",
"mimeType": "url"
}AV Scanning
For all non-URL file uploads, graphiteConnect performs an antivirus (AV) scan before allowing the upload to complete. Files are not available for retrieval via the API until the AV scan has finished and the file has been cleared.
Retrieving Files
To download a file, use the fileId value from the file object and make a GET request to the public file API:
GET https://poc.projectgraphite.com/api/public/api/v1/file/{fileId}
Headers:
Authorization: Bearer <your_access_token>
The response will be the file content with the appropriate Content-Type header.
Uploading Files
To upload a file via the API, include the file contents as a base64-encoded string in a POST request to PATCH /profile/{publicId} (or POST /profile/{publicId}). The request body should use the answer key for the file question as the field name:
{
"W9_Document": {
"fileName": "W9_Form_2024.pdf",
"fileContentsBase64": "JVBERi0xLjQKJc..."
}
}| Field | Description |
|---|---|
fileName | The name of the file being uploaded, including extension |
fileContentsBase64 | The full file contents encoded as a base64 string |
Deep Links to File Questions
Each file object includes a graphiteUrl field that provides a deep link directly to the question in the graphiteConnect web UI. This can be used to direct users to view or update a specific file. See Linking to Graphite for details on deep link parameters.
Related Documentation
- Company Data Layout — Overview of the full profile data structure
- Linking to Graphite — Using
graphiteUrland other deep link parameters
Updated about 7 hours ago
