Merge pull request #1272 from stephan48/patch-1

Added a checkToken Method for checking the Validity of the API Token
This commit is contained in:
John McLear 2012-12-10 01:17:11 -08:00
commit f1ca9bb456
3 changed files with 24 additions and 0 deletions

View file

@ -407,3 +407,12 @@ sends a custom message of type `msg` to the pad
*Example returns:*
* `{code: 0, message:"ok", data: {}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### checkToken()
* API >= 1
returns ok when api token is valid
*Example returns:*
* `{"code":0,"message":"ok","data":null}`
* `{"code":4,"message":"no or wrong API Key","data":null}`

View file

@ -548,6 +548,19 @@ exports.sendClientsMessage = function (padID, msg, callback) {
} );
}
/**
checkToken() returns ok when api token is valid
Example returns:
{"code":0,"message":"ok","data":null}
{"code":4,"message":"no or wrong API Key","data":null}
*/
exports.checkToken = function(callback)
{
callback();
}
/******************************/
/** INTERNAL HELPER FUNCTIONS */

View file

@ -68,6 +68,7 @@ var version =
, "isPasswordProtected" : ["padID"]
, "listAuthorsOfPad" : ["padID"]
, "padUsersCount" : ["padID"]
, "checkToken" : []
}
, "1.1":
{ "createGroup" : []
@ -102,6 +103,7 @@ var version =
, "padUsers" : ["padID"]
, "sendClientsMessage" : ["padID", "msg"]
, "listAllGroups" : []
, "checkToken" : []
}
};