GET /me

Meta data about auth token's User

Resource URL

Type URL and Format
GET https://public-api.wordpress.com/rest/v1/me

Query Parameters

Parameter Type Description
http_envelope (bool)
false:
(default)
true:
Some enviroments (like in-browser Javascript or Flash) block or divert responses with a non-200 HTTP status code. Setting this parameter will force the HTTP status code to always be 200. The JSON response is wrapped in an "envelope" containing the "real" HTTP status code and headers.
pretty (bool)
false:
(default)
true:
Output pretty JSON
callback (string) An optional JSONP callback function.

Response Parameters

Parameter Type Description
ID (int) Numeric user ID
display_name (string) The name to display for a user
username (string) Login name of a user
email (string) Email address
primary_blog (int) ID of a user's primary blog
avatar_URL (url) Gravatar image URL
profile_URL (url) Gravatar Profile URL
verified (boolean) Whether the email address has been verified
meta (object) Meta data

Example

cURL

curl \
 -H 'authorization: Bearer YOUR_API_TOKEN' \
 'https://public-api.wordpress.com/rest/v1/me/?pretty=1'

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"
		}
	}
}