Is it possible to send email using the box-api v2? - box-api

Is it possible to send email messages to collaborators using the box v2 api? I usually do this through the web interface, but it would be nice to do it from the api.

It's not possible to send email messages to collaborators via the API.The closest you would be able to do this is by adding a comment to a file. An '#' comment, which is possible to do via the API, would ensure that an email notification is generated by Box to inform them of the comment.
Rory

Related

Can email be deleted from your users' Gmail inboxes programmatically via API?

The "Find and delete malicious emails" page in the Google Workspace Admin Help Center states:
Using the investigation tool, you can identify all users in your domain that have received the message (for example, a phishing email). You can then use the investigation tool to delete the email from your users' Gmail inboxes (note that log data might take up to a few minutes before being available in the investigation tool).
From this, I understand that, assuming you have the right package, it is possible to use the investigation tool to delete the unwanted email from your users' Gmail inboxes.
Can I delete emails from my users' Gmail inboxes via Google App Script using the API? If so, how can I do that?
Currently it is not possible with the Investigation tool
But there is already an existing feature request for exposing the Google Workspace Investigation Tool programmatically.
I recommend you to "star" it to show Google that more people are interested in this feature - hopefully this will accelerate the implementation.
UPDATE:
In th meantime you can use a workaround, e.g. using a service account with domain-wide delegation as suggested by #TheAddonDepot
It is possible via DwDg(domain-wide delegation)
You have to create a service account and delegate domain-wide authority to that service account with the appropriate scopes. There are no explicit instructions for the Gmail API but you can use this guide from the Admin Directory API documentation.
You then use the service account credentials with the GAS OAuth2 Library to make calls on behalf of your existing users to the Gmail API. Note that you can't use the built-in or advanced services for Gmail, you'll have to call out to the Gmail REST API directly via UrlFetchApp.

Send messages from google sheets (google apps script) to Microsoft Teams

I want to use Google Apps Script to send a message from Google Sheets to Microsoft Teams.
I know it is possible to send an e-mail to a channel, but I have no idea how to send a message.
To send a message to a Microsoft Team channel you need to know its email address, you can get it in the channel itself with More Options (⋯) 🠺 Get Email Address. Later, to send the message from Apps Script, you will need to use the .sendmail() method of the MailApp service. You can find the full options of the method and some examples in that documentation link. Also, keep in mind Microsoft Team channel limits (at the bottom of the page) to be sure about the message being delivered. Please, ask for more clarification if you need further help.
#Pierre W Please try using Connectors to send a message inside Microsoft Teams. However, connectors are built on Teams scope so you can send a message inside a team but not in 1:1 chat.

How to specify a read receipt for MailApp

I am using MailApp from Google Apps Script to send emails. When I send an email, I want to be able to track to see if the email was opened or not. This email account is a G Suite account and Email Read Receipts is set to "Allow email read receipts to be sent to any email address."
With MailApp, how do I specify to send the read receipt for the email?
I believe this is not possible with the MailApp class. The only option I thought it would be possible is by using the method sendEmail(recipient, subject, body, options). However, this method does not include any option to request for a read receipt as how you can see under the Advanced parameters explanation.
I also checked the GMAIL API service and there is no option to do this as well. The help center article here, explains this is available inside the gmail web UI and after several testing, I found out this is not possible via API.
In summary, by using apps script or the Gmail API is not possible to achieve this. The only thing that comes to my mind right now, is to implement a system in which you will include a unique image in the message and track for when the image is loaded. When the image is loaded, that means the message has been read. I have no idea how to implement such solution but I know is possible.

how do I retrieve a user_id in the v2 API?

I'm writing an app to add/remove collaborators to a particular folder. I need to only add collaborators that have setup their box account. I see that the v2 API allows me to specify "The ID of this user" (as opposed to their email address) - how can I get their ID? The v1 API has the get_user_id function - I don't see anything similar in the v2 docs...
There currently isn't an equivalent of get_user_id in the V2 API, so you'll have to resort to using email addresses. It should be noted that sending in an email of an unregistered user kicks off the registration process for the email address.

Can I access headers of all the emails sent within one "Google Apps" domain?

I would like to create a live visualization of all the mail communication happening within one "Google Apps" domain used in my organization.
Is there any API which I can use to get a live callbacks, or at least some API which I can pull periodically in order to get headers of all the emails sent within the organization?
Use the Email audit API:
http://code.google.com/googleapps/domain/audit/docs/1.0/audit_developers_guide_protocol.html
Please remember Email Audit API can be used only for lawful purposes in accordance with your Customer Agreement.
There is currently no other way to do what you need.