Oauth API Methods

API methods for implementing Oauth authentication

Some API methods need to be authenticated. We use Oauth authentication for these requests. For these authenticated requests you must generate a cryptographic signature based upon your request, consumer key and shared secret. The authentication process can be a bit complicated, so it is recommended that you use a library (such as pyechonest or jEN) to handle all of the authentication details. To sign a request, you add a nonce parameter (a random string of characters that differs from call to call), a timestamp (the number of seconds since the epoch) and a signature which is generated by applying a cryptographic hash (such as SHA1) to your consumer key, shared secret and the base string portion of the request. A guide to signing requests can be found in The Oauth 1.0 Guide. Netflix also has an excellent description of how to sign requests in their Authentication oveview.

Methods that require authentication are:
sandbox/access

timestamp

Returns the current time of The Echo Nest API server. This time can be used to synchronize the local time with The Echo Nest allowing you to set a proper timestamp used generate authenticated requests to the API. This call returns the number of seconds elapsed since midnight, 1 January 1970.

Parameter Required? Multiple? Values Description
api_key yes no YOUR_API_KEY your API key.
format no no json, xml, jsonp The desired format of the response
callback Required if format is jsonp no MyJSFunc the callback function for JSONP requests

Example query:

http://developer.echonest.com/api/v4/oauth/timestamp?api_key=YOUR_API_KEY

Here is an example response:

{
    "response": {
        "current_time": 1319824425,
        "status": {
            "code": 0,
            "message": "success",
            "version": "4.2"
        }
    }
}