How to get aliased emails from Google Calendar API - email

Using the Google Calendar API, I can get all the attendees of the events with GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId.
In my calendar event, I use an alias team#mycompany.com which sends emails to the entire team organization. Unfortunately, my calendar event returns the alias, and not the individual emails, like this:
"attendees": [
{
"email": "me#mycomapny.com",
"self": true,
"responseStatus": "accepted"
},
{
"email": "team#mycomapny.com", <-- Not what I want
"displayName": "My Entire Company",
"responseStatus": "needsAction"
},
],
How do I get the expanded list of attendees, like this:
"attendees": [
{
"email": "me#mycomapny.com",
"self": true,
"responseStatus": "accepted"
},
{
"email": "you#mycomapny.com", <-- expanded email list
"responseStatus": "needsAction"
},
{
"email": "someoneelse#mycomapny.com",
"responseStatus": "needsAction"
},
{
"email": "manager#mycomapny.com",
"responseStatus": "needsAction"
},
... etc
],

I use an alias team#mycompany.com which sends emails to the entire team organization.
If you are adding team#mycompany.com to the event then that is exactly what you are adding. Calendar has no way of knowing that email is a mailing list. If you want each person to be listed then you are going to have to add each person to the event. Google calendar can only return the information that you give it.
Answer: Don't use a mailing list when creating the event add each user. Otherwise Google calendar has no way of knowing this is a mailing list. As i see it google calendar is returning the correct data.

Related

how to generate multiple text fields based on a GET api and post it back

I have an endpoint that returns a list of questions. Each question has the following properties
Input field name eg: Select from the following list
Validation eg: IsRequired
controlType eg: (dropdown, text, image, file)
values eg (dart, javascript, python)
I want to build input forms on the fly on mobile when i get this endpoint. How do i go about this on flutter. I already have the api.
Think of it like a quiz app but with different controls. eg. dropdown, textfield, checkbox.
Here is an example of the api response
[
{
"question": "what is your name ?",
"cotrollType": "textField",
"values": [],
"validations": [
{
"validation": "IsRequired"
}
]
},
{
"question": "select from the dropdown:",
"cotrollType": "dropdown",
"values": ["one", "two", "three"],
"validations": [
{
"validation": "IsRequired"
}
]
},
]
yeah more code is needed but probably you could just use BloC to get the API response and create the Widgets there and then just emit them as new state, that way you can show some sort of progress indidcator in the meantime, also are you using some kind of model to parse the response and make it a bit easier?

what is the best model to save data on elasticsearch?

I have a rails application and use elastic search as a search engine in my rails app. this app collects data from the mobile application and could collect from any kind of mobile app. mobile app sends two types of data user profile details and user actions details. my app admins could search over this data with multiple conditions and operations and fetch the specific results and which are user profile details. after that my app admins could communicate with this profile, for example, send an email, SMS, or even chat online. In my case I have two options to save user data; first of all, I want to save user profiles details and user action details in a separate document with this structure profile doc:
POST profilee-2022-06-09/_doc
{
"profile": {
"app_id": "abbccddeeff",
"profile_id": "2faae1d6-5875-4b36-b119-74a14589c841",
"whatsapp_number": "whatsapp:+61478421940",
"phone": "+61478421940",
"email": "user#mail.com",
"first_name": "john",
"last_name": "doe"
}
}
user actions details:
POST events_app_id_2022-05-17/_doc
{
"app_id": "9vlgwrr6rg",
"event": "Email_Sign_Up",
"profile_id": "2faae1d6-5875-4b36-b119-74a14589c840",
"media": "x1z1",
"date_time": "2022-05-17T11:48:02.511Z",
"device_id": "2faae1d6-5875-4b36-b119-74a14589c840",
"lib": "android",
"lib_version": "1.0.0",
"os": "Android",
"os_version": "12",
"manufacturer": "Google",
"brand": "google",
"model": "sdk_gphone64_arm64",
"google_play_services": "available",
"screen_dpi": 440,
"screen_height": 2296,
"screen_width": 1080,
"app_version_string": "1.0",
"app_build_number": 1,
"has_nfc": false,
"has_telephone": true,
"carrier": "T-Mobile",
"wifi": true,
"bluetooth_version": "ble",
"session_id": "b1ad31ab-d440-435f-ac12-3d03c30ac44f",
"insert_id": "1e285b51-abcf-46ae-8359-9a9d58970cdf"
}
As I said before app admins search over this document to fetch specific profiles and use that result to communicate with them, in this case, the problem is the mobile user could create a profile and a few days or a few months later create some actions so user profile details and user action details are generated in different days so if app admins want to fetch specific result from this data and wrote some complex query I have at least two queries by application on my elastic search in my app it's impossible because each query must save for later use by admin, so As a result of business logic it's impossible to me, and I have to add in some case I need to implement join query that based on elastic search documentation It has cost so it's impossible In the second scenario I decided to save both user profile and action in one docs somethings like this:
POST profilee-2022-06-09/_doc
{
"profile": {
"app_id": "abbccddeeff",
"profile_id": "urm-2faae1d6-5875-4b36-b119-74a14589c841",
"whatsapp_number": "whatsapp:+61478421940",
"phone": "+61478421940",
"email": "user#mail.com",
"first_name": "john",
"last_name": "doe",
"events": [
{
"app_id": "abbccddeeff",
"event": "sign_in",
"profile_id": "urm-2faae1d6-5875-4b36-b119-74a14589c841",
"media": "x1z1",
"date_time": "2022-06-06T11:52:02.511Z"
},
{
"app_id": "abbccddeeff",
"event": "course_begin",
"profile_id": "urm-2faae1d6-5875-4b36-b119-74a14589c841",
"media": "x1z1",
"date_time": "2022-06-06T11:56:02.511Z"
},
{
"app_id": "abbccddeeff",
"event": "payment",
"profile_id": "urm-2faae1d6-5875-4b36-b119-74a14589c841",
"media": "x1z1",
"date_time": "2022-06-06T11:58:02.511Z"
}
]
}
}
In this case, In the same state, I have to do as same as I do in before and I have to generate a profile index per day and append user action to it, so It means I have to update continuously each day, assume I have 100,000 profile and each one have 50 actions it means 100,000 * 50 per day update that have severity on my server so still it's impossible. So Could you please help me what is the best model to save my data in elastic search based on my descriptions?
Update: Does elastic search useful for my requirements? If I switch to other databases like MongoDB or add Hadoop it be more useful in my case?

