Media
Update Media Name
Update the name of a media item
curl -X POST https://api.ugc.inc/media/update-name \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "media_abc123",
"name": "my-video.mp4"
}'
import requests
response = requests.post(
'https://api.ugc.inc/media/update-name',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'id': 'media_abc123',
'name': 'my-video.mp4'
}
)
data = response.json()
print(data['data']['name'])
const response = await fetch('https://api.ugc.inc/media/update-name', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
id: 'media_abc123',
name: 'my-video.mp4'
})
});
const data = await response.json();
console.log(data.data.name);
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
const response = await client.media.updateName({
id: 'media_abc123',
name: 'my-video.mp4'
});
if (response.ok) {
console.log(`Updated name to: ${response.data.name}`);
}
{
"ok": true,
"code": 200,
"data": {
"id": "media_abc123",
"org_id": "org_xyz789",
"name": "my-video.mp4",
"tag": "featured",
"type": "video",
"url": "https://example.com/media/video.mp4",
"created_at": "2024-01-15T10:30:00.000Z",
"media_type": "user_media"
},
"message": "Name updated successfully"
}
{
"ok": false,
"code": 404,
"message": "Media not found"
}
⌘I
curl -X POST https://api.ugc.inc/media/update-name \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "media_abc123",
"name": "my-video.mp4"
}'
import requests
response = requests.post(
'https://api.ugc.inc/media/update-name',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'id': 'media_abc123',
'name': 'my-video.mp4'
}
)
data = response.json()
print(data['data']['name'])
const response = await fetch('https://api.ugc.inc/media/update-name', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
id: 'media_abc123',
name: 'my-video.mp4'
})
});
const data = await response.json();
console.log(data.data.name);
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
const response = await client.media.updateName({
id: 'media_abc123',
name: 'my-video.mp4'
});
if (response.ok) {
console.log(`Updated name to: ${response.data.name}`);
}
{
"ok": true,
"code": 200,
"data": {
"id": "media_abc123",
"org_id": "org_xyz789",
"name": "my-video.mp4",
"tag": "featured",
"type": "video",
"url": "https://example.com/media/video.mp4",
"created_at": "2024-01-15T10:30:00.000Z",
"media_type": "user_media"
},
"message": "Name updated successfully"
}
{
"ok": false,
"code": 404,
"message": "Media not found"
}
