Hello all.
I need a simple Python API payload that will send a message and no more. Tried some ways to adapt the one in the documentation but it beat me.
As it is now, the PS notifications expect a reply and the they get resent. Lots of drama.
Many thanks in advance.
Help with Python Payload
- admin
- Site Admin
- Posts: 1006
- Joined: 1. Dec 2014, 12:41
- Location: Germany
Re: Help with Python Payload
use this one, change the parameter in brackets.
Code: Select all
from urllib.parse import urlencode
from urllib.request import Request, urlopen
url = 'https://www.pushsafer.com/api'
post_fields = {
"t" : 'Test',
"m" : 'Test Message',
"s" : 11,
"v" : 3,
"i" : 33,
"c" : '#FF0000',
"d" : '[device_id]',
"u" : 'https://www.pushsafer.com',
"ut" : 'Open Pushsafer',
"k" : '[private_key]',
}
request = Request(url, urlencode(post_fields).encode())
json = urlopen(request).read().decode()
print(json)
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
Who is online
Users browsing this forum: No registered users and 56 guests