Asset Media - Rotate Asset
This guide explains how to rotate an asset in EnterMediaDB using:
- JSON REST API
- EnterMediaDB API UI
Both methods perform the same operation.
1. Overview
The Rotate Asset API allows you to rotate an existing asset by a specified number of degrees.
This process updates the asset’s orientation based on the provided rotation value.
2. API Endpoint
The API endpoint is the URL used to run this operation via the REST API.
Endpoint:
POST /assets/mediadb/services/module/asset/media/rotateassetThis endpoint:
- Processes a rotation request
- Applies the specified rotation to the given asset
3. Required Parameters
The following parameters must be included in the request body:
- assetid: ID of the asset to rotate
- rotate: Degrees to rotate the asset (e.g., 90, 180, 270)
These values specify which asset to modify and how it should be rotated.
4. Rotate Asset Using JSON REST API
Step 1: Prepare Your Data
Example:
{
"assetid": "101",
"rotate": "90"
}Step 2: Send the Request
curl -H "Content-Type: application/json" \
-X POST http://entermedia.org/assets/mediadb/services/module/asset/media/rotateasset \
-b "entermedia.key=YOUR_SESSION_KEY" \
-d '{
"assetid": "101",
"rotate": "90"
}'Notes
- Replace
YOUR_SESSION_KEYwith your actualentermedia.key - Ensure your API session is initialized (see Authentication section)
- Use
-Lif your server redirects to HTTPS
5. Rotate Asset Using EnterMediaDB API UI
You can rotate an asset directly in the EnterMediaDB interface.
Steps
Open the EnterMediaDB API UI
In the left sidebar, navigate to:
Asset Media → Rotate Asset
In the request editor, enter:
{
"assetid": "101",
"rotate": "90"
}4. Click Execute
6. Response
A successful request returns:
{
"response": {
"status": "ok",
"height": 200,
"width": 133
}
}7. What Happens After Rotation
After a successful request:
- The asset is rotated by the specified number of degrees
- The updated dimensions (height and width) are returned
- The asset is saved with the new orientation
8. Troubleshooting
1. Rotation fails
- Check that
assetidis valid - Ensure
rotatevalue is supported (e.g., 90, 180, 270) - Verify API permissions are enabled
2. Unauthorized request
- Ensure
entermedia.keyis included - Ensure session is initialized
- Verify permissions
3. No visible change
- Refresh the asset in the UI
- Confirm the correct asset was targeted
- Verify the rotation value was applied correctly