Attachment Service
- Get attachment information
- Download the attachment
- Update the attachment
- Delete the attachment
- Filter for getting project-only attachments & attachments that belong to a particular attachment-type
- Create a new version of an attachment
- Get all the versions of an attachment
- Download a particular version
- Delete a particular version
Attachment Service
Attachments are mostly documents or any media files with additional information which can be assigned to any project, object, issue or slide. Please see the detailed structure of the attachment in the Object Model
- Please use the Bimplus Project Service for creating an attachment or for getting/deleting all the attachments of a project
- Please use the Bimplus Object Service for creating an attachment or for getting/deleting all the attachments of an object, issue or slide
Get Attachment information
URL: https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>
Example: https://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
{ "objectIds": [ "0d2ce2cc-3588-45d6-a59a-f6b89ebed34e" ], "fileName": "Building_Plan.jpg", "type": "image/jpeg", "size": 211258, "createdAt": "2013-12-11T10:47:39", "creator": { "id": "e18941f4-a809-2d01-d27d-cd251f2b6cb6", "email": "test@bimplus.net", "firstname": "First Name", "lastname": "Second Name", "company": "Best-Company", "fullname": "First Name Second Name", "displayname": "Best-Company", }, "changed" : "2013-12-11T10:47:39", "changedBy" : { "id": "e18941f4-a809-2d01-d27d-cd251f2b6cb6", "email": "test@bimplus.net", }, "hash": "68a59c1f-1914-43b8-92fc-1cee4ad1c90c", "attachmentType" : "Document", "classification" : "", "tag" : "", "sizeMB" : "0,21", "version" : "1", "relatedId" : "0d2ce2cc-3588-45d6-a59a-f6b89ebed34e", "rights" : { "update" : true, "share" : true, "delete" : true, "download" : true } "id": "6cea110a-88f4-43ac-9a00-ebaf677be333" }
Download the attachment
URL: https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/download OR https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/download?api-token=token (If the client cannot use the token in the header request)
Example: https://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2/download OR https://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2/download?api-token=9c1874a62c974dcfa75e0132c423a088
Download the content of a specified attachment. The token can be also provided as the query string for downloading the attachment(If the client cannot use the token in the header request).
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
The response format is application/octet-stream.
Update the attachment
URL: https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>
Example:
JSON Structure:
Name |
Mandatory / Optional |
Type |
Description |
---|---|---|---|
objectIds |
optional |
string |
The id of the objects to which the file has to be attached |
fileName |
optional |
string |
Name of the file to be attached to the project |
type |
optional |
string |
Mime type |
sizeInMB |
optional |
integer |
Size of the file to be attached to the project |
createdAt | will be ignored | string | Creation date of the attachment |
creator | will be ignored | object | The user who created the attachment |
attachmentType | will be ignored | string | Type of attachment. It could be one of the following : Thumbnail, Ifc, SketchUp, AllplanResource, AllplanDrawing, AllplanLayout, AllplanLayoutDocument, AutodeskResource, Revit, AutoCadDrawing Please note that there exists a filter for it. See the filter section |
classification | optional | string | Classify the attachments. The existing classifications are : Plan, Cost, Contract, Drawing , Specification, Report, Image |
tag | optional | string | User defined classification. We will make change this into a list later |
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
Delete the Attachment
URL: https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>
Example: https://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
Filter for getting project-only attachments & attachments that belong to a particular attachment-type
- The normal attachment GET call (i.e projects/<project_id>/attachments) returns all the attachments inside a project i.e it iterates through all the objects inside a project and returns everything. If we want to retrieve the only the attachments that belongs to the project directly, then use ?projectOnly=true filter (i.e projects/<project_id>/attachments?projectOnly=true)
- Bimplus recognized following types of attachments : Document, Thumbnail, Ifc, SketchUp, AllplanResource, AllplanDrawing, AllplanLayout, AllplanLayoutDocument, AutodeskResource, Revit, AutoCadDrawing, BcfZip.
Of those, the type "Document" is handled as public and visible to all applications. The rest are either Bimplus internal, or application specific attachment types, visible only to the particular applications ( e.g. all "Allplan..." types are used by Allplan only ).
If the type is not specified, the default type "Document' is used. - The normal attachment GET call (i.e projects/<project_id>/attachments) returns by default only the attachments of type "Document". If you want to retrieve the attachments that belongs to particular attachment type, then specify the type in the filter ?attachmentType=<requested_type> (eg: projects/<project_id>/attachments?attachmentType=Ifc&attachmentType=SketchUp).
Create a new version of an attachment
URL: https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/versions
Example: https://api-stage.bimplus.net/v2/bimplus/attachments/0d2ce2cc-3588-45d6-a59a-f6b89ebed34e/versions
JSON Structure: Please note that all the information required for this call will be taken from the document that you attach and hence the request of this call has no body. The request Content-Type is multipart/form-data
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: multipart/form-data
Status: 201 Created
{ "objectIds": [ "00000000-0000-0000-0000-000000000000" ], "fileName": "CommentDTO.png", "type": "image/png", "size": 19565, "createdAt": "2014-02-18T14:26:26", "creator": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "jayaraj.purushothaman@gmail.com", "status": "Active", "firstname": "Jayaraj", "lastname": "Purushothaman", "company": "Jay Company", "fullname": "Jayaraj Purushothaman", "displayname": "Jayaraj Purushothaman [Jay Company]", "info": null, "gender": "MR", "phoneWork": null, "phoneHome": null, "fax": null, "mobile": "", "birthDate": null, "address": { "street": "", "streetNr": "", "zip": "", "city": "", "country": "" }, "preferedLanguage": "en" }, "changed": "2014-02-18T14:26:26", "changedBy": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "jayaraj.purushothaman@gmail.com" }, "hash": "8ca75220-5580-4413-b29f-0e93267a6524", "classification": "", "tag": "", "sizeMB": "0,02", "version": 1, "id": "f40a22a0-5c53-4d1b-8e93-e1556514828d" }
Get all the versions of an attachment
URL: https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/versions
Example: https://api-stage.bimplus.net/v2/bimplus/attachments/0d2ce2cc-3588-45d6-a59a-f6b89ebed34e/versions
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
[ { "objectIds": [ "9022417d-261f-4dfa-83d3-66405232722f" ], "fileName": "CommentDTO.png", "type": "image/png", "size": 107633, "createdAt": "2014-02-18T14:26:26", "creator": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "jayaraj.purushothaman@gmail.com", "status": "Active", "firstname": "Jayaraj", "lastname": "Purushothaman", "company": "Jay Company", "fullname": "Jayaraj Purushothaman", "displayname": "Jayaraj Purushothaman [Jay Company]", "info": null, "gender": "MR", "phoneWork": null, "phoneHome": null, "fax": null, "mobile": "", "birthDate": null, "address": { "street": "", "streetNr": "", "zip": "", "city": "", "country": "" }, "preferedLanguage": "en" }, "changed": "2015-11-18T10:16:32.233", "changedBy": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "jayaraj.purushothaman@gmail.com" }, "hash": "59c2b69d-fb99-4b62-8c2b-5f3c7531ffb2", "attachmentType": "NonModel", "classification": "", "tag": "", "sizeMB": "0,1", "version": 2, "id": "f40a22a0-5c53-4d1b-8e93-e1556514828d" }, { "objectIds": [ "00000000-0000-0000-0000-000000000000" ], "fileName": "CommentDTO.png", "type": "image/png", "size": 19565, "createdAt": "2014-02-18T14:26:26", "creator": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "jayaraj.purushothaman@gmail.com", "status": "Active", "firstname": "Jayaraj", "lastname": "Purushothaman", "company": "Jay Company", "fullname": "Jayaraj Purushothaman", "displayname": "Jayaraj Purushothaman [Jay Company]", "info": null, "gender": "MR", "phoneWork": null, "phoneHome": null, "fax": null, "mobile": "", "birthDate": null, "address": { "street": "", "streetNr": "", "zip": "", "city": "", "country": "" }, "preferedLanguage": "en" }, "changed": "2014-02-18T14:26:26", "changedBy": { "id": "71e0ac3b-fa49-e540-ac2f-8caff3dd72ed", "email": "jayaraj.purushothaman@gmail.com" }, "hash": "8ca75220-5580-4413-b29f-0e93267a6524", "classification": "", "tag": "", "sizeMB": "0,02", "version": 1, "id": "f40a22a0-5c53-4d1b-8e93-e1556514828d" } ]
Download a particular version of the attachment
URL: https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/versions/<version_no>/download OR https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/versions/<version_no>/download?api-token=token (If the client cannot use the token in the header request)
Example: https://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2/versions/1/download OR https://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2/versions/<version_no>/download?api-token=9c1874a62c974dcfa75e0132c423a088
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK
The response format is application/octet-stream.
Delete a particular version
URL: https://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/versions/<version_no>
Example: https://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2/versions/1
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088 Content-Type: application/json
Status: 200 OK