curl \
-H 'authorization: Bearer YOUR_API_TOKEN' \
--data-urlencode 'title=Updated Title' \
'https://public-api.wordpress.com/rest/v1.1/sites/82974409/media/446'
<?php
$options = array (
'http' =>
array (
'ignore_errors' => true,
'method' => 'POST',
'header' =>
array (
0 => 'authorization: Bearer YOUR_API_TOKEN',
1 => 'Content-Type: application/x-www-form-urlencoded',
),
'content' =>
http_build_query( array (
'title' => 'Updated Title',
)),
),
);
$context = stream_context_create( $options );
$response = file_get_contents(
'https://public-api.wordpress.com/rest/v1.1/sites/82974409/media/446',
false,
$context
);
$response = json_decode( $response );
?>
Response
{
"ID": 446,
"URL": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png",
"guid": "http:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png",
"date": "2015-01-15T19:30:00+00:00",
"post_ID": 0,
"author_ID": 78972699,
"file": "redterrain-holly27.png",
"mime_type": "image\/png",
"extension": "png",
"title": "Updated Title",
"caption": "1",
"description": "",
"alt": "",
"icon": "https:\/\/s1.wp.com\/wp-includes\/images\/media\/default.png",
"size": "0.00 B",
"thumbnails": {
"thumbnail": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=150",
"medium": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=300",
"large": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=635",
"newspack-article-block-landscape-large": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=635&h=421&crop=1",
"newspack-article-block-portrait-large": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=635&h=421&crop=1",
"newspack-article-block-square-large": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=635&h=421&crop=1",
"newspack-article-block-landscape-medium": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=635&h=421&crop=1",
"newspack-article-block-portrait-medium": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=600&h=421&crop=1",
"newspack-article-block-square-medium": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=635&h=421&crop=1",
"newspack-article-block-landscape-small": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=400&h=300&crop=1",
"newspack-article-block-portrait-small": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=300&h=400&crop=1",
"newspack-article-block-square-small": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=400&h=400&crop=1",
"newspack-article-block-landscape-tiny": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=200&h=150&crop=1",
"newspack-article-block-portrait-tiny": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=150&h=200&crop=1",
"newspack-article-block-square-tiny": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=200&h=200&crop=1",
"newspack-article-block-uncropped": "https:\/\/apiexamples.files.wordpress.com\/2015\/01\/redterrain-holly27.png?w=635"
},
"height": 421,
"width": 635,
"exif": {
"aperture": 0,
"credit": "",
"camera": "",
"caption": "",
"created_timestamp": 0,
"copyright": "",
"focal_length": 0,
"iso": 0,
"shutter_speed": 0,
"title": "",
"orientation": 0
},
"meta": {
"links": {
"self": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409\/media\/446",
"help": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409\/media\/446\/help",
"site": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409"
}
}
}