Attachments
Uploading files to ProofHub is a two-step process:
- Create the attachment and receive a file ID confirming the upload was successful.
- Attach the uploaded file to a topic, comment, task, or file section.
Related endpoints:
Create Attachments
Section titled “ Create Attachments ” POST
https://<company-url>.proofhub.com/files/upload.php uploads a file. The request body should contain the file data along with the required parameters. Replace company-url with your ProofHub account URL. File uploading via API is a two-step process.
Step 1: Upload the file
Request URL:
POST https://<company-url>.proofhub.com/files/upload.php
Headers:
x-api-key: YOUR_API_KEY
Form Data:
project_id: <project_id> file: <select_file>
The response will contain a file_id. Save this value because it
is required in the next step.
Step 2: Attach the uploaded file
Request URL:
POST /api/v3/projects/<project_id>/folders/<folder_id>/files
Headers:
x-api-key: YOUR_API_KEY Content-Type: application/json
Request Body:
{
"folder": 12345,
"attachments": [98765]
} Where:
folder= Target folder ID.attachments= File ID returned from Step 1.
If the folder parameter is not specified, the file will be
uploaded to the project's home folder.