Identify User's Email Address From Gmail API Inbox Action - inbox

Is there a way to simply identify and return the user's email address from an INBOX ACTION.
E.G
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "ConfirmAction",
"name": "My Birthday Party",
... information about the event ...
"action": {
"#type": "RsvpAction",
"actionHandler": {
"#type": "HttpActionHandler",
"url": "https://mysite.com/rsvp?email_address=USERS'S EMAIL ADDRESS HERE",
"method": "POST",
"requiredProperty": "rsvpStatus",
}
}
}
</script>
All the users our organization use a Gmail Account so there is no need to generate an additional identifier in place of "email_address=USERS'S EMAIL ADDRESS HERE" shown in the link above since we already have their email addresses on file.
Thank you.

No, this isn't supported. You would either need to set that email address parameter when you send the email or use a limited-use access token as described here: https://developers.google.com/gmail/actions/actions/limited-use-access-tokens

Related

How to send a message to the user who logged in through the telegram in website?

How to send a message to the user who logged in through the telegram in website?
Telegram Login for Websites
Telegram bots are a powerful communication tool, but until today they
couldn't start a conversation. Even if you wanted them to reach out to
you, you had to chat them up first.
and
Bot API 3.6
Added the new field connected_website to Message. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the Login Widget and allows sending messages from your bot.
After login user,my bot can not send message with use user_id,Even the OnMessage event is not fired.
How start a conversation by bot?
Thankful.
You answered your question yourself here :
Added the new field connected_website to Message. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the Login Widget and allows sending messages from your bot.
More descriptions:
After the user logged in with telegram login widget,you should wait for an update event (assuming you'r using Webhook method for your telegram bot). the update body should be something like this:
{
"update_id": 290285,
"message": {
"message_id": 12,
"from": {
"id": 117854,
"is_bot": false,
"first_name": "",
"last_name": "",
"language_code": "fa"
},
"date": 1549829158,
"chat": {
"id": "you need this to start conversation",
"type": "private",
"first_name": "user_firstname",
"last_name": "user_last name"
},
"connected_website": "the domain mapped to your bot"
}
from the "connected_website" filled you can realize this is a user logged in for the first time and save the chat id to start next conversations in future.
PS : I wonder why there is no documentation about this at telegram or at least I didn't found anything.
In my case I did not receive an update event as a webhook, like Ali Titan described.
But instead chat_id came to custom onauth js funcion:
{
"id': 100102379,
"first_name": "Guido",
"last_name": "Van Rossum",
"username": "guido",
"auth_date": 1642941713,
"hash": "568a5665500a389a754a1c04348ea1c0434d4b507b1920f3ca1ff017a1c04341"
}
In this example id is exactly chat_id you are looking for.
In other words, if you want to provide it to your backend, you should write something like:
<script async src="https://telegram.org/js/telegram-widget.js?15" data-telegram-login="samplebot" data-size="large" data-onauth="onTelegramAuth(user)" data-request-access="write"></script>
<script type="text/javascript">
function onTelegramAuth(user) {
$.ajax({
url: '/telegram_widget/login/',
method: 'POST',
contentType: "application/json; charset=utf-8",
data: JSON.stringify(user),
});
}
</script>
And then use this id to communicate with your user.

Triggering smart campaign and getting 603

I am trying to use Marketo smart campaign to send email data.
What I do is:
1) get or create Lead with addresse email
2) trigger smart campaign I've created with this lead_id and a couple of tokens I created on the folder containing the campaign.
That is, I am sending POST to https://.mktorest.com/rest/v1/campaigns/5826/trigger.json?access_token= with body
{
"input": {
"leads": [
{
"id": 2034349
}
],
"tokens": [
{
"name": "{{my.subject}}",
"value": "subj"
},
{
"name": "{{my.message}}",
"value": "the text"
}
]
}
}
And I get the response:
{u'errors': [{u'message': u'Access denied', u'code': u'603'}], u'requestId': u'c8f5#14c79fae723', u'success': False}
I was trying token names without "{{" and "}}", without "my." - the same result. The campaign exist and has this ID.
What's wrong here?
The role of the Marketo API user that you're using needs the "Execute Campaign" permission, and your current user is probably missing that permission. Unfortunately you can't edit the existing role. You'll need to create a new role, check that permission, and possibly also create a new API User.

With PayPal REST SDK, how I can I get the buyer's country but not the entire address?

