Skip to content
ImageKit.io edited this page Dec 27, 2022 · 5 revisions
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!

ImageKit\ImageKit

Imagekit Class

Methods

NameDescription
__constructImageKit Client Constructor
bulkAddTagsAdd tags to multiple files in a single request. The method accepts an array of fileIDs of the files and an array of tags that have to be added to those files.
bulkDeleteFilesDelete multiple files. The method accepts an array of file IDs of the files that have to be deleted.
bulkFileDeleteByIdsDelete multiple files. The method accepts an array of file IDs of the files that have to be deleted.
bulkRemoveAITagsRemove AI tags from multiple files in a single request. The method accepts an array of fileIDs of the files and an array of tags that have to be removed to those files.
bulkRemoveTagsRemove tags to multiple files in a single request. The method accepts an array of fileIDs of the files and an array of tags that have to be removed to those files.
copyThis will copy a file from one location to another. This method accepts an array of source file's path, destination path and boolean to include versions or not folder path.
copyFileThis will copy a file from one location to another. This method accepts an array of source file's path, destination path and boolean to include versions or not folder path.
copyFolderThis will copy a folder from one location to another. This method accepts an array of source folder's path, destination path and boolean to include versions or not.
createCustomMetadataFieldCreate custom metadata field using this API.
createFolderThis will create a new folder. This method accepts folder name and parent folder path in an array.
deleteCustomMetadataFieldDelete custom metadata field using this API.
deleteFileYou can programmatically delete uploaded files in media library using delete file API.
deleteFileVersionYou can programmatically delete uploaded file version in media library using delete file version API.
deleteFolderThis will delete the specified folder and all nested files & folders.
getAuthenticationParameters
getBulkJobStatusThis endpoint allows you to get the status of a bulk operation e.g. copy or move folder API.
getCustomMetadataFieldsGet custom metadata field using this API.
getDetailsGet the file details such as tags, customCoordinates, and isPrivate properties using get file detail API.
getFileDetailsGet the file details such as tags, customCoordinates, and isPrivate properties using get file detail API.
getFileMetaDataGet image exif, pHash and other metadata for uploaded files in ImageKit.io media library using this API.
getFileMetadataFromRemoteURLGet image exif, pHash and other metadata for uploaded files in ImageKit.io powered remote URL using this API.
getFileVersionDetailsGet the file version details such as tags, customCoordinates, and isPrivate properties using get file version details API.
getFileVersionsGet all the versions of a file using get file versions API.
getMetaDataGet image exif, pHash and other metadata for uploaded files in ImageKit.io media library using this API.
getPurgeCacheStatusGet the status of submitted purge request.
listFilesThis API can list all the uploaded files in your ImageKit.io media library.
moveThis will move a file from one location to another. This method accepts an array containing source file's path and destination path folder path.
moveFileThis will move a file from one location to another. This method accepts an array containing source file's path and destination path folder path.
moveFolderThis will move a folder from one location to another. This method accepts the source folder's path and destination folder path in an array.
pHashDistanceUsing pHash to find similar or duplicate images The hamming distance between two pHash values determines how similar or different the images are.
purgeCacheThis will purge CDN and ImageKit.io internal cache.
purgeCacheApiThis will purge CDN and ImageKit.io internal cache.
purgeCacheStatusGet the status of submitted purge request.
purgeFileCacheApiThis will purge CDN and ImageKit.io internal cache.
purgeFileCacheApiStatusGet the status of submitted purge request.
renameThis will rename a file. This method accepts the source file's path, new file name and an optional parameter boolean to purge cache
renameFileThis will rename a file. This method accepts the source file's path, new file name and an optional parameter boolean to purge cache
restoreFileVersionThis will Restore file version to a different version of a file. This method accepts the fileId and versionId
updateCustomMetadataFieldUpdate custom metadata field using this API.
updateDetailsUpdate file details such as tags and customCoordinates attribute using update file detail API.
updateFileDetailsUpdate file details such as tags and customCoordinates attribute using update file detail API.
uploadYou can upload files to ImageKit.io media library from your server-side using private API key authentication.
uploadFileYou can upload files to ImageKit.io media library from your server-side using private API key authentication.
uploadFilesYou can upload files to ImageKit.io media library from your server-side using private API key authentication.
urlYou can add multiple origins in the same ImageKit.io account.

