Google cloud Rest API to retrieve tenant id - google-cloud-platform

I have api_key for my project on google cloud and I am able to generate authorization code via client_id and subsequently auth token using authorization code.
What is the rest api code to retrieve tenant information ? Can anyone please put a curl command for that.

Have a look at the documentation about how to get tenants list using API; even more - yoo can test it yourself using the pane on the right.
Another piece of documentation you might be interested in to help you understand how this particular API works and what kind of reply you might expect.
More genral explanation of how to construct API's requests you can find here.

Related

Google API create new User

I'm using Zapier and try to create a new User in Google.
The documentation is pretty unclear.
This is the request I'm making:
Now I understand, that I need to add authorization to the request.
How do I authorize the request? I created an API Token in the Google Cloud but this doesn't work as a GET parameter.
Is the Request right? Do I have to change something?
Thank you for your help.
Posting DalmTo's comment for visibility.
This appears to be using the Directory Admin API for Workspace accounts. You can consult the Admin SDK: Directory API docs for this.
As it's creating Google Workspace users, you may want to try using a service account authorization.
For an example of an API request, selecting the necessary endpoint and method, e.g. asps.get, and use the API Explorer to test your requests.

google api key gets 401

I am trying to call some endpoints on google cloud build but I just get 401 and I am wondering how to fix this? In the end, I want to curl but if the website is not working, there is truly something wrong! Here is the picture
Only a group of API services/products on Google Cloud Platform support API keys without more authentication methods (OAuth). You can find these specific services here. In the same page that you posted, if you go down on the documentation there should be a "Authorization Scopes" section listing the required OAuth scopes that the API requires, if so, it means OAuth is needed in order to use the service.
I look at the Cloud Build Rest Api Doc and indeed I can see OAuth is required, in addition to not being listed here. You need to implement OAuth for this specific Service (Cloud Build API).

Google search Console API return 404

I would like to simply fetch some data from Google Search Console via API. I am struggling with Oauth2 for days but to be hones I don't really know what is it, and how it should be used. I don't really mind about security, it is not a super secret project, so I am trying to get some data with a simple API key, but it doesn't work neither. 
I have an API key what I generated in Google Cloud Console
I am trying to get data with Postman based on this example, but I always get 404 error. 
**Can you help me what do I wrong? It shouldn't be so complicated. **
You're using the wrong url; webmaster should be webmasters. See here
Additionally, once you solve that you will get a 401 using only an API token. You need to use OAuth. If you want this to run regularly, you can authorize it once with an account and use something called a refresh token.

How can I authenticate users via social account from mobile app using retrofit2?

I'm trying to connect my website's API and mobile app. I need to authenticate the user with google account but I don't know how to do it.
I created the backend with Django. And I set the endpoint as rest-auth/google/. On the restframework's page, it requires Access Token and Code but honestly I don't get how I can test if it actually works using actual google account.
I want to test from mobile app but I don't understand how and what I need to POST.
Anyone could give me tips?
I would recommend you to use a ready solution like "django-allauth".
If you want to do authentication yourself you might want to read Google's documentation about the topic:
https://developers.google.com/api-client-library/python/
In nutshell you create API credentials:
https://console.cloud.google.com/apis/credentials
Send a user to a link with specific parameters (api-credentials, scope, redirect link etc). Google client can help you to generate it.
A user will login in his account as he would normally do and will give your app permissions to use his information (or won't). After that he will be redirected to the link you specified with GET request with a code as a parameter (or error).
With help of Google client you can exchange the code on a token and then use that token to get information from his profile.

How to Follow Twitter Users by API in Coldfusion?

Oauth is pretty complicated but I think I got the authentication working. I got up to the point where I get the user to authorize on Twitter and I have the access token and access token secret. From here, I'm not sure how I use it to generate a request to follow a user.
I know that the url is: http://api.twitter.com/1/friendships/create.xml and that you can either pass in a user_id or screen_name
but does anyone have any example code in Coldfusion that I can see as to how the cfhttp call looks like with all the parameters?
Thanks in advance.
Try (monkeh)Tweet Twitter API. It supports most of the twitter API methods including follow a user. Easy & freaking cool CF open source by Matt Gifford