I want to create Python project to get data from Google Analytics from a certain page.
I have created new project in Google Console (console.google.developers.com) and got my OAuth 2.0 credentians in JSON format. I'm loosely following this tutorial: Python QuickStart.
I already got redirected to OAuth and selected my account but the script is getting
"User does not have sufficient permissions for this profile".
Will adding access to my user in Google Analytics be enough?
And how to run this project from shell on a remote server? I will not have the ability to just open browser and select Google account in CLI...
"User does not have sufficient permissions for this profile".
The user you are authencating with does not have access to the google analytics account you are trying to access. this would be the profile id that you are using in your code.
make sure that you are authencting your appliction using the same user you are using to log into google analytics
double check the profile id that you are using in your code.
Related
I am trying this quickstart.py example given on the page: https://developers.google.com/sheets/api/quickstart/python
I have created these credantials:
I have credentials.json in the same location as quickstart.py
when I run the command python quickstart.py I get this authorisation access error.
How can I fix this Authroisation error?
The issue you are having is that you created the client credentials json on one user's account. Yet you are authorizing the application from another user.
Because your application is still in test and has not been verified yet you need to add each user as a test user over in the google developer console.
Under the Oauth screen simply add the user:
Note: you can only have 100 test users and you can not remove someone once they have been added.
I am attempting to programmatically create federated user account and setup that user account using automation.
The reason for this is because we would want to create customized user environments (by logging in the user).
By Default when a domain is federated at IBM, the user account at that domain is not created, the user has to login for the account to be created. See notes from Documentation:
I want to have the user created so automation scripts can provision services and resource using Schematics SDK (Workspace)
I found that the user can be logged in and trigger account creation by using CLI
https://cloud.ibm.com/docs/account?topic=account-federated_id
The program is that when using CLI, it prompts for a one-time code for SSO logins (federated)
It says to avoid the one-time codes for automation scripts, you have to use API key
https://cloud.ibm.com/docs/account?topic=account-federated_id#api_key
However you can only get the API key after the user has been created. Which brings me to this question.. how do we get the API key before getting the user logged, is there a way programmatically or what have others done in python to get around this one-time token prompt to log in the federated user so that their environment and account is created for schematics and other automation scripts to deploy instances etc.?
I've been using GCP for some time.
I created a new GCP Project to test new functions, and enabled the Runtime API.
However, clicking Deploy pops up this message:
"User does not have the 'iam.serviceAccounts.actAs' permission on webcalc-taskc2#appspot.gserviceaccount.com required to create the function. You can fix this by running gcloud iam service-accounts add-iam-policy-binding webcalc-taskc2#appspot.gserviceaccount.com --member=user: --role=roles/iam.serviceAccountUser"
I entered this into Shell, replacing with my Owner email for GCP. Still no luck ;(
You have to add permissions that can use service account to your account.
According to Google document, A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs.
Seems that "webcalc-taskc2#appspot.gserviceaccount.com" is your service account runs cloud function.
The pop up message you received said that a user account running cloud function does not have 'iam.serviceAccounts.actAs' permission on that service account.
So you have to entered command in the message with replaced --member=user to --member=user:Your account email.
You can check your cloud function service account at details -> General information tab.
Dear stackoverflow community, i'am currently developing a plugin with Python which extract data (payload) about developers activity on repositories (push, pull requests) from bitbucket using webhooks. In my python script , i am trying to access to the patch and diffstat url's (Bitbucket API) content to extract data about files changes.
here example of the url's:
https://api.bitbucket.org/2.0/repositories/username/projectname/patch/cac0848613fea833316fcf7d87da9f80a5a2174e
https://api.bitbucket.org/2.0/repositories/username/projectname/diffstat/c6899a0a271db82790bf57de35dbbafb099417e4
But when the repository is private i cant access to the content of these web pages. If in the owner change private to public everything is okey but he can't change it for privacy so my question is how can access to these url's in my python script using the authentication? How can i authenticate via the script python knowing that i have write access on the repository?
thank you,
You probably need a token. From the bitbucket docs
Creating personal access tokens
To create a personal access token:
Go to Profile picture > Manage account > Personal access tokens.
Click Create a token.
Set the token name, permissions, and expiry.
I have a simple need. Query the GA data of my company, wrangle then and seed them in a DB.
I wanted to write a python script to do so an and found out google
Hello Analytics API: Python quickstart for service accounts.
I follow every step but the google console seems pretty confusing for me.
I ended up having a .json file as asked but I'm getting this error with google script : googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/analytics/v3/management/accounts?alt=json returned "User does not have any Google Analytics account.">
Can someone lead me how to get the right authorization to make it work ?
EDIT : Just find out this tutorial... what's the differents between the 2 ?
User does not have any Google Analytics account.
Means that the user you are using the authenticate your application with does not have access to the google analytics account you are trying to request data from. Make sure that you are requesting a profile_id that the user has access to.
As you are using a service account i suspect that you forgot this step in the tutorial
You ned to give your service account access before its going to be able to access the data.