ImageKit::__construct

Description

public__construct (string $publicKey, string $privateKey, string $urlEndpoint, string $transformationPosition)

ImageKit Client Constructor

Parameters

  • (string) $publicKey : The Public Key as obtained from the imagekit developer dashboard
  • (string) $privateKey : The Private Key as obtained from the imagekit developer dashboard
  • (string) $urlEndpoint : The URL Endpoint as obtained from the imagekit developer dashboard
  • (string) $transformationPosition : Default value is path that places the transformation string as a path parameter in the URL. Can also be specified as query which adds the transformation string as the query parameter tr in the URL. If you use src parameter to create the URL, then the transformation string is always added as a query parameter.

Return Values

void


ImageKit::bulkAddTags

Description

publicbulkAddTags (array<int,string> $fileIds, array<int,string> $tags)

Add tags to multiple files in a single request. The method accepts an array of fileIDs of the files and an array of tags that have to be added to those files.

Parameters

  • (array<int,string>) $fileIds
  • (array<int,string>) $tags

Return Values

\Response


ImageKit::bulkDeleteFiles

Description

publicbulkDeleteFiles ( $fileIds)

Delete multiple files. The method accepts an array of file IDs of the files that have to be deleted.

Parameters

  • () $fileIds

Return Values

\Response


ImageKit::bulkFileDeleteByIds

Description

publicbulkFileDeleteByIds ( $options)

Delete multiple files. The method accepts an array of file IDs of the files that have to be deleted.

Parameters

  • () $options

Return Values

\Response


ImageKit::bulkRemoveAITags

Description

publicbulkRemoveAITags (array<int,string> $fileIds, array<int,string> $AITags)

Remove AI tags from multiple files in a single request. The method accepts an array of fileIDs of the files and an array of tags that have to be removed to those files.

Parameters

  • (array<int,string>) $fileIds
  • (array<int,string>) $AITags

Return Values

\Response


ImageKit::bulkRemoveTags

Description

publicbulkRemoveTags (array<int,string> $fileIds, array<int,string> $tags)

Remove tags to multiple files in a single request. The method accepts an array of fileIDs of the files and an array of tags that have to be removed to those files.

Parameters

  • (array<int,string>) $fileIds
  • (array<int,string>) $tags

Return Values

\Response


ImageKit::copy

Description

public copy ( $parameter['sourceFilePath','destinationPath','includeFileVersions'])

This will copy a file from one location to another. This method accepts an array of source file's path, destination path and boolean to include versions or not folder path.

Parameters

  • () $parameter['sourceFilePath','destinationPath','includeFileVersions']

Return Values

\Response


ImageKit::copyFile

Description

publiccopyFile ( $sourceFilePath, $destinationPath, $includeFileVersions)

This will copy a file from one location to another. This method accepts an array of source file's path, destination path and boolean to include versions or not folder path.

Parameters

  • () $sourceFilePath
  • () $destinationPath
  • () $includeFileVersions

Return Values

\Response


ImageKit::copyFolder

Description

public copyFolder ( $parameter[$sourceFolderPath, $destinationPath, includeFileVersions])

This will copy a folder from one location to another. This method accepts an array of source folder's path, destination path and boolean to include versions or not.

Parameters

  • () $parameter[$sourceFolderPath, $destinationPath, includeFileVersions]

Return Values

\Response


ImageKit::createCustomMetadataField

Description

public createCustomMetadataField ( $parameter[$name,$label,$schema])

Create custom metadata field using this API.

Parameters

  • () $parameter[$name,$label,$schema]

Return Values

\Response


ImageKit::createFolder

Description

publiccreateFolder ( $parameter[$folderName, $parentFolderPath])

This will create a new folder. This method accepts folder name and parent folder path in an array.

Parameters

  • () $parameter[$folderName, $parentFolderPath]

Return Values

\Response


ImageKit::deleteCustomMetadataField

Description

publicdeleteCustomMetadataField ( $id)

Delete custom metadata field using this API.

Parameters

  • () $id

Return Values

\Response


ImageKit::deleteFile

Description

publicdeleteFile ( $fileId)

