Provides easy access to Pushover API.
Add following line to dependencies
section in build.gradle
.
compile 'org.grails.plugins:pushover:1.0.1'
Add following lines to grails-app/conf/application.yml
:
grails:
pushover:
token: <API_TOKEN>
defaultUser: <DEFAULT_USER>
Get your free API Token from Pushover.
The specified token
is used in every Pushover call if no explicit token option is given.
If pushoverService.message()
is called without a user/group token, the defaultUser
is used.
Send message hello world
to defaultUser
with configured token
(see Configuration).
pushoverService.message("hello world")
Send message hello world
to <USER/GROUP_TOKEN>
.
pushoverService.message("hello world", [user: '<USER/GROUP_TOKEN>'])
Send message hello world
using <ANOTHER_API_TOKEN>
API token.
pushoverService.message("hello world", [token: '<ANOTHER_API_TOKEN>'])
All methods and options are named after their Pushover API counterparts. Please read Pushover API.
pushoverService.message(String message, Map options=[:])
message
: your messageoptions
token
: your application's API token (optional iftoken
in config is set)user
: the user/group key (optional ifdefaultUser
in config is set)device
: see Pushover Message API (optional)title
: see Pushover Message API (optional)url
: see Pushover Message API (optional)url_title
: see Pushover Message API (optional)priority
: see Pushover Message API (optional)timestamp
: see Pushover Message API (optional)sound
: see Pushover Message API (optional)
- return value: map of Pushover response (see https://pushover.net/api#response)
pushoverService.sounds(Map options=[:])
options
token
: your application's API token (optional iftoken
in config is set)
- return value: map of Pushover response (see https://pushover.net/api#response)
pushoverService.validateUser(String user, Map options=[:])
user
: the user/group keyoptions
token
: your application's API token (optional iftoken
in config is set)device
: see Pushover API (optional)
- return value: map of Pushover response (see https://pushover.net/api#response)
pushoverService.groups(String group, Map options=[:])
group
: group keyoptions
token
: your application's API token (optional iftoken
in config is set)
- return value: map of Pushover response (see https://pushover.net/api#response)
pushoverService.groupsAddUser(String group, String user, Map options=[:])
group
: group keyuser
: user keyoptions
token
: your application's API token (optional iftoken
in config is set)device
: see Pushover Groups API (optional)memo
: see Pushover Groups API (optional)
- return value: map of Pushover response (see https://pushover.net/api#response)
pushoverService.groupsDeleteUser(String group, String user, Map options=[:])
group
: group keyuser
: user keyoptions
token
: your application's API token (optional iftoken
in config is set)
- return value: map of Pushover response (see https://pushover.net/api#response)
pushoverService.groupsDisableUser(String group, String user, Map options=[:])
group
: group keyuser
: user keyoptions
token
: your application's API token (optional iftoken
in config is set)
- return value: map of Pushover response (see https://pushover.net/api#response)
pushoverService.groupsEnableUser(String group, String user, Map options=[:])
group
: group keyuser
: user keyoptions
token
: your application's API token (optional iftoken
in config is set)
- return value: map of Pushover response (see https://pushover.net/api#response)
pushoverService.groupsRename(String group, String name, Map options=[:])
group
: group keyname
: new name of the groupoptions
token
: your application's API token (optional iftoken
in config is set)
- return value: map of Pushover response (see https://pushover.net/api#response)
##TODOs See also https://pushover.net/api
- obey limitations https://pushover.net/api#limits
- check response https://pushover.net/api#response
- Receipts and Callbacks https://pushover.net/api#receipt
- Being Friendly to our API https://pushover.net/api#friendly
- Subscription API https://pushover.net/api/subscriptions
- Licensing API https://pushover.net/api/licensing