Finding Gmail Snooze dates in API - google-apps-script

Is it possible to access the date of a Gmail snooze through the API? I came accross a hack in stackoverflow that allows users to search for which emails are snoozed via a secret label search “label:snoozed”, but lables dont normally have an associated date, especially one that will return to the inbox in the future.
Im trying to create a web routine that syncs a todo list with emails and want to the due date to automatically update with when the snoozed email will re-appear.
Is this possible with any API or developer resources google offers?

No, you can’t retrieve the date of a Gmail snooze using the API.
There is a Feature Request already reported for this behavior on Issue tracker:
https://issuetracker.google.com/issues/109952618
At the moment you can only list them and retrieve the messages that has this label ‘snoozed’ active on them:
GET https://www.googleapis.com/gmail/v1/users/me/messages?q=label%3Asnoozed

Related

Is there a way to automatically delete emails from a Google Workspace Google Groups?

I was wondering if there is a way to automatically (or on a trigger) delete emails from a Google Group.
I use a Collaborative Inbox Group for archiving automated emails.
I looked at the Google Apps Script overview for Google Groups, but I don't see anything. It only seems like you can do this from GmailApp...
I also read this thread from 2012 but nothing helpful there
Answer:
Programmatically this isn't possible.
More Information:
The GroupsApp class of Apps Script only has read methods available for use - there is not a way of executing any write data using the class - for example deletion of emails.
Emails are sent to everyone in the group when a post is made (as per subscription settings). If you want the Email to be deleted then as you have already pointed out, you will need to use GmailApp to delete it from the recipients' inboxes.
In short: All mailbox manipulation must be done using the Gmail API (or GmailApp).
Feature Request:
You can however let Google know that this is a feature that is important for access to their APIs, and that you would like to request they implement it.
Google's Issue Tracker is a place for developers to report issues and make feature requests for their development services, I'd urge you to make a feature request there. The best component to file this under would be the Admin SDK component, with the Feature Request template.

Send Google Pay request using Google Apps Script

I am trying to automate my monthly flow of doing some math and sending people Google Pay requests using Google Apps Script. Right now my script sends people email with what is due but I would like to also attach GPay request in the email or just send GPay request alone.
Background -
I receive an email from a phone service every month with the bill amount. I split that with a group of 4-5 people depending on their usage and any overages they may have. My script correctly finds out the email and parses to find out the total amount due and then also goes ahead and figures out who owes me how much. I pay the entire bill and then collect money from other people. In the end, the script sends each person an email with the amount they owe me each month.
Problem -
tbh, it is not a "problem" as such but this is an enhancement I would like to add. Gmail allows attaching Google Pay request in the email. (Please see screenshot). I would like to enhance my script so that I can attach such a Payment request in the email that this script sends out.
My question is if this is at all possible?
References
Google Apps Script
Google Apps Script Console
Google Pay API
For my use case, it does not have to be an email with Google Pay attachment. It can just be a Google Pay request.
Unfortunately the public Google Pay APIs aren't set up for this.
Unless you happen to also be registered as a merchant and are able receive payments I would avoid this.
If on the other hand you are an existing Google Pay merchant and you're interested in doing it for giggles, you could try the following:
Create a webpage that you can link to in your email
Have the webpage accept required query string parameters (like amount and description)
Render payment information (like amount and description) and integrate the Google Pay Button
Embed the link in your email
IMHO this isn't practical at all... it just depends on how desperate you are for giggle.

How can I retrieve a list of all users in Smooch

I see on Smooch there is a way to retrieve all messages for a given user, using GET /v1/appusers/{smoochId|userId}/messages but how can I get a list of all users (or, at least, all userIds) who are currently using my app. There doesn't seem to be an endpoint for that in the API. Is this possible?
Unfortunately, it's not possible at this point. However, you can subscribe to webhooks (listening for the message:appUser event) and keep track of your users yourself.
See https://docs.smooch.io/rest/#webhooks for the details about webhooks.

Google Form - collect username from multiple domain

I have two question as i am creating a form to collect some responses:
Q1:
When creating a form using app-script, how to default the date in the google form say, tomorrow's date ?
Q2:
I want to share the form to email addresses across various domains (hosted using gmail app) and want to collect the username in the response. The form is restricting me only to share and collect across a particular domain from which I have created.
Is there a way to configure with 'Require login to view this form' and 'Automatically collect respondent's email address'
I tried to search for the past 1 hour and couldn't get any useful result.
Q1: When creating a form using app-script, how to default the date in the google form say, tomorrow's date?
You can pre-populate the responses for a Google Form by generating a "pre-filled URL" for respondents to use to open the form. For example, if the link to the form is presented on a web page, the href could be formatted with tomorrow's date as the answer to one of the questions.
Q2: I want to share the form to email addresses across various domains (hosted using gmail app) and want to collect the username in the response. The form is restricting me only to share and collect across a particular domain from which I have created.
That seems to be a reasonable security restriction on Google's part. You could duplicate the form in each domain, and use back-end scripting to combine results.

Limit form responses to once per person....without login?

I am designing a test, I want people to only respond to test once, but without making them log in via Google. Is there any way I can retrieve IP addresses and/or use a cookie to limit their responses?
no, nonexof your wishes are possible currently with Google forms. in fact forms do not support running any code during form fill.
your only options are to either host the google form in your own domain and add custom javascript (not officially supported but google it) or to somehow filter out those responses later (onFormSubmit and such based on other unique data in form fields)