TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jared Madurai
NA
9
478
PushBullet notification to more than one person
Sep 15 2019 11:54 AM
ive coded the notification too be sent out like this, do i have to use the api keys to every account i want to send a notification too or is there a better aproach
String apiKey = "o.2OU1tt3SygeQxzc7vUsgEV7rdp*******";
String type = "note", title = "Job Card Notification ", body = userList + " has been assigned a job card, please sign into the system to view details";
byte[] data = Encoding.ASCII.GetBytes(String.Format("{{ \"type\": \"{0}\", \"title\": \"{1}\", \"body\": \"{2}\" }}", type, title, body));
var request = System.Net.WebRequest.Create("https://api.pushbullet.com/v2/pushes") as System.Net.HttpWebRequest;
request.Method = "POST";
request.ContentType = "application/json";
request.Credentials = new System.Net.NetworkCredential(apiKey, "");
request.ContentLength = data.Length;
String responseJson = null;
using (var requestStream = request.GetRequestStream())
{
requestStream.Write(data, 0, data.Length);
requestStream.Close();
}
using (var response = request.GetResponse() as System.Net.HttpWebResponse)
{
using (var reader = new System.IO.StreamReader(response.GetResponseStream()))
{
responseJson = reader.ReadToEnd();
}
}
Reply
Answers (
0
)
http handeler in .net
How to use middle war to get next request asp.net core 2