I`m working on application which prviding clients to use calendar and creating some events there (I mean calendar in my app). Some of clients are have more than 1000 events in calendar and I want to start using Google Calendar . But I cant find any way to send multiple events in Google Calendar by 1 request.
Question: Is it possible to send few events in 1 request by using php-sdk, which google provides or by any other way such a http request?
Upd: I saw batch requests in google calendar docs, but Im not sure that its working now and how do I need to use it
Thanks!
The method you would be using is events.insert this method Creates an event as in singular there is no way to send a request that would send more than one.
You could use batching but all batching really is is sending X number of event.inserts in a single batch request. Its not going to save you on quota the quota cost will be the same the only thing it will save you on is on the number of HTTP calls you are making.
Global HTTP Batch Endpoints (www.googleapis.com/batch) will cease to work on August 12, 2020 as announced on the Google Developers blog. For instructions on transitioning services to use API-specific HTTP Batch Endpoints (www.googleapis.com/batch/api/version), refer to the blog post.
The above statment does not mean that batching doesnt work. It just means that the old batching endpoint which worled for every API no longer works now you need to send batching requests to each api
www.googleapis.com/batch/drive/v3
www.googleapis.com/batch/calendar/v3
you used to be able to send all batching requests no matter what api you were working with to
www.googleapis.com/batch
That no longer works.
Related
Using Google APIv3 I wish to synchronize my PHP webapp calendar with Google Calendar by creating a notification channel using a webhook on my server. As per the documentation of Google I did the necessary preparations (defining and validating webhook, creating the notification channel) in order to receive status update information from the Calendar using the watch method.
My issue is that I cannot figure out what to do with the incoming information - as per my understanding and as stated in these docs, my webhook should be notified not only about the fact of change, but it should get the actual change as well so I can avoid unnecessary processing. Unfortunately, the know-how on receiving these notification are quite vague and I cannot find where to look for the nature of change made to the Calendar resource.
Am I missing something? Do I have to get the resource using the identifier returned to the webhook and "manually" check differences or there is some technique I can use to update (or even more preferred patch, but I also do not understand how to do that in PHP) the changed Calendar resource on my webapp side? Is PHP even a suitable language to implement this?
I want to use the new FCM HTTP v1 API, which is documented here
FCM HTTP v1 API Documentation, to send a notification to multiple devices at once, but without using topics, or groups (let's say I want to send a notification to 10 random winners of some lottery). I know that in the previous version (Legacy FCM HTTP Protocol), this was possible by using the registration_ids parameter, but I don't see anything similar in the current API. Am I missing something? Is there a way to do this without using the legacy API?
There is currently no other way to send to multiple tokens besides using topics for FCM v1.
In your mentioned use case, if I'm using v1, I would probably go at something like, after selecting the winning tokens, you subscribe them to a topic like winningTokens<date_here> then send the message.
For other use cases, the best way to send to multiple devices via v1 API depends on your application. For example, the accepted answer would not be a good solution for a private chat application where another user can guess the topic name and evesdrop on the conversation by subscribing to the topic. In that scenario iterating over the device list and making multiple send calls to a single device would be better.
I am working with Twitter REST API [PHP] for a month. Now I try STREAMING API because REST API has several downsides.
I use fennb/phirehose to work with Streaming API.
But after several trial and error, I realise that I can't got past/previous tweets using Streaming API.
I run the script
I post tweet
console/cmd will catch my tweet immediately
I stop the script
I post tweet
I run the script
console not return any result.
The problem is, in programming and server, sometimes shit happen. Let's call it server down or lost internet connection. I will never get all previous tweet which posted when my server down. (I have 40 search term and more later).
So. i wanna ask:
Can we get previous tweet using Streaming API?
How to prevent/solve this case (console throw error, server restart, internet down, etc)?
Twitter's basic streaming API is realtime and about 1% of the actual firehouse of Tweets. You cannot retrieve older Tweets via the stream, and would need to fallback to the basic REST API to check for anything missed in the event of disconnection.
Twitter's enterprise data APIs include historical PowerTrack which can let you get older Tweets, as well as a replay capability in the event of disconnection, but these APIs are commercial.
I need to push offline transactions to Google Analytics.
I am thinking of creating a php script that queries the ecommerce database looking at transactions made in the last hour created from the backend. Having identified these transactions (and line items/SKU's).
How do I use PHP to push data to Google Analytics?
You need to go though the measurement protocol. There is no client library to help you do this in PHP you will have to code it yourself. That being said its not that hard its just a normal HTTP Post or HTTP Get request. The trick is building up your requests correctly.
A couple of quick tips.
Qt stands for que time and will allow you to set the time that the hit arrived on your server. Note it must not be greater than four hours ago.
While you are testing this you can use the debug endpoint to validate your hits. The hits wont be sent to Google but it will tell you if they are valid or not.
Measurement Protocols as #DaImTo mentioned is the answer. make a try here replacing the UA Id -
https://ga-dev-tools.appspot.com/hit-builder/?v=1&tid=UA-XXXXX-Y&cid=555&t=transaction&ti=12345&ta=westernWear&tr=50.00&ts=32.00&tt=12.00&cu=EUR
You can use DIv tool to validate all your post requests.
(dont forget to enable - ecommerce from view settings in GA when testing on new account)
I am integrating the Twitch user account API into my platform and had a look through the API to see if there was a callback section of some sort to send an update to my server when a user starts streaming, but I can't seem to find any reference for one.
Is there currently any services that offer this sort of thing? If not, what would be the best way of running regular checks on all of my users in my Database to see when they are streaming, of course doing this alone would kill the server with database queries, so I'm stuck as to where to go now.
What I am looking to do is receive a callback and then create a post in a social feed that the user has started streaming.
Based on the discussions at the links below, the API doesn't support webhooks and won't anytime soon. Instead, they expect you to use polling. Basically you would set up a worker process that makes requests periodically, such as every five minutes, then creates appropriate social feed posts, etc. You can batch them together if you have a bunch of channels to check (exaple from from the github issue):
https://api.twitch.tv/kraken/streams?channel=riotgames,dota2ti,machinima,esltv_hearthstone
https://github.com/justintv/Twitch-API/issues/211
https://discuss.dev.twitch.tv/t/notifications-using-twitch-api-and-php/1009