Does Facebook Messenger provides the timezone on the subscribed webhook? - facebook-messenger

I am creating a Chatbot where i would to like to show timing details in local timezone. Does Facebook Messenger provides the timezone on the subscribed webhook?

As you can see in the received message, the timezone isn't specified:
{
...
"timestamp":1458692752478,
...
}
But you can get the timezone of the user using the user profile:
{
...
"timezone": -7,
...
}
With that information, you get the real date depending on the user timezone.

Related

Customization of devloper portal to put api published time in overview of devprortal

This time should be shown in the developer portal overview.
Can it be done? if yes how?
There are some libraries you could use for example: moment js or date-fns
https://momentjs.com/docs/#/displaying/fromnow/
moment([2007, 0, 29]).fromNow(); // 4 years ago
https://date-fns.org/
formatDistance(subDays(new Date(), 3), new Date(), { addSuffix: true })// "3 days ago"
You'll have to do a UI customization to achieve this. createdTime and lastUpdatedTime are returned in the Publisher REST API response when getting an API. You have to check whether those are returned in the Devportal REST API response for getting an API. If those values are returned, you can use them directly to do the customization. Otherwise, it will not be possible.

How do I register a Go To Webinar attendee to a specific session using their API V2?

OK so...through a custom form, I am successfully registering attendees to Go To Webinar but am blocked if there are multiple sessions of the same webinar. Currently, I am returning scheduled sessions to populate our dropdown menu (response shown below) but am challenged with passing back sessionKey with the registration payload. Has anyone successfully done this? Help! I've also put in an inquiry with GTW so will let folks know what I hear if others are struggling with this also. Thanks!
[{
webinarKey: xxxxxxxxxxxxxxxxx,
registrantsAttended: 0,
webinarID: "xxxxxxx",
sessionKey: 666666,
startTime: "2020-05-06T19:27:54Z",
endTime: "2020-05-06T20:01:13Z"
},
{
webinarKey: xxxxxxxxxxxxxxxxx,
registrantsAttended: 0,
webinarID: "xxxxxxx",
sessionKey: 777777,
startTime: "2020-05-07T19:26:08Z",
endTime: "2020-05-07T19:26:43Z"
}]
Populate a list for the webpage visitor using Scheduled
webinars
An interested individual selects a webinar from the list
and you submit their details using Create registrant
For step 2 you should also know the following:
To use the second version of the api you must pass the header value
'Accept: application/vnd.citrix.g2wapi-v1.1+json'
instead of 'Accept: application/json'.
Leaving this header out results in the first version of the API call.

How to Develop alexa to speak latest response again

In Details:
Example:
user:- asks About Cricket News.
Alexa:- Reads about the new.
If users says come again or replay
user: Come again.
Alexa: Must read it again what it spoke earlier.
How to handle this situation using webhooks.
Thanks in advance.
You can make use of sessionAttributes to keep track of the last response that Alexa spoke. Whenever you return a response just store the speech and re-prompt in sessionAttributes and whenever a ComeAgainIntent is triggered, take the value from the sessionAttributes and respond accordingly.
Ex:
...
"sessionAttributes": {
"lastResponse": {
"speech": "This was my last speech",
"reprompt": "This was my lst reprompt"
}
}
...
Every time before building the response store the response as lastSpeech in session attributes and write a comeAgainIntent or use amazon.REPEAT intent to repeat the response by getting lastSpeech from session attributes.

Salesforce Email Alert to Fire when Date = Today()

I'm having a tough time trying to get this email alert to fire. Correction, I can get it to fire, but not when I want. I have the following fields: Last Login and Last Login Target Date.
Use Case: I need to alert the account owner if a user hasn't logged into our app in 30 days. I query into our app database on a weekly basis to get the 'last login' dates for each account. I then data load the CSV into our every account's Last Login dates on the account object.
I have two workflow rules with one field update for one, and one email alert for the other
When Last Login is changed, Last Login Target Date is updated.
i.e. WFR: IF( ISCHANGED(Last_Login__c) , True, False) and Field Update: Last_Login__c + 30
When Last Login Target Date = Today, email acount owner.
i.e. WFR: IF(Today() = Last_Login_Target_Date__c , True, False) and email alert: 'Send Email to Account Owner'.
The idea is that if I keep uploading the same Last Login date via data loader, the Last Login Target date will stay the same until a different date in Last Login is updated.
However, today, when TODAY () did, in fact, equal Last Login Target Date no email alert went out.
I'm wondering why the workflow rule isn't firing when the WFR for the email alert is = TRUE.
Screen Shot for ref:
Any help would be greatly appreciated, and I'm happy to explain in more detail if needed.
Thanks!

How to create an event in a user's Google Calendar that can not be modified?

I want to create an event in a user's Google Calendar that can't be modified by that user.
In the following example, the API belongs to a#gmail.com, and is used to put an event in the calendar of b#occsn.com. To create an event that might be locked, I use the import interface from Google's API
start:
datetime: <date + time>
end:
datetime: <date + time>
summary: My Awesome Event
i_cal_uid: <random UUID>
organizer:
email: noreply#example.com # Non-existent address
display_name: MyAwesomeCompany
attendees:
-
email: <target calendar ID, e.g. user.com_q23rlj3we#group.calendar.google.com>
response_status: accepted
This creates an event on the user's calendar. If the user sees it in his calendar app (I use Fantastical), it can't be moved, but if user goes to Google Calendar's web site directly, the event can be moved, and it warns – only once – about "only moving it in Target Calendar" or something.
My question: Is it possible to create an event in the user's calendar that the user can not modify or move at all?

Resources