zapier and google firebase integration to send emails - firebase

I have a zapier account and I want to use zapier to send an email every time a new document is added to the emails collection. I am currently trying to set it up but I am running into an issue where the trigger setup is not correct or the account is not recognizing when a new document is added. It is not seeing the document that I created while setting up the zapier.
here is my firebase:
Here is the zapier account:
This is what I am getting when testing:

Your code isn't working because there is no field called createTime inside the document. The field that contains the timestamp is called timestamp. So your query should look like this:
"orderBy": [{
"field": {
"fieldPath": "timestamp"
},
"direction": "DESCENDING"
}]

Related

Google Calendar API - Clear all events

I'm trying to clear all the events of a google calendar using the calendar ID.
https://developers.google.com/resources/api-libraries/documentation/calendar/v3/python/latest/calendar_v3.calendars.html#clear
Attempting it, gives a "400 Bad Request" response from either Python or a simple curl call using the Google API Explorer:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Value"
}
],
"code": 400,
"message": "Invalid Value"
}
}
From either the API explorer or the python API I'm providing only the calendar ID of the corresponding (non-primary) calendar I want to delete.
In Python:
service.calendars().clear(calendarId=<calid-found-in-calendarList().list()>).execute()
Which returns:
<HttpError 400 when requesting https://www.googleapis.com/calendar/v3/calendars/<calendar-id>4%40group.calendar.google.com/clear? returned "Invalid Value". Details: "[{'domain': 'global', 'reason': 'invalid', 'message': 'Invalid Value'}]">
Any idea what I'm doing wrong?
When I had tested the clear method of Calendars in Calendar API v3 before, I had experienced the same situation with you. When I used the value of primary, no error occurs. All events of the primary calendar are deleted. But, when I used the calendar ID except for the primary calendar, the same issue occurred.
When I saw the official document, it says Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.. But about calendarId in this method, it also says Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword..
These documents consuse me. So, I checked this "clear" method at Discovery API. Ref It says as follows.
"clear": {
"parameters": {
"calendarId": {
"location": "path",
"required": true,
"type": "string",
"description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword."
}
},
"scopes": [
"https://www.googleapis.com/auth/calendar"
],
"httpMethod": "POST",
"id": "calendar.calendars.clear",
"description": "Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.",
"parameterOrder": [
"calendarId"
],
"path": "calendars/{calendarId}/clear"
},
From above document, I thought that the calendar ID can be retrieved by the calendarList.list method. But, this "clear" method might not be able to be used for the calendar except for the primary calendar.
And, when I saw the error message, when the calendar ID like ####group.calendar.google.com is used, the error of "message": "Invalid Value" occurs. But, when sample is used as the calendar ID, "message": "Not Found" is returned. It seems that the API might search the calendar. In this case, even when the URL encoding is used, the same issue occurs. From this situation, I thought that this might be a bug.
But, I'm not sure whether this is the current specification or a bug. So, I searched this situation at the issue tracker. But, unfortunately, I couldn't find the same issue. So how about reporting this at the Google issue tracker? Ref
Reference:
Calendars: clear
Something to add to this when I encountered the same issue. Seeing that clearing secondary calendars of events is not currently an option, you can outright delete the calendar and re-create it however, the downside to this is the change in the calendar id on re-creation.
Delete calendar documentation
Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.

Linkedin Ads Reporting returning empty 'elements' array for a given campaign

