API key check and user id validation from External Script

This sample code shows how to validate users accessing the JavaScript API from your External Script. This step is optional, as APIdaze does not handle 'users' at all.

Console version : console.html

APIdaze will check your API key and fetch the corresponding External Script URL. A userKeys property is passed to the External Script URL, which in return is expected to send and XML block to validate the user identity.

Sample userKeys JavaScript property :

          {
            command: "auth",
            userid: "john"
          }
        

Expected XML from External Script :

          <document>
           <variables>
             <userid>john</userid>
           </variables>
          </document>
        

API key :
User name :

Console output