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:* *Example returns:*
* `{code: 0, message:"ok", data: {}}` * `{code: 0, message:"ok", data: {}}`
* `{code: 1, message:"padID does not exist", data: null}` * `{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 */ /** INTERNAL HELPER FUNCTIONS */

View file

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