response = getRequest("/filter/list?type=&showHidden=false&page=0&app_id=%s"%default_app_id, token)
default_filter_id = response['content'][0]['id']
logging.info("Filter Id for DEFAULT FILTER =%s"%default_filter_id)
Audience count
response = getRequest("/filter/count/%s"%default_filter_id, token)
device_count = response['devices']['deviceCount']
logging.info("Filter Device Count = %s"% device_count)
playtime = int(time.time() * 1000) #playtime in milliseconds, is 5 minutes in advance
logging.info("Play time is set current time =%d"%playtime)
Create message
data = {}
data['appId'] = default_app_id
data['title'] = 'Python Test Message'
data['subtitle'] ='Python test message'
data['text'] = 'This is a very short text test message.'
data['fbTitle'] = 'Fb Title'
data['fbSubtitle'] ='Gb Subtitle'
data['fbText'] = 'Fb This is a very short text test message.'
data['expiry'] = '1440'
data['playTime'] = playtime
data['about'] = []
data['filterId'] = default_filter_id
data['companyId'] = company_id
data['type'] = 'TEXT'
data['priority'] = 'MEDIUM'
data['channel'] = 'PUSH'
data['favourite'] = 0
data['action'] = "ok"
response = postRequest("/notification/create", token, data)
notification_id = response['id']
logging.info("NotificationId = %s"%notification_id)