I want to use my app to link to Google action - google-home

How to call Google home action directly. I want to click the external connection to jump directly to action。emphasized text

You need to configure the deep link within your app to link to your Action's OAuth flow, as described in the docs.
Your link should be formatted similar to the following:
https://madeby.google.com/home-app/?deeplink=setup%2Fha_linking%3Fagent_id%3Dagent-id
The agent-id is returned in your SYNC response, and is typically your project ID in the Actions console (reference docs for SYNC response).

Related

How to get access_token for replying review in Play Developer API?

This link: Reply to Reviews describes the way to retrieve and reply to reviews. The Google Play Developer Reply to Reviews API allows us to view user feedback for our app and reply to this feedback. But I am finding it difficult to get the authorization token. It says I should have got this when I get access to the API.
But after going to the link, I didn't find too many information on this, rather, it has another link which takes me to the page where I have already created a service account.
After summarizing, my question is - I have created a service account and downloaded the key as JSON. But how to get this access_token the given snapshot asking for? The JSON file itself doesn't contain such access_token, rather it contains other information including type, project_id, private_key, client_id etc.
The process is not described directly in the link given in the question. Rather we will follow the steps mentioned in Play Developer API | Authorization
The whole process actually has two major steps:
Making a OAuth 2.0 client ID and downloading it.
Using client_id, client_secret and redirect_uris from this download JSON file to make API call.
Making OAuth 2.0 client ID and getting parameters
In order to do this:
Go to Google Play Console.
Use your play console account to login into it.
Make sure the right project is selected, at top there is a drop-down, where the correct project is supposed to be selected.
Now from + CREATE CREDENTIALS button create a OAuth Client ID and after successful creation you will find it listed under Credentials tab. The Credentials tab is at the left side of the page.
Now download the OAuth Client ID and it will be saved as a JSON file.
Open the JSON file and collect the client_id, client_secret and redirect_uris from there. Here redirect_uris will contain a list of URLs. One of them is http://localhost, we don't need it. Please take the other one, somewhat like urn:ietf:wg:oauth:2.0:oob.
Now the second step begins:
Make the API call
Now go to the first link I provided in the answer, i.e: Play Developer API | Authorization. We just did the first step under initial configuration. Now the second step begins. Make sure you are using the same browser where you are already logged-in on Google Play Console.
Now fill-up the fields in this link as mentioned in the documentation
with the information we just got (client_id, client_secret,
redirect_uris), remove the ... and put your redirect_uri and
client_id there:
https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher&response_type=code&access_type=offline&redirect_uri=...&client_id=...
Now after filling up your credentials in this link provided paste this link to browser and go to this URL.
This may require you to authorize this request by signing in with your account (with the Google Play Console Account we are using so far).
After authorization you will be given a code parameter similar to 4/eWdxD7b-YSQ5CNNb-c2iI83KQx19.wp619..... (This is also mentioned in the documentation you may follow the steps there).
Now go to the step 4 in the documentation (following is a snapshot):
replace the credentials which are here inside <..> (including < and >) with the information we so far collected. Here <the code from the previous step> is nothing but the code parameter 4/eWdxD7b-YSQ5CNNb-c2iI83KQx19.wp619.... we got.
Now make this API call. To make this kind of API calls you may need to use Bulk edit of Postman software (download and install the software). But if you are not comfortable with this Bulk edit, I am giving you a similar form data in the following snapshot. Just fill up the fields there in Postman and make the API call, (Please note that the method is selected POST):
Also you need not change the grant_type (its value is authorization_code).
Now clicking Send you should get the response which will contain access_token. Following is a snapshot of the response that comes with the access_token we are looking for (snapshot got from the documentation):
This response will come only once (for a certain code), to get another response you may need another code. So, save this response as a JSON from Postman to use it further.
Now you are done! Use this access_token and make API calls to get reply to reviews. More details here. Also please note that you might not get any reviews at all with this call, as this reviews' responses only work for recent time. If you make some recent comment in Play Store under your desired app they will be returned but the older comments will not be returned as response and the response might be blank {} if there are no recent comments. As mentioned in the documentation:
Note: You can retrieve only the reviews that users have created or modified within the last week. If you want to retrieve all reviews for your app since the beginning of time, you can download your reviews as a CSV file using the Google Play Console.

How to create Processer group in apache-nifi?

I want to create processer-group in Nifi.from somewhere I will get the tenant name Based on tenant I want to make processer-group, is it possible through programmatically? Please reply
As #daggett pointed out in the comments, the Apache NiFi REST API provides documentation on the expected input and response of every API method. To discover the correct method(s) to perform a task, it is often easiest to use the NiFi UI with your browser's developer tools open. The NiFi UI is a reference implementation of an API client, as all UI activities are performed using the API. Simply execute the desired task (i.e. drag a process group onto the canvas and enter a name) and watch the resulting requests fire in the developer tools window.

How do I register a Google cloud application?