You can programmatically delete uploaded files in media library using delete file API.

Parameters

  • () $fileId

Return Values

\Response


ImageKit::deleteFileVersion

Description

publicdeleteFileVersion ( $fileId, $versionId)

You can programmatically delete uploaded file version in media library using delete file version API.

Parameters

  • () $fileId
  • () $versionId

Return Values

\Response


ImageKit::deleteFolder

Description

publicdeleteFolder ( $folderPath)

This will delete the specified folder and all nested files & folders.

This method accepts the full path of the folder that is to be deleted.

Parameters

  • () $folderPath

Return Values

\Response


ImageKit::getAuthenticationParameters

Description

getAuthenticationParameters (void)

Parameters

This function has no parameters.

Return Values

void


ImageKit::getBulkJobStatus

Description

publicgetBulkJobStatus ( $jobId)

This endpoint allows you to get the status of a bulk operation e.g. copy or move folder API.

Parameters

  • () $jobId

Return Values

\Response


ImageKit::getCustomMetadataFields

Description

publicgetCustomMetadataFields ( $includeDeleted)

Get custom metadata field using this API.

Parameters

  • () $includeDeleted

Return Values

\Response


ImageKit::getDetails

Description

publicgetDetails (string $fileId)

Get the file details such as tags, customCoordinates, and isPrivate properties using get file detail API.

Parameters

  • (string) $fileId

Return Values

\Response


ImageKit::getFileDetails

Description

publicgetFileDetails (string $fileId)

Get the file details such as tags, customCoordinates, and isPrivate properties using get file detail API.

Parameters

  • (string) $fileId

Return Values

\Response


ImageKit::getFileMetaData

Description

publicgetFileMetaData (string $fileId)

Get image exif, pHash and other metadata for uploaded files in ImageKit.io media library using this API.

Parameters

  • (string) $fileId : The unique fileId of the uploaded file. fileId is returned in list files API and upload API

Return Values

\Response


ImageKit::getFileMetadataFromRemoteURL

Description

publicgetFileMetadataFromRemoteURL ( $url)

Get image exif, pHash and other metadata for uploaded files in ImageKit.io powered remote URL using this API.

Parameters

  • () $url

Return Values

\Response


ImageKit::getFileVersionDetails

Description

publicgetFileVersionDetails (string $fileId, string $versionId)

Get the file version details such as tags, customCoordinates, and isPrivate properties using get file version details API.

Parameters

  • (string) $fileId
  • (string) $versionId

Return Values

\Response


ImageKit::getFileVersions

Description

publicgetFileVersions (string $fileId)

Get all the versions of a file using get file versions API.

Parameters

  • (string) $fileId

Return Values

\Response


ImageKit::getMetaData

Description

publicgetMetaData (string $fileId)

Get image exif, pHash and other metadata for uploaded files in ImageKit.io media library using this API.

Parameters

  • (string) $fileId : The unique fileId of the uploaded file. fileId is returned in list files API and upload API

Return Values

\Response


ImageKit::getPurgeCacheStatus

Description

publicgetPurgeCacheStatus ( $requestId)

Get the status of submitted purge request.

Parameters

  • () $requestId

Return Values

\Response


ImageKit::listFiles

Description

publiclistFiles (array $parameters)

This API can list all the uploaded files in your ImageKit.io media library.

For searching and filtering, you can use query parameters as described below.

Parameters

  • (array) $parameters

Return Values

\Response


ImageKit::move

Description

public move ( $parameter['sourceFilePath','destinationPath'])

This will move a file from one location to another. This method accepts an array containing source file's path and destination path folder path.

Parameters

  • () $parameter['sourceFilePath','destinationPath']

Return Values

\Response


ImageKit::moveFile

Description

publicmoveFile ( $sourceFilePath, $destinationPath, $includeVersions)

This will move a file from one location to another. This method accepts an array containing source file's path and destination path folder path.

Parameters

  • () $sourceFilePath
  • () $destinationPath
  • () $includeVersions

Return Values

\Response


ImageKit::moveFolder

Description

publicmoveFolder ( $parameter[$sourceFolderPath, $destinationPath])

This will move a folder from one location to another. This method accepts the source folder's path and destination folder path in an array.

