Skip to content

ImageKit

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

Name Description
__construct ImageKit Client Constructor
bulkAddTags 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.
bulkDeleteFiles Delete multiple files. The method accepts an array of file IDs of the files that have to be deleted.
bulkFileDeleteByIds Delete multiple files. The method accepts an array of file IDs of the files that have to be deleted.
bulkRemoveAITags 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.
bulkRemoveTags 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.
copy 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.
copyFile 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.
copyFolder 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.
createCustomMetadataField Create custom metadata field using this API.
createFolder This will create a new folder. This method accepts folder name and parent folder path in an array.
deleteCustomMetadataField Delete custom metadata field using this API.
deleteFile You can programmatically delete uploaded files in media library using delete file API.
deleteFileVersion You can programmatically delete uploaded file version in media library using delete file version API.
deleteFolder This will delete the specified folder and all nested files & folders.
getAuthenticationParameters
getBulkJobStatus This endpoint allows you to get the status of a bulk operation e.g. copy or move folder API.
getCustomMetadataFields Get custom metadata field using this API.
getDetails Get the file details such as tags, customCoordinates, and isPrivate properties using get file detail API.
getFileDetails Get the file details such as tags, customCoordinates, and isPrivate properties using get file detail API.
getFileMetaData Get image exif, pHash and other metadata for uploaded files in ImageKit.io media library using this API.
getFileMetadataFromRemoteURL Get image exif, pHash and other metadata for uploaded files in ImageKit.io powered remote URL using this API.
getFileVersionDetails Get the file version details such as tags, customCoordinates, and isPrivate properties using get file version details API.
getFileVersions Get all the versions of a file using get file versions API.
getMetaData Get image exif, pHash and other metadata for uploaded files in ImageKit.io media library using this API.
getPurgeCacheStatus Get the status of submitted purge request.
listFiles This API can list all the uploaded files in your ImageKit.io media library.
move 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.
moveFile 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.
moveFolder 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.
pHashDistance Using pHash to find similar or duplicate images The hamming distance between two pHash values determines how similar or different the images are.
purgeCache This will purge CDN and ImageKit.io internal cache.
purgeCacheApi This will purge CDN and ImageKit.io internal cache.
purgeCacheStatus Get the status of submitted purge request.
purgeFileCacheApi This will purge CDN and ImageKit.io internal cache.
purgeFileCacheApiStatus Get the status of submitted purge request.
rename This will rename a file. This method accepts the source file's path, new file name and an optional parameter boolean to purge cache
renameFile This will rename a file. This method accepts the source file's path, new file name and an optional parameter boolean to purge cache
restoreFileVersion This will Restore file version to a different version of a file. This method accepts the fileId and versionId
updateCustomMetadataField Update custom metadata field using this API.
updateDetails Update file details such as tags and customCoordinates attribute using update file detail API.
updateFileDetails Update file details such as tags and customCoordinates attribute using update file detail API.
upload You can upload files to ImageKit.io media library from your server-side using private API key authentication.
uploadFile You can upload files to ImageKit.io media library from your server-side using private API key authentication.
uploadFiles You can upload files to ImageKit.io media library from your server-side using private API key authentication.
url You 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

public bulkAddTags (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

public bulkDeleteFiles ( $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

public bulkFileDeleteByIds ( $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

public bulkRemoveAITags (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

public bulkRemoveTags (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

public copyFile ( $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

public createFolder ( $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

public deleteCustomMetadataField ( $id)

Delete custom metadata field using this API.

Parameters

  • () $id

Return Values

\Response


ImageKit::deleteFile

Description

public deleteFile ( $fileId)

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

Parameters

  • () $fileId

Return Values

\Response


ImageKit::deleteFileVersion

Description

public deleteFileVersion ( $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

public deleteFolder ( $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

public getBulkJobStatus ( $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

public getCustomMetadataFields ( $includeDeleted)

Get custom metadata field using this API.

Parameters

  • () $includeDeleted

Return Values

\Response


ImageKit::getDetails

Description

public getDetails (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

public getFileDetails (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

public getFileMetaData (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

public getFileMetadataFromRemoteURL ( $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

public getFileVersionDetails (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

public getFileVersions (string $fileId)

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

Parameters

  • (string) $fileId

Return Values

\Response


ImageKit::getMetaData

Description

public getMetaData (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

public getPurgeCacheStatus ( $requestId)

Get the status of submitted purge request.

Parameters

  • () $requestId

Return Values

\Response


ImageKit::listFiles

Description

public listFiles (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

public moveFile ( $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

public moveFolder ( $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

public pHashDistance (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

public purgeCache ( $options)

This will purge CDN and ImageKit.io internal cache.

Parameters

  • () $options

Return Values

\Response


ImageKit::purgeCacheApi

Description

public purgeCacheApi ( $options)

This will purge CDN and ImageKit.io internal cache.

Parameters

  • () $options

Return Values

\Response


ImageKit::purgeCacheStatus

Description

public purgeCacheStatus ( $requestId)

Get the status of submitted purge request.

Parameters

  • () $requestId

Return Values

\Response


ImageKit::purgeFileCacheApi

Description

public purgeFileCacheApi ( $options)

This will purge CDN and ImageKit.io internal cache.

Parameters

  • () $options

Return Values

\Response


ImageKit::purgeFileCacheApiStatus

Description

public purgeFileCacheApiStatus ( $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

public renameFile ( $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

public restoreFileVersion ( $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

public updateDetails (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

public updateFileDetails (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

public upload (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

public uploadFile (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

public uploadFiles (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

public url (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