In the Google plus Quick Start documentation:
Google Plus Quick Start Enable Google plus API
It states that a form needs to be filled out to register the app. But I can't find anything to click on to register the app. I'm wondering if the Google Console layout has changed, and the documentation hasn't been updated? I did a search on the word, "register" but didn't find anything.
The side bar on the left that I see has a list like this:
Overview
----------
APIs and auth
Credentials
Consent Screen
Push
That's what my Google Console screen looks like. I don't see any menu item for Register App
True, that part changed a bit. What you need to do now is to go to "Credentials" and create a new Client ID there. You will then find the necessary Client ID and Client secret listed on that page.

Create Docs through the Drive API with specific page setups (margins, orientation)

My app is already able to create Google Docs through the Drive API, and when doing so I can choose the title, data, and metadata. But I've been looking at the documentation and it seems there is no way to set some other properties of the Docs, such as the margins and the orientation (portrait or landscape) of the Docs being created. Is there a way to do so?
After not finding an answer in the documentation, the only thing I could think of was logging in with my Google Account, going to one of the created Docs, click on "Page setup", then select "Landscape", and finally "Set as default". I thought that by setting it as the default in my Google Account, it may happen that all the Docs created with it may be created as Landscapes. But it didn't work. A possible reason, however, is that the account actually creating the documents is a Service Account, not my regular Google Account. I guess both accounts, while being linked, are not the same thing, so the defaults of one don't apply to the other. Is there some way to set "Portrait" as the default orientation for the Docs created with my Service Account? If not, would the solution be to stop creating the Docs with my Service Account, and start creating them with my regular Google Account, so that the defaults I apply to them apply too to the newly created Docs?
Drive API doesn't support Docs related features for you to retrieve/set metadata about the documents.
Service accounts are individual Google accounts and no way related with your own user account. On the other hand, your default settings will only apply to you. You cant programatically set other user's defaults.
The best way I can think of, which is really a hack, is to make your own google docs API using headless chrome and pupeteer, which could be used only in part, and in connection with, the official docs API.
This is basically a web browser that runs on your server, which can be controlled to do anything a client would normally do on a web browser, like click buttons, submit forms, etc, only at the command of a server, which can be commanded through HTTP requests etc.
So after installing puppeteer, open the chromium browser, log into your google account, then open google drive with the server, and you should already be logged into the account. If not, you may have to log into the account using the server logic, which can get complicated with 2 step verification...
but anyway once you are logged into your google account on puppeteer, on drive.google.com, simply stay on that page and wait.
If the server receives some kind of HTTP request to make a new document, then have the server just literally click the new document button on the webpage, and it should open the new document in a new tab, which you should be able to access with puppeteer.
Then, when it is made, you can either just send the URL back to the request server, and / or make your page setup changes now, based on the data received in the HTTP request earlier.
For example, if, at one point (either after the document is created, or during its creation), there is some kind of message specifying the color of the background, just manually, on the server side, click File -> page setup, and select Custom, and, programmatically "type" the hex color code etc then click the OK button, then end the POST request.
If you have any questions, let me know
var doc = DocumentApp.getActiveDocument();
var body = doc.getBody();
//turn landscape if portrait
var oldHeight = body.getPageHeight();
if (oldHeight > body.getPageWidth()){
body.setPageHeight(body.getPageWidth());
body.setPageWidth(oldHeight);
}

how to call a Google API

I read the following two pages on Google:
1) https://developers.google.com/google-apps/documents-list/#getting_a_list_of_documents_and_files
and
2) https://developers.google.com/accounts/docs/OAuth2WebServer
I can go as far as getting an access_token (OAuth2) to be used in a subsequent Google API call (I want to call Google Docs Listing or Google Drive).
I wanted to use curl or something similar and just form my https URL.
- As such in the 1st document states to form a URL as follows:
https: //docs.google.com/feeds/default/private/full
- In the 2nd document, the example states to use something like https: //www.googleapis.com/oauth2/v1/userinfo?access_token=xxxxx
(adding the access token to the call)
Several questions
- Do I call googleapis.com or docs.google.com?
- can I call https: //docs.google.com/feeds/default/private/full?access_token=xxxxx
just add the access token to the call?
thanks
You need some effort to approach a Google API the first time, but then it's easy and elegant:
Manual preparation (One-time action): Sign in to Google, create a project, enable the API in question, create new Cient ID.
Get OAuth code, refresh token and access token (one-time action).
Make the API call (repetitive arbitrary actions).
Here is a detailed explanation of the entire process - Steps to make a Google API call.
A practical sample based on the Google Calendar API with full demo code in a single HTML file can also be reviewed here - Easy and compact access to my Google calendars.
The fastest way to get started is probably the quickstart guide for the Google Drive API, which shows how to setup your environment and write a complete command-line app to upload a file to Drive:
https://developers.google.com/drive/quickstart
Hie you can go through the Google Docs Sample Available Here
it's a command line smaple but this same thing you can implement in android. it works for me. you will find "docs-cmdline-sample" in repo. that will help you.

Resources