Parameters

  • () $parameter[$sourceFolderPath, $destinationPath]

Return Values

\Response


ImageKit::pHashDistance

Description

publicpHashDistance (string $firstPHash, string $secondPHash)

Using pHash to find similar or duplicate images The hamming distance between two pHash values determines how similar or different the images are.

The pHash value returned by ImageKit.io metadata API is a hexadecimal string of 64bit pHash. The distance between two hash can be between 0 and 64. A lower distance means similar images. If the distance is 0, that means two images are identical.

Parameters

  • (string) $firstPHash
  • (string) $secondPHash

Return Values

int


ImageKit::purgeCache

Description

publicpurgeCache ( $options)

This will purge CDN and ImageKit.io internal cache.

Parameters

  • () $options

Return Values

\Response


ImageKit::purgeCacheApi

Description

publicpurgeCacheApi ( $options)

This will purge CDN and ImageKit.io internal cache.

Parameters

  • () $options

Return Values

\Response


ImageKit::purgeCacheStatus

Description

publicpurgeCacheStatus ( $requestId)

Get the status of submitted purge request.

Parameters

  • () $requestId

Return Values

\Response


ImageKit::purgeFileCacheApi

Description

publicpurgeFileCacheApi ( $options)

This will purge CDN and ImageKit.io internal cache.

Parameters

  • () $options

Return Values

\Response


ImageKit::purgeFileCacheApiStatus

Description

publicpurgeFileCacheApiStatus ( $requestId)

Get the status of submitted purge request.

Parameters

  • () $requestId

Return Values

\Response


ImageKit::rename

Description

public rename ( $parameter[$filePath, $newFileNamem, $purgeCache])

This will rename a file. This method accepts the source file's path, new file name and an optional parameter boolean to purge cache

Parameters

  • () $parameter[$filePath, $newFileNamem, $purgeCache]

Return Values

\Response


ImageKit::renameFile

Description

publicrenameFile ( $filePath, $newFileName, $purgeCache)

This will rename a file. This method accepts the source file's path, new file name and an optional parameter boolean to purge cache

Parameters

  • () $filePath
  • () $newFileName
  • () $purgeCache

Return Values

\Response


ImageKit::restoreFileVersion

Description

publicrestoreFileVersion ( $parameter[$fileId, $versionId])

This will Restore file version to a different version of a file. This method accepts the fileId and versionId

Parameters

  • () $parameter[$fileId, $versionId]

Return Values

\Response


ImageKit::updateCustomMetadataField

Description

public updateCustomMetadataField ( $id, $parameter[$name,$label,$schema])

Update custom metadata field using this API.

Parameters

  • () $id
  • () $parameter[$name,$label,$schema]

Return Values

\Response


ImageKit::updateDetails

Description

publicupdateDetails (string $fileId, array $updateData)

Update file details such as tags and customCoordinates attribute using update file detail API.

Parameters

  • (string) $fileId : The unique fileId of the uploaded file. fileId is returned in list files API and upload API
  • (array) $updateData

Return Values

\Response


ImageKit::updateFileDetails

Description

publicupdateFileDetails (string $fileId, array $updateData)

Update file details such as tags and customCoordinates attribute using update file detail API.

Parameters

  • (string) $fileId : The unique fileId of the uploaded file. fileId is returned in list files API and upload API
  • (array) $updateData

Return Values

\Response


ImageKit::upload

Description

publicupload (array $options)

You can upload files to ImageKit.io media library from your server-side using private API key authentication.

Parameters

  • (array) $options

Return Values

object


ImageKit::uploadFile

Description

publicuploadFile (array $options)

You can upload files to ImageKit.io media library from your server-side using private API key authentication.

Parameters

  • (array) $options

Return Values

\Response


ImageKit::uploadFiles

Description

publicuploadFiles (array $options)

You can upload files to ImageKit.io media library from your server-side using private API key authentication.

Parameters

  • (array) $options

Return Values

\Response


ImageKit::url

Description

publicurl (array $options)

You can add multiple origins in the same ImageKit.io account.

URL endpoints allow you to configure which origins are accessible through your account and set their preference order as well.

Parameters

  • (array) $options

Return Values

string


Clone this wiki locally