custom DevOps notification subscription via REST call

I would like to create an Azure DevOps notification subscription via REST call. The recipient email address needs to be passed in and not default to my own email address. The ultimate goal is to programmatically create subscriptions so that certain non-ADO users can be automatically alerted about the resolution of work items that are relevant to them.
Thanks!
custom DevOps notification subscription via REST call
To create the notification subscription, you could use this REST API Subscriptions - Create:
POST https://{service}.dev.azure.com/{organization}/_apis/notification/subscriptions?api-version=6.0
Sample Request body:
{
"description": "A new work item enters our area path",
"filter": {
"eventType": "ms.vss-work.workitem-changed-event",
"criteria": {
"clauses": [],
"groups": [],
"maxGroupLevel": 0
},
"type": "Expression"
},
"subscriber": {
"id": "xxxxxxd71-c2fef2ad085f"
},
"channel": {
"type": "EmailHtml",
"address": "myteam#fabrikam.org",
"useCustomAddress": true
}
}
Just set the the recipient email address in the "address": "xxxxx".
Note: You need provide the eventType and subscriber and so on.
My test result:

Actions on Google Smart Home Skill: Room Hint / Home Graph

The documentation at https://developers.google.com/actions/smarthome/create-app#actiondevicessync mentions that the roomHint field of the JSON response to the sync request can be used to have Google automatically assign devices to correct rooms.
However, no matter what I return in that field, the user still has to manually assign every device to a room and I cannot get Google to automatically recognize the correct room using this roomHint field
Here's an example response:
{
"requestId": "500166151965294748",
"payload": {
"devices": [
{
"id": "9",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff"
],
"name": {
"name": "Light"
},
"willReportState": false,
"roomHint": "Attic"
}
]
}
}
Right now supplying a value for the roomHint is not used by the HomeGraph to determine which room this device is in.

Mandrill sending to multiple people as separate message via the REST API

I'm trying to send out mails using mandrill. The problem is that when I add multiple recipients to the 'to' parameter, it sends out the same mail multiple times with ALL the recepients in the 'to' list. I was expecting the same mail to be sent out individually to every person in the to list. Am I missing something ?
{
"key": "app-key",
"template_name": "platform-invite",
"template_content": [
{
"name": "connection",
"content": "<a class=\"mcnButton \" title=\"Lets Go\" href=\"http://someurl\" target=\"_blank\" style=\"font-weight: normal;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;\">Lets go</a>"
},
{
"name": "mailbody",
"content": "<p>Hi </p>\n<p>I would like you to be a ... Tic tic tic...</p>"
}
],
"message": {
"subject": "My subject line over herer",
"from_email": "superman#mydomain.co",
"to": [
{
"email": "person1#gmail.com,
"type": "to"
},
{
"email": "person2#gmail.com",
"type": "to"
},
{
"email": "person3#gmail.com",
"type": "to"
},
{
"email": "person4#gmail.com",
"type": "to"
}
],
"merge_vars": {}
},
"async": false,
"ip_pool": "Main Pool"
}
There's an option in your Sending Options to expose recipients to one another. You can uncheck that box to not show everyone's information in the 'to' header. The option(s) you select in the Sending Options are used by default for your account. You can override any of these options in individual API calls. In this case, you could use the preserve_recipients parameter to override the current default that's set for your account.