{"id":47669302,"url":"https://github.com/imagekit-developer/imagekit-dotnet","last_synced_at":"2026-04-02T12:24:47.384Z","repository":{"id":35124131,"uuid":"101918655","full_name":"imagekit-developer/imagekit-dotnet","owner":"imagekit-developer","description":".NET SDK for ImageKit.io API","archived":false,"fork":false,"pushed_at":"2025-09-19T13:51:53.000Z","size":2777,"stargazers_count":33,"open_issues_count":9,"forks_count":16,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-19T15:32:45.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://imagekit.io","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imagekit-developer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-08-30T19:03:46.000Z","updated_at":"2025-09-18T11:57:39.000Z","dependencies_parsed_at":"2024-05-03T01:28:58.120Z","dependency_job_id":"7c3dd1ba-25ad-4960-a72b-9e7c6f8ed174","html_url":"https://github.com/imagekit-developer/imagekit-dotnet","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/imagekit-developer/imagekit-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imagekit-developer","download_url":"https://codeload.github.com/imagekit-developer/imagekit-dotnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31306024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-02T12:24:46.531Z","updated_at":"2026-04-02T12:24:47.363Z","avatar_url":"https://github.com/imagekit-developer.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg width=\"250\" alt=\"ImageKit.io\" src=\"https://raw.githubusercontent.com/imagekit-developer/imagekit-javascript/master/assets/imagekit-light-logo.svg\"/\u003e](https://imagekit.io)\n\n## DotNET (NET45/Standard/Core) SDK for ImageKit\n\n[![CI Pipeline](https://github.com/imagekit-developer/imagekit-dotnet/workflows/CI%20Pipeline/badge.svg?branch=master)](https://github.com/imagekit-developer/imagekit-dotnet) [![NuGet](https://img.shields.io/nuget/v/imagekit.svg)](https://www.nuget.org/packages/Imagekit) [![codecov](https://codecov.io/gh/imagekit-developer/imagekit-dotnet/branch/master/graph/badge.svg)](https://codecov.io/gh/imagekit-developer/imagekit-dotnet) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Twitter Follow](https://img.shields.io/twitter/follow/imagekitio?label=Follow\u0026style=social)](https://twitter.com/ImagekitIo)\n\nImageKit DotNET SDK allows you to use [image resizing](https://docs.imagekit.io/features/image-transformations), [optimization](https://docs.imagekit.io/features/image-optimization), [file uploading](https://docs.imagekit.io/api-reference/upload-file-api) and other [ImageKit APIs](https://docs.imagekit.io/api-reference/api-introduction) from applications written in server-side C#.\n\n##### Table of contents\n\n*   [Installation](#installation)\n*   [Initialization](#initialization)\n*   [URL generation](#url-generation)\n*   [File Upload](#file-upload)\n*   [File Management](#file-management)\n*   [Tags](#tags-management)\n*   [Manage Folder](#folder-management)\n*   [Bulk Job Status](#job-management)\n*   [Purge](#purge)\n*   [Meta Data](#metadata)\n*   [Utility functions](#utility-functions)\n*   [Support](#support)\n*   [Links](#links)\n\n## Installation\n\nPackage Manager\n\n```cs\nInstall-Package Imagekit\n```\n\nPackageReference\n\n```html\n\u003cPackageReference Include=\"Imagekit\" Version=\"4.0.1\"\u003e\n\u003c/PackageReference\u003e\n```\n\n.Net CLI\n\n```cs\ndotnet add package Imagekit --version 4.0.1\n```\n\nOpen up your project, navigate to the Nuget package manager console, and add the Imagekit package.  \nAlso, you can search for [Imagekit](https://www.nuget.org/packages/Imagekit) in Nuget GUI.\n\n## Initialization\n\nAdd this reference where you want to use imagekit.io services:\n\n```cs\nusing Imagekit;\n\nImageKitClient imagekit = new ImageKitClient(publicKey, privateKey, urlEndPoint);\n```\n\n**Note**: You can get the `apiKey`, `apiSecret`, and ImagekitId from your [Imagekit.io dashboard](https://imagekit.io/dashboard).\n\n## Demo application\n\nThe fastest way to get started is by running the demo application in the [ImageKitSample](/ImageKitSample) folder.\n\n## Usage\n\nYou can use this DotNET SDK for three different functions: URL generation, file uploads, and file management. The usage of the SDK has been explained below.\n\n### URL Generation\n\n**1\\. Using image path and image hostname or endpoint**\n\nThis method allows you to create a URL using the `path` where the image exists and the URL endpoint (`urlEndpoint`) you want to use to access the image. You can refer to the documentation [here](https://docs.imagekit.io/integration/url-endpoints) to read more about URL endpoints in ImageKit and the section about [image origins](https://docs.imagekit.io/integration/configure-origin) to understand paths with different kinds of origins.\n\n```cs\nstring path = \"/default_image.jpg\";\nTransformation trans = new Transformation()\n.Width(400)\n.Height(300)\n.AspectRatio(\"4-3\")\n.Quality(40)\n.Crop(\"force\")\n.CropMode(\"extract\")\n.Focus(\"left\")\n.Format(\"jpeg\") \n.Raw(\"l-text,i-Imagekit,fs-50,l-end\");\n\nstring imageURL = imagekit.Url(trans).Path(path).TransformationPosition(\"query\").Generate();    \n```\n\nThis results in a URL like\n\n```plaintext\nhttps://ik.imagekit.io/your_imagekit_id/default_image.jpg?tr=w-400%2Ch-300%2Car-4-3%2Cq-40%2Cc-force%2Ccm-extract%2Cfo-left%2Cf-jpeg%2Cl-text%2Ci-Imagekit%2Cfs-50%2Cl-end\n```\n\n**2\\. Using full image URL**\n\nThis method allows you to add transformation parameters to an existing, complete URL that is already mapped to ImageKit using the `src` parameter. This method should be used if you have the complete URL mapped to ImageKit stored in your database.\n\n```cs\nstring imageURL = imagekit.Url(new Transformation().Width(400).Height(300))\n    .Src(\"https://ik.imagekit.io/your_imagekit_id/endpoint/default_image.jpg\")\n    .Generate();\n```\n\nThis results in a URL like\n\n```plaintext\nhttps://ik.imagekit.io/your_imagekit_id/endpoint/default_image.jpg?tr=h-300,w-400\n```\n\nThe `.Url()` method accepts the following parameters.\n\n| Option | Description |\n| --- | --- |\n| urlEndpoint | Optional. The base URL has to be appended before the path of the image. If not specified, the URL Endpoint specified at the time of SDK initialization is used. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/` |\n| path | Conditional. This is the path on which the image exists. For example, `/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |\n| src | Conditional. This is the complete URL of an image already mapped to ImageKit. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |\n| transformation | Optional. An array of objects specifying the transformation to be applied in the URL. The transformation name and the value should be specified as a key-value pair in the object. Different steps of a [chained transformation](https://docs.imagekit.io/features/image-transformations/chained-transformations) can be specified as the array's different objects. The complete list of supported transformations in the SDK and some examples of using them are given later. If you use a transformation name that is not specified in the SDK, it gets applied as it is in the URL. |\n| transformationPosition | Optional. The default value is `path` that places the transformation string as a URL path parameter. It can also be specified as `query`, which adds the transformation string as the URL's query parameter `tr`. If you use the `src` parameter to create the URL, then the transformation string is always added as a query parameter. |\n| queryParameters | Optional. These are the other query parameters that you want to add to the final URL. These can be any query parameters and not necessarily related to ImageKit. Especially useful if you want to add some versioning parameters to your URLs. |\n| signed | Optional. Boolean. Default is `false`. If set to `false`, the SDK generates a signed image URL by adding the image signature to the image URL. This can only be used if you create the URL with the `urlEndpoint` and `path` parameters, not with the `src` parameter. |\n| expireSeconds | Optional. Integer. It is meant to be used along with the `signed` parameter to specify the time in seconds from now when the URL should expire. If specified, the URL contains the expiry timestamp in the URL, and the image signature is modified accordingly. |\n\n#### Examples of generating URLs\n\n**1\\. Chained Transformations as a query parameter**\n\n```cs\nTransformation transformation = new Transformation()\n    .Width(400).Height(300)\n    .Chain()\n    .Rotation(90);\n    \nstring imageURL = imagekit.Url(transformation)\n    .Path(\"/default_image.jpg\")\n    .UrlEndpoint(\"https://ik.imagekit.io/your_imagekit_id/endpoint\")\n    .TransformationPosition(\"query\")\n    .Generate();\n```\n\n```plaintext\nhttps://ik.imagekit.io/your_imagekit_id/endpoint/default_image.jpg?tr=h-300,w-400:rt-90\n```\n\n**2\\. Sharpening, contrast adjustment, shadow and gradient transformations, along with a progressive JPEG format image.**\n\nThere are some transforms like [Sharpening](https://docs.imagekit.io/features/image-transformations/image-enhancement-and-color-manipulation) that can be added to the URL with or without any other value.\n\n```cs\nstring src = \"https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg\";\n\nTransformation trans = new Transformation()\n    .Format(\"jpg\")\n    .Progressive(false)\n    .EffectSharpen()\n    .EffectContrast(1)\n    .EffectShadow()\n    .EffectGradient();\n\nstring imageURL = imagekit.Url(trans)\n    .Src(src)\n    .Generate();\n```\n\n**Note**: Because `src` parameter was used, the transformation string gets added as a query parameter `tr`.\n\n```plaintext\nhttps://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg?tr=f-jpg%2Cpr-false%2Ce-sharpen%2Ce-contrast-1%2Ce-shadow%2Ce-gradient\n```\n\n**3\\. Signed URL that expires in 600 seconds with the default URL endpoint and other query parameters**\n\n```cs\nTransformation trans = new Transformation()\n    .Height(300).Width(400);\nstring[] queryParams = { \"v = 123\" };\n\nstring imageURL = imagekit.Url(trans)\n    .Path(\"/default-image.jpg\")\n    .QueryParameters(queryParams)\n    .Signed(false).ExpireSeconds(600)\n    .Generate();\n```\n\n```plaintext\nhttps://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400/default-image.jpg?v=123\u0026ik-t=1567358667\u0026ik-s=f2c7cdacbe7707b71a83d49cf1c6110e3d701054\n```\n\n**4. Adding overlays**\n\nImageKit.io enables you to apply overlays to [images](https://docs.imagekit.io/features/image-transformations/overlay-using-layers) and [videos](https://docs.imagekit.io/features/video-transformation/overlay) using the raw parameter with the concept of [layers](https://docs.imagekit.io/features/image-transformations/overlay-using-layers#layers). The raw parameter facilitates incorporating transformations directly in the URL. A layer is a distinct type of transformation that allows you to define an asset to serve as an overlay, along with its positioning and additional transformations.\n\n**Text as overlays**\n\nYou can add any text string over a base video or image using a text layer (l-text).\n\nFor example:\n\n```cs\nstring path = \"/default_image.jpg\";\nTransformation trans = new Transformation()\n.Width(400)\n.Height(300) \n.Raw(\"l-text,i-Imagekit,fs-50,l-end\");\n\nstring imageURL = imagekit.Url(trans).Path(path).TransformationPosition(\"query\").Generate();    \n```\n**Sample Result URL**\n```\nhttps://ik.imagekit.io/your_imagekit_id/default-image.jpg?tr=h-300,w-400,l-text,i-Imagekit,fs-50,l-end\n```\n\n**Image as overlays**\n\nYou can add an image over a base video or image using an image layer (l-image).\n\nFor example:\n\n```cs\nstring path = \"/default_image.jpg\";\nTransformation trans = new Transformation()\n.Width(400)\n.Height(300) \n.Raw(\"l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end\");\n\nstring imageURL = imagekit.Url(trans).Path(path).TransformationPosition(\"query\").Generate();    \n```\n**Sample Result URL**\n```\nhttps://ik.imagekit.io/your_imagekit_id/default-image.jpg?tr=h-300,w-400,l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end\n```\n\n**Solid color blocks as overlays**\n\nYou can add solid color blocks over a base video or image using an image layer (l-image).\n\nFor example:\n\n```cs\nstring path = \"/img/sample-video.mp4\";\nTransformation trans = new Transformation()\n.Width(400)\n.Height(300) \n.Raw(\"l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end\");\n\nstring imageURL = imagekit.Url(trans).Path(path).TransformationPosition(\"query\").Generate();    \n```\n**Sample Result URL**\n```\nhttps://ik.imagekit.io/your_imagekit_id/img/sample-video.mp4?tr=h-300,w-400,l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end\n```\n\n#### List of supported transformations\n\nThe complete list of transformations supported and their usage in ImageKit can be found [here](https://docs.imagekit.io/features/image-transformations). The SDK gives a name to each transformation parameter, making the code simpler and more readable. If a transformation is supported in ImageKit, but a name for it cannot be found in the table below, then use the transformation code from ImageKit docs as the name when using the `url` function.\n\n| Supported Transformation Name | Translates to parameters |\n| --- | --- |\n| Height | h |\n| Width | w |\n| AspectRatio | ar |\n| Quality | q |\n| Crop | c |\n| CropMode | cm |\n| X | x |\n| Y | y |\n| Focus | fo |\n| Format | f |\n| Radius | r |\n| Background | bg |\n| Border | b |\n| Rotation | rt |\n| Blur | bl |\n| Named | n |\n| Progressive | pr |\n| Lossless | lo |\n| Trim | t |\n| Metadata | md |\n| ColorProfile | cp |\n| DefaultImage | di |\n| Dpr | dpr |\n| EffectSharpen | e-sharpen |\n| EffectUSM | e-usm |\n| EffectContrast | e-contrast |\n| EffectGray | e-grayscale |\n| EffectShadow | e-shadow |\n| EffectGradient | e-gradient |\n| Original | orig |\n| Raw | `replaced by the parameter value` |\n\n### File Upload\n\nThe SDK provides a simple interface using the `.upload()` method to upload files to the ImageKit Media Library. It accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload).\n\nThe `upload()` method requires at least the `file` and the `fileName` parameter to upload a file. You can pass other parameters supported by the ImageKit upload API using the same parameter name as specified in the upload API documentation. For example, to specify tags for a file at the time of upload, use the `tags` parameter as specified in the [documentation here](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload).\n\nSample usage\n\n```cs\n // Upload By URI\nFileCreateRequest request = new FileCreateRequest\n{\n\tfile = \"http://www.google.com/images/logos/ps_logo2.png\",\n\tfileName = \"file_name.jpg\",\n};\nResult resp1 = imagekit.Upload(request);\n\n// Upload by bytes\nbyte[] bytes = System.IO.File.ReadAllBytes(@\"image file path\");\n\nFileCreateRequest ob = new FileCreateRequest\n{\n\tfile = bytes,\n\tfileName = Guid.NewGuid().ToString()\n};\nList\u003cstring\u003e tags = new List\u003cstring\u003e\n{\n\t\"Software\",\n\t\"Developer\",\n\t\"Engineer\"\n};\nob.tags = tags;\n\nstring customCoordinates = \"10,10,20,20\";\nob.customCoordinates = customCoordinates;\nList\u003cstring\u003e responseFields = new List\u003cstring\u003e\n{\n\t\"isPrivateFile\",\n\t\"tags\",\n\t\"customCoordinates\"\n};\nob.responseFields = responseFields;\nList\u003cExtension\u003e ext = new List\u003cExtension\u003e();\nBackGroundImage bck1 = new BackGroundImage\n{\n\tname = \"remove-bg\",\n\toptions = new options()\n\t{ add_shadow = true, semitransparency = false, bg_image_url = \"http://www.google.com/images/logos/ps_logo2.png\" }\n};\nAutoTags autoTags = new AutoTags\n{\n\tname = \"google-auto-tagging\",\n\tmaxTags = 5,\n\tminConfidence = 95\n};\next.Add(bck1);\next.Add(autoTags);\nTransformationObject transformationObject = new TransformationObject\n{\n\tvalue = \"w-100\"\n};\nList\u003cPostTransformation\u003e postTransformations = new List\u003cPostTransformation\u003e();\npostTransformations.Add(transformationObject);\nUploadTransformation uploadTransformation = new UploadTransformation\n{\n\tpre = \"l-text,i-Imagekit,fs-50,l-end\",\n\tpost = postTransformations,\n};\nob.extensions = ext;\nob.webhookUrl = \"https://webhook.site/c78d617f_33bc_40d9_9e61_608999721e2e\";\nob.useUniqueFileName = true;\nob.folder = \"dummy_folder\";\nob.isPrivateFile = false;\nob.overwriteFile = true;\nob.overwriteAITags = true;\nob.overwriteTags = true;\nob.overwriteCustomMetadata = true;\nob.checks = \"'file.size' \u003c '1mb'\" // To run server side checks before uploading files. Notice the quotes around file.size and 1mb.\nob.isPublished = true;\nResult resp2 = imagekit.Upload(ob);\n\n//Get Base64 \nbyte[] imageArray = System.IO.File.ReadAllBytes(@\"image file path\");\nstring base64ImageRepresentation = Convert.ToBase64String(imageArray);\n// Upload by Base64\nFileCreateRequest ob2 = new FileCreateRequest\n{\n\tfile=base64ImageRepresentation,\n\tfileName = Guid.NewGuid().ToString()\n};\nResult resp = imagekit.Upload(ob2);           \n```\n\n### File Management\n\nThe SDK provides a simple interface for all the [media APIs mentioned here](https://docs.imagekit.io/api-reference/media-afile-uploadpi) to manage your files.\n\n**1 . List \u0026 Search Files**\n\nAccepts an object specifying the parameters to be used to list and search files. All parameters specified in the [documentation here](https://docs.imagekit.io/api-reference/media-api/list-and-search-files) can be passed as it is with the correct values to get the results.\n\n#### Applying Filters\nFilter out the files by specifying the parameters.\n\n```cs\nGetFileListRequest model = new GetFileListRequest\n{\n\tName = \"file_name.jpg\",\n\tType = \"file\",\n\tLimit = 10,\n\tSkip = 0,\n\tSort = \"ASC_CREATED\",\n\tFileType = \"image\",\n\tTags = new string[] { \"tag1\", \"tag2\" }\n};\nResultList res = await imagekit.GetFileListRequestAsync(model);\n```\n\n#### Advance Search\nIn addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and providing this generated string as the value of the `SearchQuery`.\n\n```cs\nGetFileListRequest model = new GetFileListRequest\n{\n\tSearchQuery = \"createdAt \u003e= '2d' OR size \u003c '2mb' OR format='png'\",\n};\nResultList res = await imagekit.GetFileListRequestAsync(model);\n```\n\nDetailed documentation can be found here for [advance search queries](https://docs.imagekit.io/api-reference/media-api/list-and-search-files#advanced-search-queries).\n\n**2\\. Get File Details**\n\nAccepts the file ID and fetches the details as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-details).\n\n```cs\nResult resp = await imagekit.GetFileDetail(file_Id);\n```\n\n**3\\. File Update**\n\nAccepts an object of class `FileUpdateRequest` specifying the parameters to be used to update file details. All parameters specified in the \\[documentation here\\] (https://docs.imagekit.io/api-reference/media-api/update-file-details) can be passed via their setter functions to get the results.\n\n```cs\nFileUpdateRequest updateob = new FileUpdateRequest\n{\n\tfileId = \"fileId\",\n};\nList\u003cstring\u003e updatetags = new List\u003cstring\u003e\n{\n\t\"Software\",\n\t\"Developer\",\n\t\"Engineer\"\n};\nupdateob.tags = updatetags;\nstring updatecustomCoordinates = \"10,10,20,20\";\nupdateob.customCoordinates = updatecustomCoordinates;\nList\u003cstring\u003e updateresponseFields = new List\u003cstring\u003e\n{\n\t\"isPrivateFile\",\n\t\"tags\",\n\t\"customCoordinates\"\n};\n\nList\u003cExtension\u003e extModel = new List\u003cExtension\u003e();\nBackGroundImage bck = new BackGroundImage\n{\n\tname = \"remove-bg\",\n\toptions = new options() { add_shadow = true, semitransparency = false, bg_color = \"green\" }\n};\nextModel.Add(bck);\nupdateob.extensions = extModel;\nupdateob.webhookUrl = \"https://webhook.site/c78d617f_33bc_40d9_9e61_608999721e2e\";\nResult updateresp = imagekit.UpdateFileDetail(updateob); \n```\n\n**Update publish status**\n\nIf `publish` is included in the update options, no other parameters are allowed.\n\n```cs\nFileUpdateRequest updateob = new FileUpdateRequest\n{\n\tfileId = \"fileId\",\n};\nPublishStatus publishStatus = new PublishStatus\n{\n\tisPublished = false\n};\nupdateob.publish = publishStatus;\nResult updateresp = imagekit.UpdateFileDetail(updateob); \n```\n\n**4\\. Delete File**\n\nAccept the file ID and delete a file as per the [API documentation here](https://docs.imageKit.io/api-reference/media-api/delete-file).\n\n```cs\nString fileId = \"file_Id\";\nResultDelete result = imageKit.deleteFile(fileId);\n```\n\n**5\\. Delete files (bulk)**\n\nAccepts the file IDs to delete files as per the [API documentation here](https://docs.imageKit.io/api-reference/media-api/delete-files-bulk).\n\n```cs\nList\u003cstring\u003e ob3 = new List\u003cstring\u003e();\nob3.Add(\"fileId_1\");\nob3.Add(\"fileId_2\");\nResultFileDelete resultFileDelete = imagekit.BulkDeleteFiles(ob3);\n```\n\n**6\\. Copy file**\n\nAccepts an object of class `CopyFileRequest` specifying the parameters to be used to copy a file. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/copy-file) can be passed via their setter functions to get the results.\n\n```cs\nCopyFileRequest cpyRequest = new CopyFileRequest\n{\n\tsourceFilePath = \"path_1\",\n\tdestinationPath = \"path_2\",\n\tincludeFileVersions = true\n};\nResultNoContent resultNoContent = imagekit.CopyFile(cpyRequest);\n```\n\n**7\\. Move file**\n\nAccepts an object of class `MoveFileRequest` specifying the parameters to be used to move a file. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/move-file) can be passed via their setter functions to get the results.\n\n```cs\nMoveFileRequest moveFile = new MoveFileRequest\n{\n\tsourceFilePath = \"path_1\",\n\tdestinationPath = \"path_2\"\n};\nResultNoContent resultNoContentMoveFile = imagekit.MoveFile(moveFile);\n```\n\n**8\\. Rename file**\n\nAccepts an object of class `RenameFileRequest` specifying the parameters to be used to rename a file. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/rename-file) can be passed via their setter functions to get the results.\n\n```cs\nRenameFileRequest renameFileRequest = new RenameFileRequest\n{\n\tfilePath = \"path_1\",\n\tnewFileName = \"file_name\",\n\tpurgeCache = false\n};\nResultRenameFile resultRenameFile = imagekit.RenameFile(renameFileRequest);\n```\n\n### Tags Management\n\nThe SDK provides a simple interface to manage your tags.\n\n**9\\. Add tags**\n\nAccepts an object of class `TagsRequest` specifying the parameters to be used to add tags. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/add-tags-bulk) can be passed via their setter functions to get the results.\n\n```cs\nTagsRequest tagsRequest = new TagsRequest\n{\n\ttags = new List\u003cstring\u003e\n\t{\n\t\t\"tag_1\",\n\t\t\"tag_2\"\n\t},\n\tfileIds = new List\u003cstring\u003e\n\t{\n\t\t\"fileId_1\",\n\t},\n};\nResultTags resultTags = imagekit.AddTags(tagsRequest);\n```\n\n**10\\. Remove tags**\n\nAccepts an object of class `TagsRequest` specifying the parameters to be used to remove tags. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/remove-tags-bulk) can be passed via their setter functions to get the results.\n\n```cs\nTagsRequest removeTagsRequest = new TagsRequest\n{\n\ttags = new List\u003cstring\u003e\n\t{\n\t\t\"tag_1\",\n\t\t\"tag_2\"\n\t},\n\tfileIds = new List\u003cstring\u003e\n\t{\n\t\t\"fileId_1\",\n\t},\n};\nResultTags removeTags = imagekit.RemoveTags(removeTagsRequest);\n```\n\n**11\\. Remove AI tags**\n\nAccepts an object of class `AITagsRequest` specifying the parameters to be used to remove AI tags. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/remove-aitags-bulk) can be passed via their setter functions to get the results.\n\n```cs\nAITagsRequest removeAITagsRequest = new AITagsRequest\n{\n\tAITags = new List\u003cstring\u003e\n\t{\n\t\t\"tag_1\",\n\t\t\"tag_2\"\n\t},\n\tfileIds = new List\u003cstring\u003e\n\t{\n\t\t\"fileId_1\",\n\t}\n};\nResultTags removeAITags = imagekit.RemoveAITags(removeAITagsRequest);\n```\n\n**12\\. Get File Versions**\n\nAccepts the file ID and fetches the details as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-versions).\n\n```cs\nString fileId = \"file_id_1\";\nResultFileVersions resultFileVersions = imageKit.getFileVersions(fileId);\n```\n\n**13\\. Get File Version details**\n\nAccepts the file ID and version ID and fetches the details as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-version-details).\n\n```cs\nString fileId = \"file_Id\";\nString versionId = \"version_Id\";\nResultFileVersionDetails resultFileVersionDetails = imageKit.getFileVersionDetails(fileId, versionId);\n```\n\n**14\\. Delete FileVersion**\n\nAccepts an object of class `DeleteFileVersionRequest` specifying the parameters to be used to delete the file version. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/delete-file-version) can be passed via their setter functions to get the results.\n\n```cs\nDeleteFileVersionRequest delRequest = new DeleteFileVersionRequest\n{\n\tfileId = \"file_Id\",\n\tversionId = \"version_Id\"\n};\nResultNoContent resultNoContent1 = imagekit.DeleteFileVersion(delRequest);\n```\n\n**15\\. Restore file Version**\n\nAccepts the fileId and versionId to restore the file version as per the [API documentation here](https://docs.imageKit.io/api-reference/media-api/restore-file-version).\n\n```cs\nResult result = imagekit.RestoreFileVersion(\"file_Id\", \"version_Id\");\n```\n\n### Folder Management\n\n**16\\. Create Folder**\n\nAccepts an object of class `CreateFolderRequest` specifying the parameters to be used to create a folder. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/create-folder) can be passed via their setter functions to get the results.\n\n```cs\nCreateFolderRequest createFolderRequest = new CreateFolderRequest\n{\n\tfolderName = \"folder_name\",\n\tparentFolderPath = \"source/folder/path\"\n};\nResultEmptyBlock resultEmptyBlock = imagekit.CreateFolder(createFolderRequest);\n```\n\n**17\\. Copy Folder**\n\nAccepts an object of class `CopyFolderRequest` specifying the parameters to be used to copy a folder. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/copy-folder) can be passed via their setter functions to get the results.\n\n```cs\nCopyFolderRequest cpyFolderRequest = new CopyFolderRequest\n{\n\tsourceFolderPath = \"path_1\",\n\tdestinationPath = \"path_2\",\n\tincludeFileVersions = true\n};\n\nResultOfFolderActions resultOfFolderActions = imagekit.CopyFolder(cpyFolderRequest);\n```\n\n**18\\. Move Folder**\n\nAccepts an object of class `MoveFolderRequest` specifying the parameters to be used to move a folder. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/move-folder) can be passed via their setter functions to get the results.\n\n```cs\nMoveFolderRequest moveFolderRequest = new MoveFolderRequest\n{\n\tsourceFolderPath=\"path_1\",\n\tdestinationPath=\"path_2\"\n};\n\nResultOfFolderActions resultOfFolderActions1 = imagekit.MoveFolder(moveFolderRequest);\n```\n\n**19\\. Delete Folder**\n\nAccepts an object of class `DeleteFolderRequest` specifying the parameters to be used to delete a folder. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/media-api/delete-folder) can be passed via their setter functions to get the results.\n\n```cs\nDeleteFolderRequest deleteFolderRequest = new DeleteFolderRequest\n{\n\tfolderPath=\"source/folder/path/folder_name\",\n};\nResultNoContent resultNoContent2 = imagekit.DeleteFolder(deleteFolderRequest);\n```\n\n### Job Management\n\n**20\\. Get Bulk Job Status**\n\nAccepts the jobId to get bulk job status as per the [API documentation here](https://docs.imageKit.io/api-reference/media-api/copy-move-folder-status).\n\n```cs\nString jobId = \"job_Id\";\nResultBulkJobStatus resultBulkJobStatus = imageKit.getBulkJobStatus(jobId);\n```\n\n### Purge\n\n**21\\. Purge Cache**\n\nAccepts a full URL of the file for which the cache has to be cleared as per the [API documentation here](https://docs.imageKit.io/api-reference/media-api/purge-cache).\n\n```cs\nResultCache result = imageKit.purgeCache(\"https://ik.imageKit.io/imagekit-id/default-image.jpg\");\n```\n\n**22\\. Purge Cache Status**\n\nAccepts a request ID and fetch purge cache status as per the [API documentation here](https://docs.imageKit.io/api-reference/media-api/purge-cache-status)\n\n```cs\nString requestId = \"cache_request_Id\";\nResultCacheStatus result = imageKit.getPurgeCacheStatus(requestId);\n```\n\n### Metadata\n\nAccepts the file ID and fetches the metadata as per the [API documentation here](https://docs.imageKit.io/api-reference/metadata-api/get-image-metadata-for-uploaded-media-files)\n\n**23\\. Get File Metadata**\n\n```cs\nString fileId = \"file_id\";\nResultMetaData result = imageKit.getFileMetadata(fileId);\n```\n\nAnother way to get metadata from a remote file URL as per the [API documentation here](https://docs.imageKit.io/api-reference/metadata-api/get-image-metadata-from-remote-url). This file should be accessible over the imageKit.io URL-endpoint.\n\n```cs\nString url = \"Remote File URL\";\nResultMetaData result = imageKit.getRemoteFileMetadata(url);\n```\n\n**24\\. Create Custom MetaData Fields**\n\nAccepts an object of class `CustomMetaDataFieldCreateRequest` specifying the parameters to be used to create cusomMetaDataFields. All parameters specified in the [documentation here](https://docs.imageKit.io/api-reference/custom-metadata-fields-api/create-custom-metadata-field) can be passed as-is with the correct values to get the results.\n\nCheck for the [Allowed Values In The Schema](https://docs.imageKit.io/api-reference/custom-metadata-fields-api/create-custom-metadata-field#allowed-values-in-the-schema-object).\n\n#### Examples:\n\n```cs\nCustomMetaDataFieldCreateRequest requestModel = new CustomMetaDataFieldCreateRequest\n{\n    name = \"custom-meta-1\",\n    label = \"Testmeta\"\n};\nCustomMetaDataFieldSchemaObject schema = new CustomMetaDataFieldSchemaObject\n{\n    type = \"Number\",\n    minValue = 2000,\n    maxValue = 3000,\n    isValueRequired = true,\n    defaultValue = \"2500\"\n};\n\nrequestModel.schema = schema;\nResultCustomMetaDataField resultCustomMetaDataField1 = imagekit.CreateCustomMetaDataFields(requestModel);\n```\n\n*   Date type Example:\n\n```cs\nCustomMetaDataFieldCreateRequest requestModelDate = new CustomMetaDataFieldCreateRequest\n{\n    name = \"custom_meta_Date\",\n    label = \"TestmetaDate\"\n};\nCustomMetaDataFieldSchemaObject schemaDate = new CustomMetaDataFieldSchemaObject\n{\n    type = \"Date\",\n    minValue = \"2022-11-30T10:11:10+00:00\",\n    maxValue = \"2022-12-30T10:11:10+00:00\"\n};\nrequestModelDate.schema = schemaDate;\nResultCustomMetaDataField resultCustomMetaDataFieldDate = imagekit.CreateCustomMetaDataFields(requestModelDate);\n```\n\n**25\\. Get CustomMetaDataFields**\n\nAccepts the includeDeleted boolean and fetches the metadata as per the [API documentation here](https://docs.imageKit.io/api-reference/custom-metadata-fields-api/get-custom-metadata-field)\n\n```cs\nbool includeDeleted = true;\nResultCustomMetaDataFieldList resultCustomMetaDataFieldList = imageKit.getCustomMetaDataFields(includeDeleted); \n```\n\n**26\\. Edit Custom MetaData Fields**\n\nAccepts an ID of customMetaDataField and an object of class `CustomMetaDataFieldUpdateRequest` specifying the parameters to be used to edit cusomMetaDataFields as per the [API documentation here](https://docs.imageKit.io/api-reference/custom-metadata-fields-api/update-custom-metadata-field).\n\n```cs\nCustomMetaDataFieldUpdateRequest requestUpdateModel = new CustomMetaDataFieldUpdateRequest\n{\n\tId = \"field_id\",\n};\nCustomMetaDataFieldSchemaObject updateschema = new CustomMetaDataFieldSchemaObject\n{\n\ttype = \"Number\",\n\tminValue = 8000,\n\tmaxValue = 3000\n};\n\nrequestUpdateModel.schema = updateschema;\nResultCustomMetaDataField resultCustomMetaDataFieldUpdate = imagekit.UpdateCustomMetaDataFields(requestUpdateModel);\n```\n\n**27\\. Delete Custom MetaData Fields**\n\nAccepts the id to delete the customMetaDataFields as per the [API documentation here](https://docs.imageKit.io/api-reference/custom-metadata-fields-api/delete-custom-metadata-field).\n\n```cs\nResultNoContent resultNoContent = imageKit.DeleteCustomMetaDataField(\"field_id\");\n```\n\n## Utility functions\n\nWe have included the following commonly used utility functions in this library.\n\n### Authentication Parameter Generation\n\nIf you are looking to implement client-side file upload, you will need a token, expiry timestamp, and a valid signature for that upload. The SDK provides a simple method that you can use in your code to generate these authentication parameters for you.\n\n_Note: The Private API Key should never be exposed in any client-side code. You must always generate these authentication parameters on the server-side_\n\n```cs\nAuthParamResponse resp = imageKit.GetAuthenticationParameters();\n```\n\nReturns\n\n```javascript\n{\n    \"token\" : \"unique_token\",\n    \"expire\" : \"valid_expiry_timestamp\",\n    \"signature\" : \"generated_signature\"\n}\n```\n\nBoth the `token` and `expire` parameters are optional. If not specified, the SDK uses the [uuid](https://www.npmjs.com/package/uuid) package to generate a random token and also generates a valid expiry timestamp internally. The value of the `token` and `expire` used to generate the signature is always returned in the response, no matter if they are provided as an input to this method or not.\n\n### Distance calculation between two pHash values\n\nPerceptual hashing allows you to construct a hash value that uniquely identifies an input image based on an image's contents. [imageKit.io metadata API](https://docs.imageKit.io/api-reference/metadata-api) returns the pHash value of an image in the response. You can use this value to [find a duplicate (or similar) image](https://docs.imageKit.io/api-reference/metadata-api#using-phash-to-find-similar-or-duplicate-images) by calculating the distance between the two images' pHash value.\n\nThis SDK exposes `PHashDistance` function to calculate the distance between two pHash values. It accepts two pHash hexadecimal strings and returns a numeric value indicative of the level of difference between the two images.\n\n```cs\npublic static int CalculateDistance() {\n    // asynchronously fetch metadata of two uploaded image files\n    // ...\n    // Extract pHash strings from both: say 'firstHash' and 'secondHash'\n    // ...\n    // Calculate the distance between them:\n    int distance = imageKit.PHashDistance(firstHash, secondHash);\n    return distance;\n}\n```\n\n#### Distance calculation examples\n\n```cs\nimageKit.PHashDistance('firstHash', 'secondHash');\n// output: 0 (same image)\n\nimageKit.PHashDistance('firstHash', 'secondHash');\n// output: 17 (similar images)\n\nimageKit.PHashDistance('firstHash', 'secondHash');\n// output: 37 (dissimilar images)\n```\n\n## Handling errors\n\nCatch and respond to invalid data, internal problems, and more.\n\nImagekit .Net SDK raises exceptions for many reasons, such as being not found, invalid parameters, authentication errors, and internal server errors. We recommend writing code that gracefully handles all possible API exceptions.\n\n#### Example:\n\n```cs\ntry\n{\n    // Use ImageKit's SDK to make requests...\n}\ncatch (InvalidOperationException ex)\n{\n    Console.Write(\"Invalid operation. Please try again.\");\n}\ncatch (FormatException ex)\n{\n    Console.Write(\"Not a valid format. Please try again.\");\n}\ncatch (WebServiceException webEx)\n{\n    /*\n    webEx.StatusCode        = 400\n    webEx.StatusDescription = ArgumentNullException\n    webEx.ErrorCode         = ArgumentNullException\n    webEx.ErrorMessage      = Value cannot be null. Parameter name: Name\n    webEx.StackTrace        = (your Server Exception StackTrace - in DebugMode)\n    webEx.ResponseDto       = (your populated Response DTO)\n    webEx.ResponseStatus    = (your populated Response Status DTO)\n    webEx.GetFieldErrors()  = (individual errors for each field if any)\n    */\n}\n```\n\n## Access request-id, other response headers and HTTP status code\n\nYou can access success or error object to access the HTTP status code and response headers.\n\n```cs\n// Success\nvar response = await imagekit.PurgeStatus(requestId);\nconsole.Write(response.statusCode); // 200\n// {'content-type': 'application/json', 'x-request-id': 'ee560df4-d44f-455e-a48e-29dfda49aec5'}\nconsole.Write(response.Raw);\ntry \n{\n    await imagekit.PurgeStatus(requestId);\n} \ncatch (Exception ex) \n{\n    console.Write(ex.Message); \n // {'content-type': 'application/json', 'x-request-id': 'ee560df4-d44f-455e-a48e-29dfda49aec5'}\n}\n```\n\n## Support\n\nFor any feedback or to report any issues or general implementation support, please reach out to [support@imageKit.io](mailto:support@imageKit.io)\n\n## Links\n\n*   [Documentation](https://docs.imageKit.io)\n*   [Main website](https://imageKit.io)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) File for details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagekit-developer%2Fimagekit-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimagekit-developer%2Fimagekit-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagekit-developer%2Fimagekit-dotnet/lists"}