Go asset management
Last updated: Oct-31-2023
While using Cloudinary, all your images, videos, and other raw files are uploaded to Cloudinary. You can use our Media Library web interface to browse through and manage your uploaded media assets. In addition, you can use methods from the Upload and Admin APIs, which offer methods for managing, organizing, and creating media assets.
- Upload API methods can be used as needed.
-
Admin API methods are rate-limited.
You can view the number of hourly Admin API requests allowed by your Cloudinary plan in the Account page of your Console Settings.
Upload API
In addition to the upload
method, this API includes methods for:
- renaming and permanently deleting individual assets
- adding tags, contextual metadata and structured metadata to assets
- creating new assets such as text images, archives (zip or tgz), and sprites
- modifying existing assets.
Admin API
A secure API with methods for managing and organizing your media assets, including:
- listing and restoring assets
- bulk asset deleting
- managing upload presets, upload mappings, transformations, and folders
- updating existing assets
- performing advanced searches on the assets in your product environment
-
generating a usage report
and more...
image
. When working with videos, remember to explicitly set the resource_type
to video
.Upload API example - delete a single asset
The following Go example uses the Upload API Destroy method to delete the video with public ID sample
from your Cloudinary product environment:
resp, err := cld.Upload.Destroy(ctx, uploader.DestroyParams{
PublicID: "sample",
ResourceType: "video"})
Sample output:
&{
result:ok
}
For more Upload API examples in Go, select the Go
tab in the Upload API reference.
Admin API example - get details of a single asset
The following Go example uses the Admin API Asset method to return details of the image with public ID sample
:
resp, err := cld.Admin.Asset(ctx, admin.AssetParams{
PublicID: "sample",
})
The API call returns a struct
with content similar to the following:
&{
AssetID:d5daa51b467c7fc9f290c4d89a47049e
PublicID:sample
Format:jpg
Version:1589893927
ResourceType:image
Type:upload
CreatedAt:2020-05-19 13:12:07 +0000 UTC
Bytes:2495692
Width:4480
Height:6720
Backup:false
AccessMode:public
URL:http://res.cloudinary.com/demo/image/upload/v1589893927/sample.jpg
SecureURL:https://res.cloudinary.com/demo/image/upload/v1589893927/sample.jpg
Metadata:map[]
Tags:[] NextCursor:2d09d1437a131d64ea76456d86e4a0397834817fdb1260ba13f523f3af1387e6
Derived:[map]
Etag:
ImageMetadata:map[]
Coordinates:{}
Exif:{}
Faces:[]
IllustrationScore:0
SemiTransparent:false
Grayscale:false
Colors:[]
QualityScore:0
AccessibilityAnalysis:{ColorblindAccessibilityAnalysis:{DistinctEdges:0 DistinctColors:0 MostIndistinctPair:[]} ColorblindAccessibilityScore:0}
Pages:0
CinemagraphAnalysis:{CinemagraphScore:0}
Usage:{}
OriginalFilename:
Error:{Message:}}
For more Admin API examples in .NET, select the Go
tab in the Admin API reference.