close
The Wayback Machine - https://web.archive.org/web/20140813165717/https://developer.beatsmusic.com/docs/read/token/me

me

You can retrieve information about an access token, including the user ID.


Endpoint URL

/api/me


HTTP Method

GET


Authentication

OAuth 2.0: Access token required. See Authentication for examples and details.


Parameters

n/a


 

Example Request

In many workflows, such as managing playlists, you may need to specify a user's ID. For example, in order to display a user's playlists, you must call the User API and specify the user ID. If you don't yet have the user ID, you can quickly and conveniently retrieve it by calling this API, which only requires that you specify an access token.

The general form of this API is:

curl -i "https://partner.api.beatsmusic.com/v1/api/me" 
        -H "Authorization: Bearer [YOUR_ACCESS_TOKEN]"

 

Example Response

The information returned by this API includes a field called user_context, which represents the user ID.  Other parameters in the response include indicate the expiration date in ISO 8601 UTC notation (expires), and the kind of token that is being returned (token_type) :

HTTP/1.1 200 OK
charset: utf-8
Content-Type: application/json
Date: Fri, 07 Mar 2014 04:20:04 GMT
Server: Mashery Proxy
X-Mashery-Responder: prod-j-worker-us-west-1b-19.mashery.com
Content-Length: 243
Connection: keep-alive

{
    "jsonrpc": "2.0",
    "result": {
        "client_id": "mwfsu49zprp6rbcv4pfrux54",
        "token_type": "bearer",
        "grant_type": "authorization_code",
        "expires": "2014-03-07T05:19:19Z",
        "scope": "uUmMa",
        "user_context": "150470956064702464",
        "extended": null
    },
    "id": 1,
    "code": "OK"
}

Docs Navigation