--- title: "Image" slug: "server-api-kb-image" updated: 2022-06-16T07:59:09Z published: 2022-06-16T07:59:09Z canonical: "developer.comm100.com/server-api-kb-image" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # Image ## Image You need the Manage images permission to manage images. - `Images` - Images Manage - `GET kb/images` - [Get the list of Images](/docs/server-api-kb-image#get-the-list-of-images) - `GET kb/images/{id}` - [Get a single Image](/docs/server-api-kb-image#get-a-single-image) - `POST kb/images` - [Create a new Image](/docs/server-api-kb-image#create-a-new-image) - `PUT kb/images/{id}` - [Update the Image](/docs/server-api-kb-image#update-the-image) - `DELETE kb/images/{id}` - [Remove the Image](/docs/server-api-kb-image#remove-the-image) ### Image JSON Format Image is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `fileName` | string | Name of the file. | | `extType` | string | Type of the file. | | `height` | integer | Height of the image. | | `width` | integer | Width of the image. | | `size` | integer | Size of the image. | | `uploadTime` | datetime | Time when the image was uploaded. | | `modified` | datetime | Time when the image was last modified. | | `id` | guid | Id of the image. | | `kbId` | guid | Id of the knowledage base. | | `fileKey` | string | Url of the file. | ### Get the list of Images `GET kb/images` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `kbId` | guid | query | no | Id of the knowledage base. | - #### Response: An array of [Image](/docs/server-api-kb-image#image-json-format) - #### 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](/docs/server-api-kb-image#image-json-format) - #### 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: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `fileName` | string | body | yes | Name of the file. | | `extType` | string | body | yes | Type of the file. | | `height` | integer | body | yes | Height of the image. | | `width` | integer | body | yes | Width of the image. | | `size` | integer | body | yes | Size of the image. | | `kbId` | guid | body | yes | Id of the knowledage base. | | `fileKey` | string | body | no | Url of the file. | - #### Response: [Image](/docs/server-api-kb-image#image-json-format) - #### 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: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `fileName` | string | body | yes | Name of the file. | | `extType` | string | body | yes | Type of the file. | | `height` | integer | body | yes | Height of the image. | | `width` | integer | body | yes | Width of the image. | | `size` | integer | body | yes | Size of the image. | | `kbId` | guid | body | yes | Id of the knowledage base. | | `fileKey` | string | body | no | Url of the file. | - #### Response: [Image](/docs/server-api-kb-image#image-json-format) - #### 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