gmailfilters
gmailfilters copied to clipboard
Improve credentials creation documentation
Hi! As we discussed on Twitter, I've been trying to use this tool but no matter what combination of things I click on the console for creating the credentials, I always end up with the following message:
parsing client secret file to config failed: oauth2/google: no credentials found
After enabling the Gmail API from the console, I click on Create Credentials and I'm being present with a form. First question is from where am I going to use the API:
Next question is whether I want to give access to User data or Application data, so I've chosen the latter:
Then I proceed to click on What credentials do I need? and I'm presented with the following:
Here is where it gets tricky, as none of the roles seem to match the Gmail labels notion that I was expecting. I've chosen different things but when the JSON file is downloaded and I pass it to gmailfilters
it always fails when parsing the file.
Thank you very much for your time and for all the great tools you've written so far!
Hey @inkel I was confused to, but managed to figure it out by performing the following
- Go to the Google API console Google Cloud Platform
- New Project Google Cloud Platform "Create"
- Make sure your new / current project is selected and go to API Library Gmail API Google Cloud Platform "Enable"
- Now to create credentials Google Cloud Platform , "Create credentials" , "Help me choose" , What API are you using? Gmail API Where will you be calling the API from? Other UI What data will you be accessing? User data "What credentials do I need?" Fill out relevant info to create OAuth client ID
- Download credentials and save it as credentials.json
Using the downloaded credentials.json should work with this gmailfilters project
I've been doing a little reading on this and I can't work it out. Is there a way to set the access permissions up using cross-account? i.e. I have my own personal Google account where I want to create the project with Gmail API access, but the gmail filters I want to push are for my work account in another org.
@alex-hofmann thank you so much! Sorry for the late response. Your instructions worked 💪
Can you help me as well? I'm really confused by all this, still a newbie.
I've tried to do it myself, created some OpenAuth file, it sort of authorized I guess, and then I was just stuck with an error "credentials can't be empty" or something like that.
I've deleted everything (the folder, I dunno how to uninstall properly with go). Then done everything to your instruction here, and now when I send C:\Users\satyr\go\src\github.com\jessfraz\gmailfilters>gmailfilters -f "C:\Users\satyr\go\src\github.com\jessfraz\gmailfilters\credentials.json"
it spits out:
must pass a path to a gmail filter configuration file