myprowl

Prowl API Library for node

myprowl -- Prowl API Library for node

Wrapper for Prowl's third-party API in version 2011-01-30

  • add
  • verify
  • create API keys

More info and API/Provider Key registration: https://www.prowlapp.com/

  npm install myprowl

Add a notification with the required parameters.

var prowl = require('myprowl');
prowl.keys.setApikey("API-KEY");
prowl.add.simple("myApp","TestEvent","myDescription", function(error,response){
    if(!error){
        console.log("OK, remaining: "+response.success.remaining+
                    " , resetdate: "+response.success.resetdate);
    }else{
        console.log(error);
    }
});

Add a notification with optional parameters.

var prowl = require('myprowl');
prowl.keys.setApikey("API-KEY");
prowl.add.complex({
        priority: 1,
        url: "http://nodejs.org",
        application: "TestApp",
        event: "TestEvent",
        description: "TestDescription"
    }, 
    function(error,response){
    if(!error){
        console.log("OK, remaining: "+response.success.remaining+
                    " , resetdate: "+response.success.resetdate);
    }else{
        console.log(error);
    }
});

Verify an API key that is provided by a user.

var prowl = require('myprowl');
prowl.verify("USER-API-KEY",function(error,response){
    if(!error){
        console.log("valid");
        console.log(response);
    }else{
        console.log(error);
    }
});

Allow applications to create API keys for users.

var prowl = require('myprowl');
prowl.keys.setProviderkey("Provider-KEY");
prowl.retrieve.token(function(error,response){
    if(!error){
        console.log("OK, remaining: "+response.success.remaining+
                    " , resetdate: "+response.success.resetdate);
        console.log("Token: "+response.retrieve.token);
        console.log("Redirect user to url: "+response.retrieve.url);
    }else{
        console.log(error);
    }
});
var prowl = require('myprowl');
prowl.keys.setProviderkey("Provider-KEY");
prowl.retrieve.apikey("TOKEN",function(error,response){
    if(!error){
        console.log("OK, remaining: "+response.success.remaining+
                    " , resetdate: "+response.success.resetdate);
        console.log("API key: "+response.retrieve.apikey);
    }else{
        console.log(error);
    }
});

Set the API Key for your application. The key is used for the add API calls.

  • key - 40-byte hexadecimal string or multiple keys separated by commas.

Set the Provider Key for your application. The provider key is used for all API calls.

  • key - 40-byte hexadecimal string.
  • app - Name of the application. [256 chars]
  • event - Name of the event or the subject. [1024 chars]
  • description - Description [10000 chars]
  • callback - callback(error,response)
  • options
    • priority - Notification priority. [-2,2] (Optional)
    • url - URL which will be attached to the notification. [512 chars] (Optional)
    • app - Name of the application. [256 chars]
    • event - Name of the event or the subject. [1024 chars]
    • description - Description [10000 chars]
  • callback - callback(error,response)
  • callback - callback(error,response)
  • token - Token returned from retrieve.token.
  • callback - callback(error,response)