I'm using the PayPal REST SDK for payments, but since I'm selling digital goods, I don't need a shipping address, so for privacy reasons I don't want one.
However, it sounds like I need the billing country for Euro VAT purposes, and I don't know how to do that.
I've configured a payment experience using the following request:
{
"flow_config": {
"landing_page_type": "Billing"
},
"input_fields": {
"allow_note": false,
"no_shipping": 1
},
"name": "my name"
}
The no_shipping parameter is documented thus:
Determines whether or not PayPal displays shipping address fields on
the experience pages. Allowed values: 0, 1, or 2. When set to 0,
PayPal displays the shipping address on the PayPal pages. When set to
1, PayPal does not display shipping address fields whatsoever. When
set to 2, if you do not pass the shipping address, PayPal obtains it
from the buyer’s account profile. For digital goods, this field is
required, and you must set it to 1.
And preparing the payment:
{
"experience_profile_id": "XP-JVB9-FJ5Y-RMWS-ZCTS",
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
etc…
}
Executing the payment returns:
{
"create_time": "2015-02-05T08:24:53Z",
"id": "PAY-snip",
"intent": "sale",
"links": [
{
"href": "snip",
"method": "GET",
"rel": "self"
}
],
"payer": {
"payer_info": {
"email": "test#test.com",
"first_name": "Test",
"last_name": "Buyer",
"payer_id": "snip"
},
"payment_method": "paypal"
},
etc…
}
Which is great: no address… but also no country code.
I think PayPal is missing another value, which requests the country code but not the rest of the address…

LinkedinAPI: Get Phone Number from 1st Connection?

I've tried
https://api.linkedin.com/v1/people/~/connections:(id,first-name,last-name,phone-numbers)
but it's only get (id,first-name,last-name)
even this:
http://api.linkedin.com/v1/people/id=UserId:(phone-numbers)
Does LinkedIn expose this field ? I've google it, but not found somewhere ..
Linkedin Not provide phone numbers of connections. They only provide basic profile of connections.
check here https://developer.linkedin.com/documents/connections-api
LinkedIn will provide the phone number if the user authorizes r_contactinfo
Sample Request URL:
https://api.linkedin.com/v1/people/~:(id,phone-numbers)?format=json
Sample JSON Response:
{
"id": "ye3i9-_24l",
"phoneNumbers": {
"_total": 1,
"values": [
{
"phoneNumber": "89xx189198",
"phoneType": "mobile"
}
]
}
}
LinkedIn not provide phone number. Check this document for accessible fields of profile
Basic Profile Fields

How to "Add guest" to event via google calendar API?

could you please give me a hint on how to share a single event via google calendar api?
That is I'd like to invite other users to see the event programmatically without sharing the whole calendar. To mimic the "Add guests" UI action
As Claudio mentioned, you need to use the Google Calendar Advanced API for this.
You'll want to use a patch because you don't want to replace all the other data on the calendar invite. However, even in the case of patch, since the attendees lives in an array, if you attempt to pass a patch such as this:
{
attendees: [ { email: "new#example.com"} ]
}
... it'll replace all old invitees (i.e. it'll remove anyone that was on the invite before you called patch). To fix this, you must first get the current invitees, add a new person to the array, and then send a patch.
You can see a detailed example of this in this answer which also explains how to use Google Apps Scripting to ensure an email is sent to the user when adding them to a calendar event (see the addGuestAndSendEmail() method in that post).
You can use the API to add people to the attendees collection:
https://developers.google.com/google-apps/calendar/v3/reference/events/update
refer the following request.
method: POST
endpoint: https://www.googleapis.com/calendar/v3/calendars/primary/events?sendUpdates=all
here, sendUpdates means when you add any guest so he would get an invitation mail used based on scenario.
Input Json:
{
"kind": "calendar#event",
"etag": "etag",
"status": "confirmed",
"summary": "JayKara",
"description": "eqwbdjhwhhwhhwrhjehrhejhfj",
"location": "America",
"creator": {
"email": "#mail.com",
"self": true
},
"organizer": {
"email": "#mail.com",
"self": true
},
"start": {
"date": "2019-12-23"
},
"end": {
"date": "2019-12-24"
},
"originalStartTime": {
"date": "2019-12-24"
},
"visibility": "public",
"attendees": [
{
"email": "****#mail.com" //this guys are the guest
}
]
}.
After that there is no patch method required your guest guys will receive an invitation whenever update event
Cheers!

Resources