Image
  • 16 Jun 2022
  • 2 Minutes to read
  • Dark
    Light

Image

  • Dark
    Light

Article summary

Image

You need the Manage images permission to manage images.

Image JSON Format

Image is represented as simple flat JSON objects with the following keys:

NameTypeDescription
fileNamestringName of the file.
extTypestringType of the file.
heightintegerHeight of the image.
widthintegerWidth of the image.
sizeintegerSize of the image.
uploadTimedatetimeTime when the image was uploaded.
modifieddatetimeTime when the image was last modified.
idguidId of the image.
kbIdguidId of the knowledage base.
fileKeystringUrl of the file.

Get the list of Images

GET kb/images

  • Parameters:

NameTypeinRequiredDescription
kbIdguidquerynoId of the knowledage base.
  • Response:

An array of Image

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/images \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

[
  {
      "fileName": "height.png",
      "extType": "image/png",
      "height": 136,
      "width": 32,
      "size": 1530,
      "uploadTime": "2021-05-08T06:37:54.273Z",
      "modified": "2021-05-08T06:37:54.273Z",
      "id": "56829117-8206-41dc-a9f9-50032b6366b1",
      "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc",
      "fileKey": "3kBif0FlgG838F3WlbsDc0Q5mmk5DGZ8aFeeWnz0xfugMsKJ06m56ZshYmyxwPEPCJy2YW-XEX9ZHIQCAtoorQSF6Lf2jUVPR6ok9LcXY4_mnhM1WxRO0uEO48ZT-FKxUyJW8hmpHoWyd82VrrjdJdc-mhT96EZZPGy2YNF7rD4Q"
  }
] 

Get a single Image

GET kb/images/{id}

  • Parameters:

No Parameters

  • Response:

Image

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/images/56829117-8206-41dc-a9f9-50032b6366b1 \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "fileName": "height.png",
  "extType": "image/png",
  "height": 136,
  "width": 32,
  "size": 1530,
  "uploadTime": "2021-05-08T06:37:54.273Z",
  "modified": "2021-05-08T06:37:54.273Z",
  "id": "56829117-8206-41dc-a9f9-50032b6366b1",
  "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc",
  "fileKey": "3kBif0FlgG838F3WlbsDc0Q5mmk5DGZ8aFeeWnz0xfugMsKJ06m56ZshYmyxwPEPCJy2YW-XEX9ZHIQCAtoorQSF6Lf2jUVPR6ok9LcXY4_mnhM1WxRO0uEO48ZT-FKxUyJW8hmpHoWyd82VrrjdJdc-mhT96EZZPGy2YNF7rD4Q"
} 

Create a new Image

POST kb/images

  • Parameters:

NameTypeinRequiredDescription
fileNamestringbodyyesName of the file.
extTypestringbodyyesType of the file.
heightintegerbodyyesHeight of the image.
widthintegerbodyyesWidth of the image.
sizeintegerbodyyesSize of the image.
kbIdguidbodyyesId of the knowledage base.
fileKeystringbodynoUrl of the file.
  • Response:

Image

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/images \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"fileName":"height.png","extType":"image/png","height":136,"width":32,"size":1530,"kbId":"b2754e68-b380-4a61-9c5b-a9570f1a4fcc","fileKey":"3kBif0FlgG838F3WlbsDc0Q5mmk5DGZ8aFeeWnz0xfugMsKJ06m56ZshYmyxwPEPCJy2YW-XEX9ZHIQCAtoorQSF6Lf2jUVPR6ok9LcXY4_mnhM1WxRO0uEO48ZT-FKxUyJW8hmpHoWyd82VrrjdJdc-mhT96EZZPGy2YNF7rD4Q"}' 

Response:

HTTP/1.1 201 Created

{
  "fileName": "height.png",
  "extType": "image/png",
  "height": 136,
  "width": 32,
  "size": 1530,
  "uploadTime": "2021-05-08T06:37:54.273Z",
  "modified": "2021-05-08T06:37:54.273Z",
  "id": "56829117-8206-41dc-a9f9-50032b6366b1",
  "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc",
  "fileKey": "3kBif0FlgG838F3WlbsDc0Q5mmk5DGZ8aFeeWnz0xfugMsKJ06m56ZshYmyxwPEPCJy2YW-XEX9ZHIQCAtoorQSF6Lf2jUVPR6ok9LcXY4_mnhM1WxRO0uEO48ZT-FKxUyJW8hmpHoWyd82VrrjdJdc-mhT96EZZPGy2YNF7rD4Q"
} 

Update the Image

PUT kb/images/{id}

  • Parameters:

NameTypeinRequiredDescription
fileNamestringbodyyesName of the file.
extTypestringbodyyesType of the file.
heightintegerbodyyesHeight of the image.
widthintegerbodyyesWidth of the image.
sizeintegerbodyyesSize of the image.
kbIdguidbodyyesId of the knowledage base.
fileKeystringbodynoUrl of the file.
  • Response:

Image

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/images/56829117-8206-41dc-a9f9-50032b6366b1 \ 
    -X 'PUT' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"fileName":"height.png","extType":"image/png","height":136,"width":32,"size":1530,"kbId":"b2754e68-b380-4a61-9c5b-a9570f1a4fcc","fileKey":"3kBif0FlgG838F3WlbsDc0Q5mmk5DGZ8aFeeWnz0xfugMsKJ06m56ZshYmyxwPEPCJy2YW-XEX9ZHIQCAtoorQSF6Lf2jUVPR6ok9LcXY4_mnhM1WxRO0uEO48ZT-FKxUyJW8hmpHoWyd82VrrjdJdc-mhT96EZZPGy2YNF7rD4Q"}' 

Response:

HTTP/1.1 200 OK

{
  "fileName": "height.png",
  "extType": "image/png",
  "height": 136,
  "width": 32,
  "size": 1530,
  "uploadTime": "2021-05-08T06:37:54.273Z",
  "modified": "2021-05-08T06:37:54.273Z",
  "id": "56829117-8206-41dc-a9f9-50032b6366b1",
  "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc",
  "fileKey": "3kBif0FlgG838F3WlbsDc0Q5mmk5DGZ8aFeeWnz0xfugMsKJ06m56ZshYmyxwPEPCJy2YW-XEX9ZHIQCAtoorQSF6Lf2jUVPR6ok9LcXY4_mnhM1WxRO0uEO48ZT-FKxUyJW8hmpHoWyd82VrrjdJdc-mhT96EZZPGy2YNF7rD4Q"
} 

Remove the Image

DELETE kb/images/{id}

  • Parameters:

No Parameters

  • Response:

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/kb/images/56829117-8206-41dc-a9f9-50032b6366b1 \ 
    -X 'DELETE' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 204 No Content


Was this article helpful?

What's Next