Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Attachment Service


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


Anchor
createAttachment
createAttachment

Attachment Json

Create and update of attachments is using of calls with "multipart/form-data" content or by string.

The body of string format 

NameMandatory/OptionalTypeDescription
fileNameoptionalstringName of the attachment
imageDatamandatorystringdata for image


The responses of  json in following format :

NameTypeDescription
idguidAttachment Id
relatedIdguidID of the object/project/issue the attachment is attached to.
namestringAttachment name
fileNamestringName of the attachment's file
typestringAttachment's content type
sizeintFile size in bytes
sizeMBintFIle size in megabytes
createAtstring ( Date )Date of creation
creatorjson ( User )User who created the attachment
changedstring ( Date )Date of last modification
changedByjson ( User )User who did the modification
attachmentTypestringBimplus attachment type. Default type is "Document"
hashstringFile hash
classificationstringBimplus internal attachment classification.
tagstringOptional value, for additional marking of the attachment.
objectIdsarray of guidObsolete. Replaced by "relatedId"
versionintAttachment version
rightsjsonUser's right to the attachment, has following boolean properties : update, share, delete, download
releasestring(bool)True if attachment is share or false if attachment is not share.
Create the attachment
Deck of Cards
idbimcreateAttachment


Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: objects/<objects_id>/attachments

URLhttps://api-stage.bimplus.net/v2/<team_slug>/objects/<objects_id>/attachments

Examplehttps://api-stage.bimplus.net/v2/bimplus/objects/c411c33-8547-6587-eaf8-1a3a822def5/attachments


Card
labelHTTP Method
 POST


Card
labelDescription

Create of attachments is using of calls with "multipart/form-data" content or by string.


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json   or multipart/form-data


Code Block
borderColorRed
langxml
titleJSON
{
  "elements":["909ff986-f74e-44b5-bcf2-ec7b779e3011", "6b12bd40-a4c6-4eae-8a0b-b93592f71483"
  ],
  "ConnectionElement":{
    "elementtyp":"a48f8bcc-79c7-47ed-ab43-f8c7f0ddffdf",
    "type":"ConnectionElement",
    "layerid":"72b7e0ba-ae1a-4a71-b1ec-ad8f553fb3bc",
    "attributes":{
      "general":{
        "name":"Conection_Test",
        "description":"Connection_Part_Of_test"
      }
    },
    "children":[{
        "elementtyp":"0a98744d-baf5-4606-ad86-2097a93f188f",
        "parent":"61d54a09-3076-41f9-93e2-810cb3df99d0",
        "type":"Opening",
        "layerid":"0a98744d-baf5-4606-ad86-2097a93f188f",
        "attributes":{
          "general":{
            "name":"Hole_1"
          },
          "element":{
            "divisionid":"6a764b22-22dd-4cdb-83cc-33366ce8b4d3",
            "logparentid":"548126f3-d69e-485b-a8ba-8fc5a615ed1c",
            "matrix":{
              "Values":[1, 0, 0, 100,
                        0, 1, 0, 100,
                        0, 0, 1, 0,
                        0, 0, 0, 1 ]
            }
          },
          "geometry":{
            "csg":{
              "elements":[{
                  "type":"Path",
                  "crossSection":"RD8",
                  "vectorX":[1, 0, 0 ],
                  "vectorY":[0, 1, 0 ],
                  "geometry":[{
                      "geoType":"StartPolygon",
                      "point":[0, 0, 2900 ]
                    },
                    {
                      "geoType":"Line",
                      "point":[0, 0, 3200 ]
                    }
                  ]
                }
              ],
              "color":4286611584
            }
          }
        }
      }
    ]
  }
}



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 201 Created

The response format is application/octet-stream.




Anchor
getAttachmentInfo
getAttachmentInfo

Get Attachment information
Deck of Cards
idbimGetAttachmentInfo


Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: attachments/<attachment_id> 

URLhttps://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>

Examplehttps://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2


Card
labelHTTP Method
 GET


Card
labelDescription
 Get detailed information about a specified attachment.


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 200 OK


Code Block
borderColorRed
langxml
titleJSON
{
     "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"
}



Anchor
downloadAttachment
downloadAttachment

Download the attachment
Deck of Cards
idbimDownloadAttachment


Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: attachments/<attachment_id>/download 

URLhttps://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)

Examplehttps://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


Card
labelHTTP Method
 GET


Card
labelDescription

Download the content of a specified attachment.

There is a support to download the list of all attachments for selection object (if selection type is 'Elements' and defined elements are attachments) or the list of all attachments for structure node (for type of structure 'Document Folder'). In this case (attachments/<selection_id>/download or attachments/<structure_id>/download) the downloaded content is a compressed zip file including these attachments. If there is not any attachment for selection/structure the return code is 404 Not Found. If Selection\Document Folder structure contains files with same names, the return code is 403 Forbidden.

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).


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 200 OK

The response format is application/octet-stream.


Anchor
updateAttachment
updateAttachment

Update the attachment
Deck of Cards
idbimUpdateAttachment


Card
defaulttrue
labelURL / Resource / JSON Structure
 Resource: attachments/<attachment_id> 

URLhttps://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>

Example: https://api-stage.bimplus.net/v2/bimplus/attachments/e092b3ae-c022-46fd-aaea-a7b070142235



Card
labelHTTP Method
PUT


Card
labelDescription
 Update or replace a specified existing attachment with a new one.


Card
labelRequest

Bimplus supports creating and updating of attachments only using requests with multipart/form-data content type. By standard, multipart/form-data content consists of several parts, each part containing a file data.

But Bimplus supports only one file sent per call, so only first part of multipart form data content is used, the rest are ignored. The parts are separated by boundaries, each part contains content headers and content data.

