...
- 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
Attachment Json
Create and update of attachments is using of calls with "multipart/form-data" content or by string.
The body of string format
Name | Mandatory/Optional | Type | Description |
---|
fileName | optional | string | Name of the attachment |
imageData | mandatory | string | data for image |
The responses of GET are jsons in following format :
Name | Type | Description |
---|
id | guid | Attachment Id |
relatedId | guid | ID of the object/project/issue the attachment is attached to. |
name | string | Attachment name |
fileName | string | Name of the attachment's file |
type | string | Attachment's content type |
size | int | File size in bytes |
sizeMB | int | FIle size in megabytes |
createAt | string ( Date ) | Date of creation |
creator | json ( User ) | User who created the attachment |
changed | string ( Date ) | Date of last modification |
changedBy | json ( User ) | User who did the modification |
attachmentType | string | Bimplus attachment type. Default type is "Document" |
hash | string | File hash |
classification | string | Bimplus internal attachment classification. |
tag | string | Optional value, for additional marking of the attachment. |
objectIds | array of guid | Obsolete. Replaced by "relatedId" |
version | int | Attachment version |
rights | json | User's right to the attachment, has following boolean properties : update, share, delete, download |
release | string(bool) | True if attachment is share or false if attachment is not share. |
...
Anchor |
---|
| getAttachmentInfo |
---|
| getAttachmentInfo |
---|
|
...
Deck of Cards |
---|
|
Card |
---|
| Update or replace a specified existing attachment with a new one. |
Card |
---|
| 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 |
---|
borderColor | Green |
---|
lang | xml |
---|
title | Headers |
---|
| Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: multipart/form-data; boundary=----MyFormBoundarytlTJWL8i2mvYwGPW
|
Code Block |
---|
| ------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 |
---|
|
Code Block |
---|
borderColor | Green |
---|
lang | xml |
---|
title | Status |
---|
| Status: 200 OK
|
Code Block |
---|
| {
"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"
} |
|
|
...
Deck of Cards |
---|
|
Card |
---|
default | true |
---|
label | URL / Resource / JSON Structure |
---|
| Resource: attachments/<attachment_id>/versions/<version_no>/download
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 |
Card |
---|
| Download a particular version of the attachment
|
Card |
---|
|
Code Block |
---|
borderColor | Green |
---|
lang | xml |
---|
title | Headers |
---|
| Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
|
|
Card |
---|
|
Code Block |
---|
borderColor | Green |
---|
lang | xml |
---|
title | Status |
---|
| Status: 200 OK
|
The response format is application/octet-stream.
|
|
Anchor |
---|
| deleteVersion |
---|
| deleteVersion |
---|
|
...