verifying sender email requires user to log in to sendgrid - sendgrid

Perhaps I'm doing something wrong here but it doesn't seem to make any sense to me that when I try to use the SendGrid API V3 to verify a sender email it asks the user to log in to sendgrid. In this case it was an email of a customer of ours who obviously is not expected to have a sendgrid account. I just want him to be able to send email from my product. So when I try to verify an email, the email goes to the customer but then it asks to log in to sendgrid?
This workflow doesn't make any sense. Why would they need to have Sendgrid? They're using my software to be able to send email. I just need them to verify that they own the email address. That's all. I would have assumed that Sendgrid would just send one email to them to verify that they own the address and then upon clicking it would simply just verify. In this case, it's asking them to log into Sendgrid.
Cany anyone shed any light on this? What am I missing here?
Here's the API call I'm making
https://api.sendgrid.com/v3/verified_senders
with this JSON data
{
"nickname": "Sam",
"from_email": "sam#sam.com",
"from_name": "ABC",
"reply_to": "sam#sam.com",
"reply_to_name": "Sam",
"address": "1234 Fake St",
"city": "Fakeplace",
"country": "USA"
}
Thanks in advance!
Here's the link to the documentation which tells me that it should be as easy as them clicking on a link to verify the email.
https://docs.sendgrid.com/ui/sending-email/sender-verification
Then I'm not sure why when clicking on a link, it actually asks them to login to Sendgrid.

You are using old sendgrid sender identity API.
Pass the JSON payload like this.
{
"nickname": "jhon Doe",
"from" : {
"email": "example#example.com",
"name": "Jhon Doe"
},
"reply_to": {
"email": "example#example.com",
"name": "jhon Doe"
},
"address": "1234 Fake St.",
"city": "San Francisco",
"country": "United States",
"state": "CA",
"zip": "94105",
}
For more detail follow this following link.
https://sendgrid.api-docs.io/v3.0/senders/create-a-sender-identity-1

Related

Sendgrid open tracking event webhook not firing after the email is opened

I am trying to track email "open" event on Sendgrid. I have enabled Open tracking in Tracking setting in my Sendgrid account. I have also enabled Event webhook under Mail settings->Event Settings and I have enabled event webhook for all the events.
When I send the email, I get the event webhook response for "processed" and "delivered" events but if I open the emails I don't get any webhook response. I tried opening the email in Outlook and in Gmail in chrome browser.
Is there anything else to be done that I am missing? Please help.
Below is the response I get for processed and delivered mails.
[
{
"OrderId": "5555",
"email": "myemail#gmail.com",
"event": "processed",
"send_at": 0,
"sg_event_id": "cHJvY2Vzc2VkLTE3NTE3NjIzLV9PbGs1ZWx4U1VHUUZSTUk3aVBlY0EtMA",
"sg_message_id": "_Olk5elxSUGQFRMI7iPecA.filterdrecv-p3iad2-865cf6bb5-sddvl-18-5F560026-42.0",
"smtp-id": "<_Olk5elxSUGQFRMI7iPecA#ismtpd0002p1lon1.sendgrid.net>",
"timestamp": 1599471654
},
{
"OrderId": "5555",
"email": "myemail#gmail.com",
"event": "delivered",
"ip": "167.89.12.138",
"response": "250 2.0.0 OK 1599471656 r7si5783789ejy.514 - gsmtp",
"sg_event_id": "ZGVsaXZlcmVkLTAtMTc1MTc2MjMtX09sazVlbHhTVUdRRlJNSTdpUGVjQS0w",
"sg_message_id": "_Olk5elxSUGQFRMI7iPecA.filterdrecv-p3iad2-865cf6bb5-sddvl-18-5F560026-42.0",
"smtp-id": "<_Olk5elxSUGQFRMI7iPecA#ismtpd0002p1lon1.sendgrid.net>",
"timestamp": 1599471656,
"tls": 1
}
]
First of all, check the settings
Next, check your setting for engagement data
Finally, check your mail clients are allowed to download images and have any extensions block ads or not
Sendgrid will add a transparent 1-pixel image at the bottom of email, if with any reason cannot load this picture, you won't receive opened event
I had the same problem, you need to go to settings-> tracking and make sure open and click events are enabled.

Using DirectLine v3, how do you send a message to the USER?

