YouTube API key isn't working in Magento - youtube-api

I've created a project and got an API key for YouTube. I've added this in to Magento via Stores>Configuration>Catalog.
I've saved and refreshed the cache. However when I go to add a video on the product page I get the error Error: "Video cant be shown due to the following reason: Youtube API key is invalid"
I can't see why the API key would be invalid, anyone got any ideas?

I got around this when I figured out it was a scope issue (at least for the version I am using). I was unable to save the API key in the default scope, so I created a new row in core_config_data.
Basically, you need a row like this:
config_id|scope|scope_id|path|value|updated_at
xxx|default|0|catalog/product_video/youtube_api_key|xxyourkeygoesherexxx|yyyy-mm-dd

Related

Whatsapp Cloud - Product Catalog - Batch APIs not working

We need to create, update or delete product(s) from our catalog.
For doing this programatically we are following Meta's Product Catalog Batch API documentation in which there is an endpoint mentioned as "<product_catalog_id>/batch". We are trying to make request at this endpoint by passing the payload as mentioned in the official documentation.
But I am getting "403 forbidden" error every time. On digging deeper I found that the access token which is making this API call must have 2 permission i.e. "catalog_management" and "business_management".
I have checked the access permission for my access token and it indeed has there 2 permissions.
Can anybody please help here?
I am attaching some links below, which I am using to make the batch API calls for product catalogs.
Using this link to understand the API structure = https://developers.facebook.com/docs/marketing-api/catalog-batch/guides/send-item-updates/
Using this link to make the required payload = https://developers.facebook.com/docs/marketing-api/catalog-batch/reference/
I tried generating new access tokens 2 or 3 times. I also tried changing the payload to check whether the documentation may be outdated but nothing helped me to solve this issue.
I am expecting that the product catalog batch API works, so that we can update the products from our side.

HTTP 403 error when fetching data from Google Classroom API with Swift iOS

I made an iOS app (Swift) that signs in with Google, then fetches classroom data from the (Google Classroom API) https://developers.google.com/classroom. Everything was working correctly, and then some time later I think I accidentally deleted the Google Cloud project associated with it. So I had to re-create it and recreate an OAuth Client ID (I followed this guide on Google's website).
Now I'm getting an https status code 403 error - Permission Denied while trying to fetch classes, and I have no idea why. Does anyone know how to resolve this?
I believe the specific error (according to the Google Classroom API error section, linked above) is:
...but I'm very confused what to do to fix this.
One thing that is interesting is when I created an OAuth Client ID and downloaded the credential.plist (or credentials - can't remember) file and inserted it into the Xcode project, I get the same error as when the .plist file is not there. I'm wondering if I have it named something incorrectly? (Because before I had an entire GoogleService-Info.plist file since I had an associated Firebase project), but now that I don't need the firebase project anymore, I just have the credentials in the downloaded plist file which inherently is called credentials.plist.
Edit One strange thing is that I am only trying to read data, so I don't know why it's telling me I attempted to modify data.
If you are using some of the API to manage the classwork from the students with the Classroom API, you could be affected by this alert:
This could be interpreted in a way that, all the CourseWork that was managed by the previous Client ID is basically linked to that Client ID. This also has been discussed over the public issue tracker when it comes to Classwork created from the normal UI and how it can be managed:
https://issuetracker.google.com/issues/67748271#comment8
I would suggest to also share some feedback for this feature request so it gets the attention it needs. I notice that features like this for Classroom have been approved and implemented due to the high amount of users utilizing Classroom, generally it was previously limited however it has since been getting great support.

YBOSS search API

I am using YBOSS V2 search API and it worked fine till a few days back.
All of a sudden it is throwing below error
Valid AppID but requires registration
The URL is something like this
http://yboss.yahooapis.com/ysearch/web?format=json&market=en-us&q=%query%
I tried by creating a new APP, secret key and access key, but no luck
Any Ideas?

Setting up Google Calendar API

I'm trying to use the Google Calendar API in one of my projects. To do so, I need to set up OAuth access in the Google API console.
But when creating the consent-form (which is required to use OAuth), I get a meaningless error message:
The translation is as follows:
A problem occured. Please check your data and try again . If you have
not given any details, the problem may solve itself . In this case, we
recommend that you wait and try again later.
I have set the E-Mail address and project name. The optional fields were left blank.
So far I have not been able to solve the problem. I tried to wait for hours/days. I tried three different browsers. I also tried to contact Google support. All without success.
After days of trying, this is the solution:
Create another Google account
Using your old account, add the new account as an owner to your Google API project in the console
Log in with your new user account and accept the invitation
Create the OAuth consent form with the new user account
I have no idea WHY this worked, but it did.

Calling Google Places/Nearby API from inside an iOS App

I'm trying to call the Google Places API to return a list of restaurants near me. When I call this from a browser it works fine. However, when I call this from inside an iOS App I built using Ionic Framework, it fails with a data NULL, status 0 error.
I researched quite a bit, figured out this was a CORS issue. I looked up Google documentation on how to issue GET requests for iOS App. I used my app's bundle id to create a key and client ID for my app. Using the steps here https://developers.google.com/accounts/docs/OAuth2InstalledApp#overview, I obtained an access_token, which I used as a query parameter just like the docs mentioned. Nothing works. What is going wrong?
URL that works on browser: https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=MyServerApplicationsKey&location=33.85463,-84.35870&rankby=distance&types=restaurant
URL that fails from IOS App: https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=MyiOSApplicationsKey&location=33.85463,-84.35870&rankby=distance&types=restaurant&access_token=MyToken
#plexer
I use the server key to call the URL from the browser. That works, as mentioned. From the App if I use this key, I get the following error:
{"data":null,"status":0,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"sameUrlThatWorksOnBrowser","headers":{"Accept":"application/json, text/plain, /"}},"statusText":""}
The Google Places API uses a Public API Access key, rather than oAuth. The good news is that these are a lot simpler to get started with.
Follow the instructions under the Authentication section on this page to create a new Public API access key, then include that key in the &key parameter for your application.
After clicking the "Create new Key" button, select "Server key". That's a bit weird, since you are calling the API from iOS, but it will work.

Resources