I am trying to get some information about a specific LinkedIn campaign, but I'm getting an empty 'elements' array as response.
The catch is that the campaign has zero in all metrics when looking on the Campaign Manager. I think it was never actually veiculated, because even the cost is zero (and the status is COMPLETED).
My doubt is: should the array actually be empty, or be filled with zero on the values of the metrics and I'm messing up the requests?
This is what I'm doing:
First a GET request to see all campaigns that are associated with that Token:
GET https://api.linkedin.com/v2/adCampaignsV2?q=search
and this a part of the response:
...
"costType": "CPC",
"name": "Posts",
"offsiteDeliveryEnabled": true
"id": 128237464,
...
Then another GET request to see the info about that campaign:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&pivot=CAMPAIGN&dateRange.start.day=25&dateRange.start.month=6&dateRange.start.year=2019&timeGranularity=MONTHLY&campaigns[0]=urn:li:sponsoredCampaign:128237464
But this is the response:
{
"elements": [],
"paging": {
"count": 10,
"start": 0,
"links": []
}
}
My app has the r_ads_reporting permission and Development tier on the Marketing Developer Platform.
I've also manually added the account ID of that company on the MDP Settings.
The problem was in the campaigns I used. After this I tested with some campaigns that had real ads and I got the expected response

How can I access Firestore database via http-get restful API?

I've created an cloud firebase type database in firebase. Plz have a look at the image below. But How to access the datas from API(get)? If I use real time database, simply 'https://[PROJECT_ID].firebaseio.com/users/jack/name.json' this url gives the json data. But using cloud firebase database, I'm unable to get json data. I've tried to use "https://firestore.googleapis.com/v1beta1/EmployeeApp/name=employeeapp-66646/newsFeed/" but it doesn't work.
Here is an example of a URL for one of my databases:
https://firestore.googleapis.com/v1beta1/projects/project-8080059325282098184/databases/(default)/documents/52679469/docid
An explanation of the variable parts in here:
project-8080059325282098184 is my project ID.
(default) is the name of the database. At the moment you can't specify a name for your database, so yours will be (default) too.
52679469 is the name of my collection.
docid is the name of my document
The JSON I get back:
{
"name": "projects/project-8080059325282098184/databases/(default)/documents/52679469/docid",
"fields": {
"field1": {
"stringValue": "value1"
}
},
"createTime": "2018-10-06T14:16:24.090837Z",
"updateTime": "2018-10-06T14:16:24.090837Z"
}
In this response:
name is the full path of this document.
fields is the data of the document.
createTime and updateTime are the metadata for the document.
The following URL will do the trick:
https://firestore.googleapis.com/v1beta1/projects/employeeapp-66646/databases/(default)/documents/newsFeed
Have a look at the doc here, for detail on how to build the URL.

Restore missing or deleted calendar

Working with one of my Google Apps users and a shared calendar he create suddenly disappeared. It was hidden (first thing we checked), but just gone. It is a number of steps to delete a calendar (for safety reasons) and it was certainly not deleted in this fashion.
Using the Google APIs Explorer for Calendar API v3 we do see a deleted calendar using calendar.calendarList.list when showDeleted is true. If we highlight that item in the JSON response the dropdown arrow on the top right of the item shows it can be used in calendar.calendarList.patch. Trying to remove the "deleted" flag results in a 404 resource not found. Copied the calendarId from the Patch JSON body up to the calendarId box, fields editor to show most all fields. Trying the same for calendar.calendars.patch we get the same result.
The OAuth scope is https://www.googleapis.com/auth/calendar. JSON body is
{
"kind": "calendar#calendarListEntry",
"etag": "\"XXXXXXXXXXXXXXXX\"",
"id": "XXXXXXXXXXXXXXXXXXXXXXXX#group.calendar.google.com",
"defaultReminders": [
],
"deleted": false
}
If a calendar is deleted from the CalendarList but you still know the id, you can add it back to the list with the insert endpoint.

Event attendee ID missing on Google Calendar Events list response

The Google Calendar specifies that it will return an array of Event resources that will also include:
attendees[].id (string) The attendee's Profile ID, if available. It
corresponds to theid field in the People collection of the Google+ API
However, when I invoke the Events:list API it returns me an attendee with the following properties only:
{
"email": "attendee.address#gmail.com",
"displayName": "Attendee Name",
"responseStatus": "accepted"
}
I would like to fetch more information (and namely the user avatar) for this user/attendee by invoking the Google+ API, however, without an ID I can't do much.
The endpoint that I am using to fetch events is https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events?${params} which I confirm is the latest API version.
Any thoughts on this issue would be much welcome!

Resources