Examples :

Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: multipart/form-data; boundary=----MyFormBoundarytlTJWL8i2mvYwGPW


Code Block
titleContent
------MyFormBoundarytlTJWL8i2mvYwGPW
Content-Disposition: form-data; name="TestFile"; filename="TestFile.xml"; classification="Report"; tag="ABCDE"
Content-Type: application/xml
 
**** Here are file data  ******
 
------MyFormBoundarytlTJWL8i2mvYwGPW

Where :

  • name and filename are mandatory saved as attachment's "name" and "filename" properties
  • classification and tag are optional, and are saved as attachment's properties "tag" and "classification"
  • Content-Type is mandatory and is saved as attachment's property "type"


Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 200 OK


Code Block
titleJson
{
     "objectIds": [
         "0d2ce2cc-3588-45d6-a59a-f6b89ebed34e"
     ],
     "fileName": "TestFile.xml",
     "type": "application/xml",
     "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" : "Report",
     "tag" : "ABCDE",
     "sizeMB" : "0,21",
     "version" : "1",
	 "release": "false"
     "relatedId" : "0d2ce2cc-3588-45d6-a59a-f6b89ebed34e",
     "rights" : {
         "update" : true,
         "share" : true,
         "delete" : true,
         "download" : true
     }
     "id": "6cea110a-88f4-43ac-9a00-ebaf677be333"
}



Anchor
deleteAttachment
deleteAttachment

Delete the Attachment
Deck of Cards
idbimDeleteAttachment


Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: attachments/<attachment_id> 

URLhttps://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>

Examplehttps://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2


Card
labelHTTP Method
 DELETE


Card
labelDescription
 Deletes a specified attachment.


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 200 OK



Anchor
attachmentFilter
attachmentFilter

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).

Anchor
createVersion
createVersion

Create a new version of an attachment
Deck of Cards
idbimCreateVersion


Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: attachments/<attachment_id>/versions

URLhttps://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/versions

Examplehttps://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


Card
labelHTTP Method
 POST


Card
labelDescription
 Create a new version of an attachment. The request headers and content are identical with that of update attachment ( see above ).


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: multipart/form-data



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 201 Created


Code Block
borderColorRed
langxml
titleJSON
   {
        "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"
    }



Anchor
getAllVersions
getAllVersions

Get all the versions of an attachment
Deck of Cards
idbimGetAllVersions


Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: attachments/<attachment_id>/versions

URLhttps://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/versions

Examplehttps://api-stage.bimplus.net/v2/bimplus/attachments/0d2ce2cc-3588-45d6-a59a-f6b89ebed34e/versions


Card
labelHTTP Method
 GET


Card
labelDescription
 Get all the version of an attachment


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 200 OK


Code Block
borderColorRed
langxml
titleJSON
    [
    {
        "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"
    }
]



Anchor
releaseAttachment
releaseAttachment

Share the attachment
Deck of Cards
idbimShareDocument


Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: attachments/<attachment_id>/release

URLhttps://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/release

Examplehttps://api-stage.bimplus.net/v2/bimplus/attachments/0d2ce2cc-3588-45d6-a59a-f6b89ebed34e/release


Card
labelHTTP Method
 PUT


Card
labelDescription
 Share the least version of projects attachment. Where attachemnt_id can by attachment, folder or selection.


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 200 OK


Code Block
borderColorRed
langxml
titleJSON
    {
	"id": "a9e2428d-c67c-4a56-9aeb-880a5dbfa6b3",
	"objectIds": ["00000000-0000-0000-0000-000000000000"],
	"fileName": "_.,_.,_,._.,_.,.ifc",
	"type": "application/octet-stream",
	"size": 6729,
	"createdAt": null,
	"creator": null,
	"hash": "",
	"attachmentType": "Document",
	"classification": "",
	"tag": "",
	"sizeMB": "0,01",
	"version": 1,
	"relatedId": "00000000-0000-0000-0000-000000000000",
	"release": true,
	"sharedDate": "2021-02-12T14:01:17.067456+01:00",
	"sharedBy": {
		"id": "efeb4da2-1c7c-4aa8-ab13-28638f9669a8",
		"email": "nemetschek@allplan.com",
		"firstname": "nem",
		"lastname": "tschek",
		"company": null,
		"fullname": "nemetschek",
		"displayname": "nemetschek",
		"shortdisplayname": "nemetschek"
	}
}



Anchor
downloadVersion
downloadVersion

Download a particular version of the attachment
Deck of Cards
idbimDownloadAttachment


Card
defaulttrue
labelURL / Resource / JSON Structure
Resourceattachments/<attachment_id>/versions/<version_no>/download

URLhttps://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)

Examplehttps://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


Card
labelHTTP Method
 GET


Card
labelDescription
 Download a particular version of the attachment


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 200 OK

The response format is application/octet-stream.



Anchor
deleteVersion
deleteVersion

Delete a particular version
Deck of Cards
idbimDeleteAttachment


Card
defaulttrue
labelURL / Resource / JSON Structure
Resourceattachments/<attachment_id>/versions/<version_no>

URLhttps://api-stage.bimplus.net/v2/<team_slug>/attachments/<attachment_id>/versions/<version_no>

Examplehttps://api-stage.bimplus.net/v2/bimplus/attachments/d0b3fc78-8f60-4e3f-ae72-65beb3dcb7d2/versions/1


Card
labelHTTP Method
 DELETE


Card
labelDescription
 Delete a particular version of the attachment


Card
labelRequest


Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json



Card
labelResponse


Code Block
borderColorGreen
langxml
titleStatus
Status: 200 OK