Google calendar API calls blocked by captcha - asp.net

I have successfully written a tool to display upcoming calendar events on a website using Google's calendar API (v2). I am using the username/password method outlined at https://developers.google.com/google-apps/calendar/v2/developers_guide_dotnet#AuthClientLogin. Today an instance of this code would not return data or a decent error message. I finally logged into the web server and browsed directly to http://calendar.google.com and logged in using the credentials. I was challenged by Google's captcha and then my code worked.
How do I get around API calls being blocked by Google's captcha security? I don't want to have to re-code for magic cookies but I will if I have to. I have read some about generating tokens but I dont know if that is something I have to do once or every time the code is called.

If your app is a service that is getting used by many people, you might be running into API call bandwidth limitation. That is, google is limiting the number of API requests per time interval.
If this IS getting used by many people, you may have to upgrade to a paid account.

Related

How do you apply for a refresh token in the LinkedIn API?

We have a client application that runs on Windows that is used by thousands of users in the financial market in order to make analyses and charts. Since long we have an integration with Twitter where you can easily post a chart together with short text. Many users have asked us to implement a similar feature for LinkedIn since this is becoming increasingly popular among our users.
The API for sharing on LinkedIn works fine for us, but we need to refresh the access token every 60th day, which cannot be made completely seamless for the user. Since our application is not a web app, we need to launch a browser on order to refresh the access token and this is disruptive for the users.
The docs at Authorization Code Flow (3-legged OAuth) says that some selected partners can get refresh tokens as a complement to access tokens. That would be perfect for our integration. How can we become one of those "partners"? I have not found any information how to apply for this.
I have looked for a way to apply to become a partner that can get a refresh token, but failed to find any information.

Create a demo account that's usable with the Analytics Reporting API? [Google Analytics]

I need to test some things with a Google Analytics View, but the default demo account that Google offers does not allow user to use the Analytics Reporting API :
You cannot use the demo account with the Analytics Reporting API. Attempts to do so result in a permissions error: (403) insufficientPermissions.
Source
I just need to replicate a view with different data already.
Thanks for helping.
You cannot replicate views with data. A view will always start empty.
However you can simply register a Google Analytics account and send lots of bogus data (either by setting up a web page with tracking code and call it repeatedly, or set a cron job to fire call via the measurement protocol) (this will happen in realtime, so you need to wait a few days before you have enough useable data. There is not way to bulk-create hits for a longer timeframe).
If you just want to test the API it probably matter that much what data you use, so a mock account should work just fine.

Google Tag Manager and sending data offline

I have a question to the following case. We want to track a content platform using google tag manager. However, not every time the platform is online but GTM would send data to our internal server. Therefore our concern is if data collected during this offline period will be kept or if we loose them.
Do you know if there is some period during which data collected offline through Google Tag Manager is kept and once it gets online then it is sent to Google Analytics?
Thank you,
Lukas
No, that is not how Google Tag Manager works. GTM for web is basically a javascript injection engine. It bundles your configured tags,triggers and variables with a selector engine and injects that into your page. There is no serverside component that stores data.
I'm sure one could come up with a solution to your problem - e.g. store your data with localstorage in the browser, poll you server to see if it is available, and when it's online send the data with a queue time parameter to Google Analytics. However that has nothing to do with GTM.
Having said this, it is hard to understand your use case - if your server is offline, then where does the data come from ?
If you have an offline PWA app (with a Service Worker), you can use the Workbox Google Analytics module to handle the collection of data, and to report it upstream when your site comes back online.
This module has a service worker fetch handler that intercepts the calls that you would make with analytics.js or gtag.js, and stores your data locally in IndexDB in the event that the call fails because it is offline.

Get google analytics data when user is offline

I'm currently creating a tool to help me create google analytics daily reports easily. To do this, I need to access google analytics data at specific hours and days (for example, each day at 9am and 9pm), server side (PHP, Laravel).
The problem is that when I use the OAuth 2 authentication method, I need to re-login each time I want to access data (i need to redirect the user, and wait for redirection to get the code, and use it to get a token). I can use the "service account" method, but it implies to use a .p12 certificate, which is not sustainable in production (i can't ask my users to upload their certificates files).
Do you know a way, or have you an idea, to access analytics data without having to relogging (ideally with oauth...) or using service account method (with a certificate file) ?
Thank you

LinkedIn New API - Can't Get r_network Permission

I inherited a program that was written with the old LinkedIn API, and I'm trying to migrate it to the new API. When I try to get the r_basicprofile permission, my oauth token works. However, when I try r_network or rw_nus, I get a response
invalid scope -- your application has not been authorized for
r_network.
Yet, when I go to www.linkedin.com/developer/apps/xxxx/auth, the boxes for r_network and rw_nus are checked.
I.e., A request to
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_basicprofile&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz
works, but a request to
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_network&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz
gives that error. What am I doing wrong?
As of May 15,
After the grace period expires, several REST API endpoints will no longer be available for general use. The following endpoints are the only ones that will remain available for use:
Profile API — /v1/people/~ `
Share API — /v1/people/~/shares
Companies API — /v1/companies/{id}
If your application is currently using any other API services (e.g. Connections, Groups, People Search, Invitation, Job Search, etc.) you will have to apply to become a member of a relevant Partner Program that provides the necessary API access to continue to leverage any of the endpoints that are not listed above.
It looks like linkedin no longer wants to share anything with their API. Creating a new app indicates that the only possible options are r_basicprofile, r_emailaddress, rw_company_admin, and w_share:
TLDR: they have locked down the API and restricted the usage to an extremely limited set of access points.
I did some more digging. The linkedin website is misleading. On my app linkedin page, it says that I'm approved for rw_nus and r_network, but on this page
https://developer.linkedin.com/support/developer-program-transition
it says those are no longer approved.
So the app home page in linkedin incorrectly said I had those permissions.
Heres the link if you want to Apply for Linkedin
https://help.linkedin.com/app/ask/path/api-dvr

Resources