Skip to content

Commit cfa9c47

Browse files
PPC2-4815: update upload doc (#288)
* PPC2-4815: update uplaod doc * PPC2-4815 addressed feedbacks * PPC2-4815: address commetns * PPC2-4815 : address fedbacks. * PPC2-4815 remove next line * PPC2-4815 : fix urls * PPC2-4815 : addressed the concern * PPC2-4815 : addressed the concern
1 parent d228c15 commit cfa9c47

File tree

1 file changed

+175
-0
lines changed

1 file changed

+175
-0
lines changed

tutorials/tutorial_uploads.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,178 @@ The following endpoints may also be used to move uploaded files into Procore dep
319319
- [Create Image](https://developers.procore.com/reference/rest/v1/images#create-image)
320320
- [Create Drawing Upload](https://developers.procore.com/reference/rest/v1/drawings#create-drawing-upload)
321321
- [Create Project File](https://developers.procore.com/reference/rest/v1/project-folders-and-files#create-project-file)
322+
323+
324+
## Using upload id in API Requests
325+
326+
This section provides examples of how to use the upload id when integrating with various Procore endpoints.
327+
328+
### What is upload_id?
329+
The `upload_id` refers to a unique identifier created during Procore's direct S3 upload process.
330+
This identifier represents a file that has been uploaded directly to Amazon S3 storage.
331+
332+
When a file is uploaded via the direct S3 method:
333+
334+
1. An upload record is created with a upload_id
335+
2. The file is uploaded directly to S3 from the client
336+
3. The upload_id can then be referenced in subsequent API calls to associate the file with specific Procore resources
337+
338+
339+
> IMPORTANT CONSIDERATIONS
340+
>
341+
> The system is designed to maintain compatibility with both new direct uploads using upload_id
342+
> and the legacy approach, but the upload_id method is strongly preferred for new implementations
343+
> due to its superior performance and resilience characteristics.
344+
345+
### Example-1: Using Upload id with Action Plans
346+
347+
When creating a test record attachment in the Action Plans tool, you can reference your uploaded file using its id:
348+
349+
- Request Method: `POST`
350+
- Request URL: `/rest/v1.0/projects/1/action_plans/plan_test_records`
351+
- Request Body:
352+
353+
```
354+
{
355+
"plan_test_record": {
356+
"plan_item_id": 54,
357+
"plan_test_record_request_id": 42,
358+
"type": "attachment",
359+
"payload": {
360+
"attachment": {
361+
"upload_id": "01JN2W87CCGXZBJFTW5YEDSPRRR"
362+
}
363+
}
364+
}
365+
}
366+
```
367+
368+
Response Body
369+
370+
```
371+
{
372+
"id": 128,
373+
"created_at": "2025-02-28T09:12:13Z",
374+
"payload": {
375+
"attachment": {
376+
"id": 540,
377+
"content_type": null,
378+
"name": "test_filename",
379+
"thumbnail_url": null,
380+
"url": "http://storage.procore.com/api/v5/files/us-east-1/pro-core.com-staging/companies/2/01JN2W87CCGXZBJFTW5YEDSPRRR?companyId=2&projectId=1&sig=e947909ff7f84d3b279af3059frd049339262d0eac9f1bfa7170702f1899a2560c",
381+
"viewer_url": "/webclients/host/companies/2/projects/1/tools/document-viewer/prostore/540?item_id=128&item_type=ActionPlans::Plan::TestRecord&parent_id=6&plan_item_id=49&fullscreen"
382+
}
383+
},
384+
"plan_id": 6,
385+
"plan_item_id": 49,
386+
"plan_test_record_request_id": 50,
387+
"type": "attachment",
388+
"updated_at": "2025-02-28T09:12:13Z"
389+
}
390+
```
391+
392+
### Example-2: Using Upload id with Meeting Topics
393+
You can create and update Meeting Topics with file attachments by referencing the upload id:
394+
395+
Creating a Meeting Topic with an attachment:
396+
397+
- Request Method: `POST`
398+
- Request URL: `/rest/v1.1/projects/{project_id}/meeting_topics`
399+
- Request Body:
400+
401+
```
402+
{
403+
"meeting_id": 538,
404+
"meeting_topic": {
405+
"title": "Creating a meeting topic with upload_ids",
406+
"description": "Fresh Create Meeting Topic with upload_ids",
407+
"upload_ids": ["01JNNGH4ZPX76PVYJX10A0Y5N9"]
408+
}
409+
}
410+
```
411+
412+
- Response Body
413+
414+
```
415+
{
416+
"id": 535,
417+
"number": "1.5",
418+
"created_on": "2025-03-06",
419+
"position": 5,
420+
"due_date": null,
421+
"priority": null,
422+
"status": "Open",
423+
"title": "Creating a meeting topic with upload_ids",
424+
"minutes": null,
425+
"description": "Fresh Create Meeting Topic with upload_ids",
426+
"meeting_category": {
427+
"id": 202,
428+
"title": "Uncategorized Items"
429+
},
430+
"assignments": [],
431+
"attachments": [
432+
{
433+
"id": 971407,
434+
"filename": "test_filename",
435+
"name": "test_filename",
436+
"url": "http://storage.procore.com/api/v5/files/us-east-1/pro-core.com-staging/companies/2/01JNNGH4ZPX76PVYJX10A0Y5N9?companyId=2&projectId=1&sig=564988041be708bfda9c52ccc0074809b18fb7f0c629a25d6798375b7223c618"
437+
}
438+
]
439+
}
440+
```
441+
442+
443+
### Example-3 Updating a Meeting Topic with an attachment:
444+
445+
- Request Method: `PATCH`
446+
- Request URL: `/rest/v1.1/projects/{project_id}/meeting_topics/{id}`
447+
- Request Body:
448+
449+
```
450+
{
451+
"meeting_id": 538,
452+
"meeting_topic": {
453+
"title": "Updating meeting topic with an upload_id",
454+
"description": "Updated Description",
455+
"upload_ids": ["01JNNDN3MVJ57BHA2NQR6R5F8D"]
456+
}
457+
}
458+
```
459+
460+
- Response Body
461+
462+
```
463+
{
464+
"id": 534,
465+
"number": "1.4",
466+
"created_on": "2025-03-06",
467+
"position": 4,
468+
"due_date": null,
469+
"priority": null,
470+
"status": "Open",
471+
"title": "Updating as form data key value with an attachment",
472+
"minutes": null,
473+
"description": "Updated Description",
474+
"meeting_category": {
475+
"id": 202,
476+
"title": "Uncategorized Items"
477+
},
478+
"assignments": [],
479+
"attachments": [
480+
{
481+
"id": 971406,
482+
"filename": "test_filename",
483+
"name": "test_filename",
484+
"url": "http://storage.procore.com/api/v5/files/us-east-1/pro-core.com-staging/companies/2/01JNNDN3MVJ57BHA2NQR6R5F8D?companyId=2&projectId=1&sig=e0179fd949a9a0505f7859be2d23575d01f0dfcc0e4adf320413808581b9c90e"
485+
}
486+
]
487+
}
488+
```
489+
490+
## Migrating from Legacy Uploads
491+
If you're currently using the legacy upload approach (via `attachments` or `data` attributes), we strongly recommend migrating to the `upload_id` approach. The benefits include:
492+
493+
- Improved upload performance and reliability
494+
- Reduced API request payload sizes
495+
- Better handling of large files
496+
- More consistent behavior across different Procore tools

0 commit comments

Comments
 (0)