PHP
<?php
$options = array (
'http' =>
array (
'ignore_errors' => true,
'header' =>
array (
0 => 'authorization: Bearer YOUR_API_TOKEN',
),
),
);
$context = stream_context_create( $options );
$response = file_get_contents(
'https://public-api.wordpress.com/rest/v1/me/?pretty=1',
false,
$context
);
$response = json_decode( $response );
?>
Response Body
{
"ID": 1001000100,
"display_name": "Mr. Test",
"username": "test",
"email": "test@example.com",
"primary_blog": 415,
"avatar_URL": "http:\/\/0.gravatar.com\/avatar\/a178ebb1731d432338e6bb0158720fcc?s=96&d=identicon&r=G",
"profile_URL": "http:\/\/en.gravatar.com\/test",
"verified" : true,
"meta": {
"links": {
"self": "https:\/\/public-api.wordpress.com\/rest\/v1\/me",
"help": "https:\/\/public-api.wordpress.com\/rest\/v1\/me\/help",
"site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/30434183"
}
}
}