The following endpoints can be used to read contact images
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H Accept:application/json \
https://compass.cosential.com/api/images/contact/54321/profilepicture
{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAgEAAAAAAAD/="
}
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H Accept:image/jpeg \
https://compass.cosential.com/api/images/contact/54321/profilepicture
[binary data]
An HTTP PUT request to the following endpoints can be used to update contact images
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/x-www-form-urlencoded" -d '' \
https://compass.cosential.com/api/images/contact/54321/cardback?url=https%3a%2f%2fcompass.cosential.com%2fcontent%2fimages%2flogo.png
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
-F "data=[object Object]" \
https://compass.cosential.com/api/images/contact/54321/cardback
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/json" \
-d '{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAQEAAAAAAAD/9k="
}' \
https://compass.cosential.com/api/images/contact/54321/cardback
[200 OK]
An HTTP DELETE request to the following endpoints can be used to delete contact images
curl -X DELETE \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
https://compass.cosential.com/api/images/contact/54321/cardback
[200 OK]
The following endpoint can be used to read the company logo image.
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H Accept:application/json \
https://compass.cosential.com/api/images/companies/54321
{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAgEAAAAAAAD/="
}
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H Accept:image/jpeg \
https://compass.cosential.com/api/images/companies/54321
[binary data]
An HTTP PUT request to the following endpoints can be used to update company images
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/x-www-form-urlencoded" -d '' \
https://compass.cosential.com/api/images/companies/54321?url=https%3a%2f%2fcompass.cosential.com%2fcontent%2fimages%2flogo.png
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
-F "data=[object Object]" \
https://compass.cosential.com/api/images/companies/54321
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/json" \
-d '{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAQEAAAAAAAD/9k="
}' \
https://compass.cosential.com/api/images/companies/54321
[200 OK]
An HTTP DELETE request to the following endpoints can be used to delete company images
curl -X DELETE \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
https://compass.cosential.com/api/images/companies/54321
[200 OK]
Project images are created with two or more API calls. The first call is to create one or more project image metadata objects using the endpoint /api/projects/<projectId>/images. Once the metadata is created, you can use the endpoint /api/images/project/<projectId>/<imageId> to upload the image binary data.
curl -X POST -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-d '[{
"ImageName": "file1.jpg",
"Caption": "Big Building Site",
"Keywords": "building,construction,blue,sky",
"IsWebsiteImage": true,
"IsWebsiteThumbnail": false,
"NetworkPath": "\\\\files.mycompany.com\\files\\file1.jpg",
"Comments": "This building is scheduled to be built soon"
},{
"ImageName": "file2.jpg"
}]' https://compass.cosential.com/api/projects/54321/images
[
{
"ProjectId": 54321,
"ProjectName": "Blue Skies Big Building",
"ProjectNumber": "",
"ImageId": 76543,
"ImageName": "file1.jpg",
"Caption": "Big Building Site",
"Credit": null,
"Keywords": "building,construction,blue,sky",
"IsWebsiteImage": true,
"IsWebsiteThumbnail": false,
"NetworkPath": "\\\\files.mycompany.com\\files\\file1.jpg",
"CDRomPath": null,
"ImageNumber": null,
"OrderNumber": null,
"AccessLevel": null,
"Comments": "This building is scheduled to be built soon",
"UploadDate": "0001-01-01T00:00:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543",
"WebsiteImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543/web",
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543/thumb"
},
{
"ProjectId": 54321,
"ProjectName": "Blue Skies Big Building",
"ProjectNumber": "",
"ImageId": 76544,
"ImageName": "file2.jpg",
"Caption": null,
"Credit": null,
"Keywords": null,
"IsWebsiteImage": false,
"IsWebsiteThumbnail": false,
"NetworkPath": null,
"CDRomPath": null,
"ImageNumber": null,
"OrderNumber": null,
"AccessLevel": null,
"Comments": null,
"UploadDate": "0001-01-01T00:00:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76544",
"WebsiteImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76544/web",
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76544/thumb"
}
]
Now that we have the metadata objects created, image data can be sent using an HTTP PUT call to the OriginalImageEndpoint found in the metadata object. The endpoint is /api/images/project/<projectId>/<imageId>
There are several different ways to upload the image data.
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/x-www-form-urlencoded" -d '' \
https://compass.cosential.com/api/images/project/54321/76543?url=https%3a%2f%2fcompass.cosential.com%2fcontent%2fimages%2flogo.png
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
-F "data=[object Object]" \
https://compass.cosential.com/api/images/project/54321/76543
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/json" \
-d '{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAQEAAAAAAAD/9k="
}' \
https://compass.cosential.com/api/images/project/54321/76543
[200 OK]
Project images are read using one of the following endpoints
The web and thumbnail endpoints accept the following optional URL paramaters:
The HTTP Accept Header is used to get the image in different formats. The supported formats are:
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H Accept:application/json \
https://compass.cosential.com/api/images/project/54321/76543/web?maxWidth=100
{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAgEAAAAAAAD/="
}
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H Accept:image/jpeg \
https://compass.cosential.com/api/images/project/54321/76543/thumb?maxHeight=400&jpegQuality=50
[binary data]
Two different endpoints exist for project image data. You can use the endpoint /api/projects/<projectId>/images/<imageId> for updating project image metadata, and you can use the endpoint /api/images/project/<projectId>/<imageId> to upload the image binary data.
curl -X PUT \
-H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-d '{
"Caption": "Big Building",
"Keywords": "building,construction,blue,sky,ground",
"IsWebsiteImage": true,
"IsWebsiteThumbnail": false,
"Comments": "This building project has started"
}' https://compass.cosential.com/api/projects/54321/images/76543
{
"ProjectId": 54321,
"ProjectName": "Blue Skies Big Building",
"ProjectNumber": "",
"ImageId": 76543,
"ImageName": "file1.jpg",
"Caption": "Big Building",
"Credit": null,
"Keywords": "building,construction,blue,sky,ground",
"IsWebsiteImage": true,
"IsWebsiteThumbnail": false,
"NetworkPath": "\\\\files.mycompany.com\\files\\file1.jpg",
"CDRomPath": null,
"ImageNumber": null,
"OrderNumber": null,
"AccessLevel": null,
"Comments": "This building project has started",
"UploadDate": "0001-01-01T00:00:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543",
"WebsiteImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543/web",
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543/thumb"
}
There are several different ways to update the image data.
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/x-www-form-urlencoded" -d '' \
https://compass.cosential.com/api/images/project/54321/76543?url=https%3a%2f%2fcompass.cosential.com%2fcontent%2fimages%2flogo.png
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
-F "data=[object Object]" \
https://compass.cosential.com/api/images/project/54321/76543
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/json" \
-d '{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAQEAAAAAAAD/9k="
}' \
https://compass.cosential.com/api/images/project/54321/76543
[200 OK]
An HTTP DELETE request to the image metadata endpoint will delete the metadata AND the image itself. The image metadata endpoint is: /api/projects/<projectId>/images/<imageId>
curl -X DELETE \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
https://compass.cosential.com/api/projects/54321/images/76543
[200 OK]
The standard list and search parameters are supported to list and search project image metadata for a specific project at: /api/projects/<projectId>/images.
Also, the standard list and search parameters are supported to list and search ALL project image metadata at: /api/projects/images
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
https://compass.cosential.com/api/projects/images/search?q=IsWebsiteImage:true
[
{
"ProjectId": 54321,
"ProjectName": "Blue Skies Big Building",
"ProjectNumber": "",
"ImageId": 76543,
"ImageName": "file1.jpg",
"Caption": "Big Building Site",
"Credit": null,
"Keywords": "building,construction,blue,sky",
"IsWebsiteImage": true,
"IsWebsiteThumbnail": false,
"NetworkPath": "\\\\files.mycompany.com\\files\\file1.jpg",
"CDRomPath": null,
"ImageNumber": null,
"OrderNumber": null,
"AccessLevel": null,
"Comments": "This building is scheduled to be built soon",
"UploadDate": "0001-01-01T00:00:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543",
"WebsiteImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543/web",
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76543/thumb"
},
{
"ProjectId": 54321,
"ProjectName": "Blue Skies Big Building",
"ProjectNumber": "",
"ImageId": 76544,
"ImageName": "file2.jpg",
"Caption": null,
"Credit": null,
"Keywords": null,
"IsWebsiteImage": true,
"IsWebsiteThumbnail": false,
"NetworkPath": null,
"CDRomPath": null,
"ImageNumber": null,
"OrderNumber": null,
"AccessLevel": null,
"Comments": null,
"UploadDate": "0001-01-01T00:00:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76544",
"WebsiteImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76544/web",
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/project/54321/76544/thumb"
}
]
Personnel images are created with two or more API calls. The first call is to create one or more personnel image metadata objects using the endpoint /api/personnel/<personnelId>/images. Once the metadata is created, you can use the endpoint /api/images/personnel/<personnelId>/<imageId> to upload the image binary data.
curl -X POST -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-d '[{
"ImageName": "file1.jpg",
"Caption": "Our Founder",
"Keywords": "building,construction,blue,sky",
"NetworkPath": "\\\\files.mycompany.com\\files\\file1.jpg",
"Comments": "Needs no comment."
},{
"ImageName": "file2.jpg"
}]' https://compass.cosential.com/api/personnel/54321/images
[
{
"PersonnelId": 54321,
"ImageId": 76543,
"ImageName": "file1.jpg",
"Caption": "Our Founder",
"Credit": null,
"Keywords": "building,construction,blue,sky",
"NetworkPath": "\\\\files.mycompany.com\\files\\file1.jpg",
"CDRomPath": null,
"OrderNumber": null,
"Comments": "Needs no comment.",
"UploadDate": "0001-01-01T00:00:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/personnel/54321/76543",
"WebsiteImageEndpoint": null,
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/personnel/54321/76543/thumb"
},
{
"PersonnelId": 659741,
"ImageId": 320045,
"ImageName": "file2.jpg",
"Caption": null,
"Credit": null,
"Keywords": null,
"NetworkPath": null,
"CDRomPath": null,
"OrderNumber": null,
"Comments": null,
"UploadDate": "2018-03-07T12:22:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/personnel/659741/320045",
"WebsiteImageEndpoint": null,
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/personnel/659741/320045/thumb"
}
]
Now that we have the metadata objects created, image data can be sent using an HTTP PUT call to the OriginalImageEndpoint found in the metadata object. The endpoint is /api/images/personnel/<personnelId>/<imageId>
There are several different ways to upload the image data.
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/x-www-form-urlencoded" -d '' \
https://compass.cosential.com/api/images/personnel/54321/76543?url=https%3a%2f%2fcompass.cosential.com%2fcontent%2fimages%2flogo.png
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
-F "data=[object Object]" \
https://compass.cosential.com/api/images/personnel/54321/76543
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/json" \
-d '{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAQEAAAAAAAD/9k="
}' \
https://compass.cosential.com/api/images/personnel/54321/76543
[200 OK]
Personnel images are read using one of the following endpoints
The web and thumbnail endpoints accept the following optional URL paramaters:
The HTTP Accept Header is used to get the image in different formats. The supported formats are:
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H Accept:application/json \
https://compass.cosential.com/api/images/personnel/54321/76543/web?maxWidth=100
{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAgEAAAAAAAD/="
}
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H Accept:image/jpeg \
https://compass.cosential.com/api/images/personnel/54321/76543/thumb?maxHeight=400&jpegQuality=50
[binary data]
Two different endpoints exist for personnel image data. You can use the endpoint /api/personnel/<personnelId>/images/<imageId> for updating personnel image metadata, and you can use the endpoint /api/images/personnel/<personnelId>/<imageId> to upload the image binary data.
curl -X PUT \
-H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-d '{
"Caption": "Rock Legend",
"Keywords": ""Gibson SG, AC/DC",
"Comments": "This building is about to rock."
}' https://compass.cosential.com/api/personnel/659741/images/320044
{
"PersonnelId": 659741,
"ImageId": 320044,
"ImageName": "angus_young.jpg",
"Caption": "Rock Legend",
"Credit": null,
"Keywords": "Gibson SG, AC/DC",
"NetworkPath": null,
"CDRomPath": null,
"OrderNumber": null,
"Comments": "This building is about to rock.",
"UploadDate": "2018-03-07T12:22:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/personnel/659741/320044",
"WebsiteImageEndpoint": null,
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/personnel/659741/320044/thumb"
}
There are several different ways to update the image data.
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/x-www-form-urlencoded" -d '' \
https://compass.cosential.com/api/images/personnel/54321/76543?url=https%3a%2f%2fcompass.cosential.com%2fcontent%2fimages%2flogo.png
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
-F "data=[object Object]" \
https://compass.cosential.com/api/images/personnel/54321/76543
[200 OK]
curl -X PUT \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
-H "Content-Type: application/json" \
-d '{
"ContentType": "image/jpeg",
"Data": "/9j/4AAQSkZJRgABAQEAAAAAAAD/9k="
}' \
https://compass.cosential.com/api/images/personnel/54321/76543
[200 OK]
An HTTP DELETE request to the image metadata endpoint will delete the metadata AND the image itself. The image metadata endpoint is: /api/personnel/<personnelId>/images/<imageId>
curl -X DELETE \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
https://compass.cosential.com/api/personnel/54321/images/76543
[200 OK]
The standard list and search parameters are supported to list and search personnel image metadata for a specific personnel at: /api/personnel/<personnelId>/images.
Also, the standard list and search parameters are supported to list and search ALL personnel image metadata at: /api/personnel/images
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
https://compass.cosential.com/api/personnel/images/search?q=ImageName:angus
[
{
"PersonnelId": 659741,
"ImageId": 320044,
"ImageName": "angus_young.jpg",
"Caption": null,
"Credit": null,
"Keywords": null,
"NetworkPath": null,
"CDRomPath": null,
"OrderNumber": null,
"Comments": null,
"UploadDate": "2018-03-07T12:22:00",
"Device": null,
"latitude": null,
"longitude": null,
"ImageHash": null,
"ImageSizeKB": null,
"OriginalImageEndpoint": "https://compass.cosential.com/api/images/personnel/659741/320044",
"WebsiteImageEndpoint": null,
"ThumbnailImageEndpoint": "https://compass.cosential.com/api/images/personnel/659741/320044/thumb"
},
{....}
]
Profile Pictures for Contacts and Personnel can be viewed through a URL with a HTTP GET request to the entity
The property ProfileImageUrl contains a URL providing anonymous access to that image for up to 1 hour after the request is made
ProfileImageUrls with a value of null indicates a profile image currently does not exist
curl -X GET -H Content-Type:application/json \
-H x-compass-token:b3d83cd6-9cd2-4f2a-a3e5-911e94025ecd \
https://compass.cosential.com/api/contacts/54321
{
...,
"ProfileImageUrl": "/api/images/contact/54321/ProfilePicture/1255db02-05c0-458c"
}