I'm implementing a DirectLine client for connecting WhatsApp via Twilio and the BotFramework. I've been able to:
Create conversations
Listen to the conversation's websocket
Send activities to the bot
For the life of me I cannot figure out how I can send an activity to the DirectLine client, so it can forward it to the user. In other words, how can I get some activity to pop-up on the DL client's websocket?
On the bot side, what I'm doing is:
Ask the client to create a conversation in DirectLine between the bot and the user (I'm using phone numbers as recipient/from IDs)
Use the new conversation and its serviceUrl to post an activity from the bot to the user
I've tried a bunch of different auth tokens to do this, the closest I've gotten was using the conversation's DirectLine token as a bearer auth:
POST https://directline.botframework.com/v3/directline/conversations/CONVERSATION_ID/activities
{
"type": "message",
"text": "message",
"from": { "id": "whatsapp:BOT_PHONE_NUMBER" },
"recipient": { "id": "whatsapp:USER_PHONE_NUMBER" }
}
Which results in this activity popping up in the websocket:
{
"channelId": "directline",
"conversation": {"id": "CONVERSATION_ID"},
"from": {"id": "whatsapp:BOT_PHONE_NUMBER"},
"id": "CONVERSATION_ID|0000006",
"recipient": {
"id": "BOT_ID#something",
"name": "Bot"
},
"serviceUrl": "https://directline.botframework.com/",
"text": "pls",
"timestamp": "2019-08-26T23:14:13.3099739Z",
"type": "message"
}
Which is obviously useless because the user's phone number is missing?! Instead the "recipient" was overwritten to the bot's.
My question is: What exactly is the canonical way to achieve this?
I can just bypass the BF altogether, call my client and have it send a message to the user. This means, however, that the implementation for this channel is different from all others. If this is the way to go, what's the point of the websockets then?

How to get first name of user using App_scoped_id in Graph Api 2.0

Is there any way to find user first name using app_scoped_id in Facebook Graph Api 2.0
currently i tried this
https://graph.facebook.com/app_scoped_id
i can retrieve profile pic using app_scoped_id but not name or other details.
I use first name to show in leader-board and the username in leader-board is app_scoped_id i get after Facebook Login, well i can save name to in leader-board using separator like:
<app_scoped_id>:<name>
but people usually change there name, So is there any way to get name.
If you call the below end-point using the App or User access token, you can see information about the user, including name, gender etc:
https://graph.facebook.com/{app-scoped-id}?access_token={app-access-token}
Which will return:
{
"id": "{app-scoped-id}",
"email": "email#domain.com",
"first_name": "John",
"gender": "male",
"last_name": "Doe",
"link": "https://www.facebook.com/app_scoped_user_id/{app-scoped-id}/",
"locale": "en_US",
"name": "John Doe"
}

Find Facebook UID of Social Graph Search Results

I am trying to get the Facebook UID's of results returned from a Social Graph search. For example, lets say I were to search "People who like surfing and live in Florida" I would then want to grab the Facebook UIDs of all of these search results.
I can do this one at a time by opening each person's profile and entering their profiles URL into a site like findmyfacebookid.com.
I am just hoping there is a quicker way to do this. Does anyone have any ideas on where I might start? Thank you all!
For getting userid's you may use graph API calls.There isnt any need for an external website.
Use this API request,
http://graph.facebook.com/{USERNAME} OR {USERID}
Eg: http://graph.facebook.com/mark
And you will get a result set of basic profile parameters in a JSON format.
{
"id": "4",
"name": "Mark Zuckerberg",
"first_name": "Mark",
"last_name": "Zuckerberg",
"link": "http://www.facebook.com/zuck",
"username": "zuck",
"gender": "male",
"locale": "en_US"
}

Facebook: Link Request's sender to it's recipient?

When using the requests dialog, facebook issues a notification like this:
What I'm looking to achieve is for the user to click the request link shown above and to present a "Random User invited you to..." message on our App.
However, when clicking that link Facebook doesn't seem to pass through the id of "Random User" to the App. The url accessed by the link looks something like:
http://apps.facebook.com/randomcomp/?fb_source=notification&request_ids=350578327437399,350578327437399&ref=notif&app_request_type=user_to_user&notif_t=app_request
which doesn't contain any reference to the user who initiated the request.
From the App's side, there doesn't seem to be a way to get this information from Facebook. Sure, you can get a list of requests, but that list can contain information for many requests, including requests from other users in addition to the one we're interested in, so it's not useful in this case. For example, here's a snapshot of data:
{
"data": [
{
"id": "340083146057323_100003817986566",
"application": {
"name": "Random Competition",
"namespace": "randomcomp",
"id": "350578327437399"
},
"to": {
"name": "Hannah Smith",
"id": "100003817986566"
},
"from": {
"name": "Random User",
"id": "100002286042525"
},
"data": "100002286042525",
"message": "Use the app!",
"created_time": "2012-05-14T13:26:30+0000"
}, {
"id": "358318457550141_100003817986566",
"application": {
"name": "Random Competition",
"namespace": "randomcomp",
"id": "350578327437399"
},
"to": {
"name": "Hannah Smith",
"id": "100003817986566"
},
"from": {
"name": "Jane Young",
"id": "100003771838663"
},
"data": "100002286042525",
"message": "Use the app!",
"created_time": "2012-05-14T10:54:25+0000"
}],
}
}
As you can see, the data is being passed in, but there's still no way to join the click from the link mentioned above (for Random User) to the correct request in the list; the link passes through the ID for both requests, not just the one for Random User, and while the link states "Random User" it doesn't pass through an identifier.
Am I missing something? Is there a mechanism that isn't in the docs that will allow me to pick-up the "Random User" id so I can provide a nice "Random User invited you to..." message in the App when they click through?
Edit:
Turns out that this isn't possible - see my answer.
You can add some data to the request so that when you process the request you can differentiate that from other requests.
The data can be sent with app requests and users requests and the parameter name is "data".
For example, in the guide for the Requests Dialog you can see it in the properties table at the (almost) end of the document, it says:
Optional, additional data you may pass for tracking. This will be
stored as part of the request objects created. The maximum length is
255 characters
There's also some info about it in the Social Channels documentation, and a sample of (php) usage in the official blog post about Upgrade to Requests 2.0.
I hope that this is what you're looking for.
Edit
When you send the request you know who is sending it right? It's the logged in user, and so you can put the user id/name/etc in the data parameter of the request.
Then, when someone clicks on a request, get the request by the id that facebook passes to you, and from the data extract the user id of the sender.
As the documentation states, you have 255 characters to use, and with that you can do what ever you want, you can even serialize an object to that parameter and deserialize it later.
As it turns out, this is in fact not possible at all.
The link, as shown in the image below, can present multiple users:
which is why multiple request IDs are passed in, and the sender's ID isn't.