[Script] Send notification via Boxcar2 API
Posted: 02 May 2014, 07:44
Send notification via Boxcar2 API
More about API
https://boxcar.uservoice.com/knowledgeb ... tification
Code: Select all
import org.jsoup.Jsoup
import org.jsoup.Connection.Method
// print input parameters
_args.bindings?.each{ _log.finer('Parameter: ' + [it.key, it.key =~ /|pushbullet|gmail|mailto|myepisodes/ ? '*****' : it.value].join(' = ')) }
args.each{ _log.finer("Argument: $it") }
def BoxCarNotification(title,text){
def boxcar2AccessToken = "put your boxcar2 access token"
def page = Jsoup
.connect('https://new.boxcar.io/api/notifications')
.data("user_credentials", boxcar2AccessToken, "notification[title]", title, "notification[long_message]", text, "notification[sound]", "bird-1" )
.method(Method.POST)
.ignoreHttpErrors(true)
.ignoreContentType(true)
.followRedirects(true)
.execute()
}
def title = tryQuietly{ title.toString() }
def text = tryQuietly{ text.toString() }
BoxCarNotification(title,text)
More about API
https://boxcar.uservoice.com/knowledgeb ... tification