Help with Python Payload

Pushsafer make it easy and safe to get push-notifications in real time on your Android or Windows mobile device, iPhone, iPad and Desktop!

Mit Pushsafer kann man in Echtzeit, einfach und sicher, Push-Benachrichtigungen auf sein iPhone, iPad, Android oder Windows Gerät sowie auf den Desktop senden lassen!

======================
Google Play
App Store
Windows Store
Homepage
proufo
Posts: 4
Joined: 8. May 2023, 22:44

Help with Python Payload

Postby proufo » 21. Jun 2023, 02:15

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.

User avatar
admin
Site Admin
Posts: 944
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: Help with Python Payload

Postby admin » 21. Jun 2023, 12:37

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

proufo
Posts: 4
Joined: 8. May 2023, 22:44

Re: Help with Python Payload

Postby proufo » 21. Jun 2023, 14:28

Perfect.

Many, many thanks!


Who is online

Users browsing this forum: No registered users and 161 guests