Search This Blog

Showing posts with label google. Show all posts
Showing posts with label google. Show all posts

Friday, January 7, 2022

Google sheets api - [The caller does not have permission] - shared sheets

In case you cant access to shared sheets via your code.

make sure to create a service account , copy the "email" for this service account.

make sure the one who shared the file, share it with your service account email.

and it should work.


working with API_KEY on shared sheets get failure.

only service account.


access to your own sheets could be done via api_key or service account.

links:

https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web-applications-aspnet-mvc

https://cloud.google.com/docs/authentication/production

https://developers.google.com/sheets/api/quickstart/dotnet

        https://ios.developreference.com/article/10721497/Using+.Net+to+access+Google+Sheets+with+a+service+account+generates+a+%E2%80%9CThe+caller+does+not+have+permission+%5B403%5D%E2%80%9D+error

  

Enjoy 

Yaniv 

Sunday, June 23, 2019

gcloud deploy to appengine

very easy way to deploy nodejs app on google engine.

create your index.js file
create your app.yaml file
app.yaml should contains only one line , in my easy test.
runtime: nodejs10


on the same folder i run the next command

gcloud init
 gcloud projects create yaniv2cappengine
gcloud app create --project=yaniv2cappengine
gcloud config set project yaniv2cappengine
 gcloud app deploy

that all - enjoy
Yaniv Tzanany

Friday, October 6, 2017

Google Speech API

Great service from google to transcript sound into text.
an easy way to use curl command below.

open command shell (cmd on windows)
set your google  API_KEY

set API_KEY=xxxxxxxxxxxx-xxxxxxxxxx

request.json file should contains such data
{
  "config": {
      "encoding":"FLAC",
      "sampleRateHertz": 16000,
      "languageCode": "en-US",
      "enableWordTimeOffsets": false
  },
  "audio": {
      "uri":"gs://cloud-samples-tests/speech/brooklyn.flac"
  }
}
run the command to get response

curl -s -X POST -H "Content-Type: application/json" --data-binary @request.json "https://speech.googleapis.com/v1/speech:recognize?key=%API_KEY%"

for long file (above 1 minute )use such command
curl -s -X POST -H "Content-Type: application/json" --data-binary @request.json "https://speech.googleapis.com/v1/speech:longrunningrecognize?key=%API_KEY%"

you will get response such as
{
  "name": "9111777455024812345"
}

use the name value to get result of the long process

curl -s -X GET  "https://speech.googleapis.com/v1/operations/9111777455024812345?key=%API_KEY%"


more info :
https://cloud.google.com/speech/docs/getting-started
https://codelabs.developers.google.com/codelabs/cloud-speech-intro/index.html#0


Wednesday, July 19, 2017

My Google Interview Question

i add a chance to start interview process via google as Sales Engineer for GCP.
here are some question i have been asked:


  • 3 products you want to change - (my answer ,  cloud  ,  gmail ,  chrome)
  • 50,000 are using your (Freemium ) free service  - 10% conversion rate  how to increase conversion rate?   (my answer ,     give a service from vip , analyze results ..etc)
  • china - google want a data center - recommend to buy or hired , where why ? etc (my answer government will give you - to follow the rules, buy , cold place next to border)
  • open source - is it good or not ? and why ? 
  • build like youtube system 
  • no sql db such as mongodb - what benefit? 
  • how would you convinced CIO to choose gcp instead of aws?
  • how you publish new like youtube version - zero down time 

some tech question as well , good luck to all
Yaniv tzanany

Saturday, February 13, 2016

gmail smtp access from shared hosting

i get error in my code
"The SMTP server requires a secure connection or the client was not authenticated"
i used valid uid  and password for gmail account + SSL enabled   but still get it.

so i figure out that there is two secire links i needed to use:

enable Less Secure app 

and accout access enebled 

and its worked.

enjoy
yaniv tzanany