Opportunity Documents are read from the following endpoint
curl -X GET \
https://compass.cosential.com/api/documents/opportunities/123456/123 \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'x-compass-api-key: ********-****-****-*****-************' \
-H 'x-compass-firm-id: *'
Cache-Control →no-cache
CompassVersion →1.0
Content-Disposition →attachment; filename="YourDocument.docx"
Content-Length →14702
Content-Type →application/vnd.openxmlformats-officedocument.wordprocessingml.document
Date →Mon, 26 Mar 2018 16:38:21 GMT
[binary data]
Opportunity documents are created by uploading a document via HTTP POST. The endpoint /api/documents/opportunities/<opportunityId> will accept one or more files via mime-mulitpart. A successfully call returns a JSON array containing a response for each Document uploaded. By default documents are uploaded as shared with a Title that is the same as the document name. These items can later be altered at the /api/opportunities/<opportunityId>/documents/<documentId> endpoint via HTTP PUT.
curl -X POST \
https://compass.cosential.com/api/documents/opportunities/123456/ \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'x-compass-api-key: ***********************-*********' \
-H 'x-compass-firm-id: *' \
-F '=@C:\Users\User01\Documents\Synchronizer.vsdx' \
-F '=@C:\Users\User01\Documents\firms.xlsx'
[
{
"DocumentId": 394223,
"IsPrivate": false,
"ClientFileName": "Synchronizer.vsdx",
"Created": "2018-03-26T11:58:16.4644658-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".vsdx",
"FileSize": 65770,
"Title": "Synchronizer.vsdx",
"Category": null
},
{
"DocumentId": 394224,
"IsPrivate": false,
"ClientFileName": "firms.xlsx",
"Created": "2018-03-26T11:58:17.1389357-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".xlsx",
"FileSize": 9507,
"Title": "firms.xlsx",
"Category": null
}
]
curl -X POST \
'https://compass.cosential.com/api/documents/opportunities/876423/?url=https://download.thefileserver.com/manuals/all-products/precision.pdf' \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'x-compass-api-key: ***********************-*********' \
-H 'x-compass-firm-id: *'
[
{
"DocumentId": 394226,
"IsPrivate": false,
"ClientFileName": "precision.pdf",
"Created": "2018-03-26T13:37:25.6082753-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision.pdf",
"Category": null
}
]
You can use the endpoint /api/opportunities/<opportunityId>/documents/<documentId> for updating opportunity document metadata.
curl -X PUT \
https://compass.cosential.com/api/opportunities/876423/documents/394226 \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd' \
-d '{
"Description": "My description",
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision"
}'
{
"DocumentId": 394226,
"IsPrivate": false,
"ClientFileName": "precision.pdf",
"Created": "2018-03-26T13:37:25.607",
"IsDeleted": false,
"Description": "precision",
"MetaData": null,
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision.pdf",
"Category": null
}
To replace a binary document, Use an HTTP PUT to the endpoint /api/documents/opportunities/<opportunityId>/<documentId>.
curl -X POST \
https://compass.cosential.com/api/documents/opportunities/123456/789012 \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'x-compass-api-key: ***********************-*********' \
-H 'x-compass-firm-id: *' \
-F '=@C:\Users\User01\Documents\Synchronizer.vsdx'
An HTTP DELETE request to the opportunity document metadata endpoint OR the document endpoint will delete both the metadata AND the document.
curl -X DELETE \
-H 'x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd' \
https://compass.cosential.com/api/opportunities/123456/documents/1234
[200 OK]
Project Documents are read from the following endpoint
curl -X GET \
https://compass.cosential.com/api/documents/projects/123456/123 \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'x-compass-api-key: ********-****-****-*****-************' \
-H 'x-compass-firm-id: *'
Cache-Control →no-cache
CompassVersion →1.0
Content-Disposition →attachment; filename="YourDocument.docx"
Content-Length →14702
Content-Type →application/vnd.openxmlformats-officedocument.wordprocessingml.document
Date →Mon, 26 Mar 2018 16:38:21 GMT
[binary data]
Project documents are created by uploading a document via HTTP POST. The endpoint /api/documents/projects/<projectId> will accept one or more files via mime-multipart. A successful call returns a JSON array containing a response for each Document uploaded. By default documents are uploaded as shared with a Title that is the same as the document name. These items can later be altered at the /api/projects/<projectId>/documents/<documentId> endpoint via HTTP PUT.
curl -X POST \
https://compass.cosential.com/api/documents/projects/123456/ \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'x-compass-api-key: ***********************-*********' \
-H 'x-compass-firm-id: *' \
-F '=@C:\Users\User01\Documents\Synchronizer.vsdx' \
-F '=@C:\Users\User01\Documents\firms.xlsx'
[
{
"DocumentId": 394223,
"IsPrivate": false,
"ClientFileName": "Synchronizer.vsdx",
"Created": "2018-03-26T11:58:16.4644658-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".vsdx",
"FileSize": 65770,
"Title": "Synchronizer.vsdx",
"Category": null
},
{
"DocumentId": 394224,
"IsPrivate": false,
"ClientFileName": "firms.xlsx",
"Created": "2018-03-26T11:58:17.1389357-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".xlsx",
"FileSize": 9507,
"Title": "firms.xlsx",
"Category": null
}
]
curl -X POST \
'https://compass.cosential.com/api/documents/projects/876423/?url=https://download.thefileserver.com/manuals/all-products/precision.pdf' \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'x-compass-api-key: ***********************-*********' \
-H 'x-compass-firm-id: *'
[
{
"DocumentId": 394226,
"IsPrivate": false,
"ClientFileName": "precision.pdf",
"Created": "2018-03-26T13:37:25.6082753-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision.pdf",
"Category": null
}
]
You can use the endpoint /api/projects/<projectId>/documents/<documentId> for updating project document metadata.
curl -X PUT \
https://compass.cosential.com/api/projects/876423/documents/394226 \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd' \
-d '{
"Description": "My description",
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision"
}'
{
"DocumentId": 394226,
"IsPrivate": false,
"ClientFileName": "precision.pdf",
"Created": "2018-03-26T13:37:25.607",
"IsDeleted": false,
"Description": "precision",
"MetaData": null,
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision.pdf",
"Category": null
}
To replace a binary document, Use an HTTP PUT to the endpoint /api/documents/projects/<projectId>/<documentId>.
curl -X POST \
https://compass.cosential.com/api/documents/projects/123456/789012 \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'x-compass-api-key: ***********************-*********' \
-H 'x-compass-firm-id: *' \
-F '=@C:\Users\User01\Documents\Synchronizer.vsdx'
An HTTP DELETE request to the project document metadata endpoint OR the document endpoint will delete both the metadata AND the document.
curl -X DELETE \
-H 'x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd' \
https://compass.cosential.com/api/projects/123456/documents/1234
[200 OK]
Project Reference Documents are read from the following endpoint
curl -X GET \
https://compass.cosential.com/api/projects/123456/references/123456/documents \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'x-compass-api-key: ********-****-****-*****-************' \
-H 'x-compass-firm-id: *'
Cache-Control →no-cache
CompassVersion →1.0
Content-Disposition →attachment; filename="YourDocument.docx"
Content-Length →14702
Content-Type →application/vnd.openxmlformats-officedocument.wordprocessingml.document
Date →Mon, 26 Mar 2018 16:38:21 GMT
[binary data]
Project Reference documents are created by uploading a document via HTTP POST. The endpoint /api/projects/<projectId>/references/<referenceId>/documents will accept one or more files via mime-multipart. A successful call returns a JSON array containing a response for each Document uploaded. By default documents are uploaded as shared with a Title that is the same as the document name. These items can later be altered at the /api/projects/<projectId>/references/<referenceId>/documents/<documentId> endpoint via HTTP PUT.
curl -X POST \
https://compass.cosential.com/api/projects/123456/references/123456/documents \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'x-compass-api-key: ***********************-*********' \
-H 'x-compass-firm-id: *' \
-F '=@C:\Users\User01\Documents\Synchronizer.vsdx' \
-F '=@C:\Users\User01\Documents\firms.xlsx'
[
{
"DocumentId": 394223,
"IsPrivate": false,
"ClientFileName": "Synchronizer.vsdx",
"Created": "2018-03-26T11:58:16.4644658-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".vsdx",
"FileSize": 65770,
"Title": "Synchronizer.vsdx",
"Category": null
},
{
"DocumentId": 394224,
"IsPrivate": false,
"ClientFileName": "firms.xlsx",
"Created": "2018-03-26T11:58:17.1389357-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".xlsx",
"FileSize": 9507,
"Title": "firms.xlsx",
"Category": null
}
]
curl -X POST \
'https://compass.cosential.com/api/projects/123456/references/123456/documents?url=https://download.thefileserver.com/manuals/all-products/precision.pdf' \
-H 'Authorization: Basic *****************=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'x-compass-api-key: ***********************-*********' \
-H 'x-compass-firm-id: *'
[
{
"DocumentId": 394226,
"IsPrivate": false,
"ClientFileName": "precision.pdf",
"Created": "2018-03-26T13:37:25.6082753-05:00",
"IsDeleted": false,
"Description": null,
"MetaData": null,
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision.pdf",
"Category": null
}
]
You can use the endpoint /api/projects/<projectId>/references/<referenceId>/documents/<documentId> for updating project reference document metadata.
curl -X PUT \
https://compass.cosential.com/api/projects/876423/references/123456/documents/394226 \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd' \
-d '{
"Description": "My description",
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision"
}'
{
"DocumentId": 394226,
"IsPrivate": false,
"ClientFileName": "precision.pdf",
"Created": "2018-03-26T13:37:25.607",
"IsDeleted": false,
"Description": "precision",
"MetaData": null,
"Extension": ".pdf",
"FileSize": 141804,
"Title": "precision.pdf",
"Category": null
}
Compass does not update document binaries once uploaded. To replace a binary document, first delete the document with an HTTP DELETE request and then upload a new Binary via HTTP POST.
An HTTP DELETE request to the project reference document metadata endpoint OR the document endpoint will delete both the metadata AND the document.
curl -X DELETE \
-H 'x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd' \
https://compass.cosential.com/api/projects/123456/references/123456/documents/1234
[200 OK]