Google Plus Domains Api Activities: insert 403 Forbidden - google-api

I try to use insert activity request through this special form http://joxi.net/J2bykQQS4XYxXm
{
"object": {
"originalContent": "LaLALaLALa"
},
"access": {
"items": [
{
"type": "domain"
}
],
"domainRestricted": true
}
}
but always I have 403 error in answer. http://joxi.net/DrllG33c4vnb5r
I tried to use user_id instead me but had same results :(

Most likely, you are not doing this as part of a Google Domain. Now also known as "gsuite", this allows companies to be able to post messages that are visible to other members of the same company. This does not allow you to post messages that are available for most Google+ users to see.
There is no public API available from Google to let you post to the public Google+. There is an API available to select partners (such as HootSuite) which let them post to the public Google+, but they seem to be slow or reluctant to add additional partners.

Related

How can I disable waiting room in Google Meets created with calendar api?

In the Google Calendar api there's the ability to request that a conferencing link be created when an event is created.
My current setup is that I have an account that is creating google calendar events whenever someone schedules a meeting on my app. The problem is that when someone outside of my organization tries to join the meeting it says "ask to join" which isn't possible since nobody from my organization will be in the meeing. Are there are parameters to let me turn off the waiting room feature or at least have a list of approved emails that are allowed to enter the meeting. The request body looks like this right now:
{
"end": {
"dateTime": "2020-08-30T05:27:35.206Z"
},
"start": {
"dateTime": "2020-08-29T05:27:35.206Z"
},
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "12345"
}
},
"summary": "Test event with meets 2",
"attendees": [
{
"email": "****#gmail.com"
}
]
}
The attendee I added still has to request to join the meeting.
This appears to be a bug!
I have taken the liberty of reporting this on Google's Issue Tracker for you, detailing the behaviour:
User from outside of G Suite domain required to ask to join a Meeting from a Calendar event they are invited to
You can hit the ☆ next to the issue number in the top left on the page which lets Google know more people are encountering this and so it is more likely to be seen to faster.

what is account_name in Google My Business API?

I want to display all customers review on my web page. For that, I refer Get a review in the documentation.
But I am confused about account_name in the following request
https://mybusiness.googleapis.com/v4/accounts/account_name/locations/location_name/reviews
What value should i use for account_name?
Account_name = the name of the account you want to get data for
Location_name = the name of the location that you want to get reviews for
Use accounts list to find a list of accounts the current user has access to. Use locations list with account to find a list of the locations for that account
As you can see by the documentation accounts list returns a list of account objects.
Accounts.list
{
"accounts": [
{
object(Account)
}
],
"nextPageToken": string
}
An account resource contains a list of account_name's for the user who is currently authenticated.
{
"name": string,
"accountName": string,
"type": enum(AccountType),
"role": enum(AccountRole),
"state": {
object(AccountState)
},
"profilePhotoUrl": string,
"accountNumber": string,
"permissionLevel": enum(PermissionLevel),
"organizationInfo": {
object(OrganizationInfo)
}
}
Access
Remember you must fill out the form and request access to this api here
Authorization
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
Means that your request must be authenticated before you can use this method. YOu cant access private user data without the permission of the user who owns the data. Oauth I recommend you find the client library for your chosen language and look for information on how to authenticate using oauth2

How to uniquely identity a Person resource in Google People API response from a particular user?

Google People API, unlike Google Plus API doesn't provide an unique id for each Person resource in the response.
Why has this been deprecated/removed and how to uniquely identify a Person in an user's contacts list without an id?
In short, use resourceName as an ID.
The Google People API is the user's list of contacts and have IDs specific to the user. They can create contacts that only have a mailing address or only have a name and no contact info. There is no way for Google to logically collate all of these contacts across all of the Google Contacts users.
Specific contacts or a user have a resourceName field that uniquely identifies that resource (contact) for the authenticating user. You basically want to use that as an id. This is the value you for use, for example, to query People.get.
This is part of an example response of a single contact from People.connections:
{
"resourceName": "people/103710953423417258027",
"etag": "qwApd98gduQ=",
"metadata": {
"sources": [{
"type": "CONTACT",
"id": "1",
"etag": "#rj+KMFHVyHY="
}, {
"type": "PROFILE",
"id": "103710953423417258027",
"etag": "#4eZfef/IuMFw="
}],
"objectType": "PERSON"
},
...
}
resourceName is essentially the "id" of that contact and then in the metadata field it lists the sources the contact data comes from. E.g. CONTACT is for a Google Contacts entry where the user has manually entered name/phone/email/etc. PROFILE is a Google Profile, commonly with Google+ data.
The Person resource docs are a great place to learn more about these values.

Using the insert method of the Google Data Transfer API to start a transfer

I am trying to use the transfers:insert method of the Google Admin SDK Data Transfer API. I am performing this API call as the super admin account of my domain. I have verified that API access is enabled for our domain, and that the Super Admin admin role has permission to use the Data Transfer API.
I am testing this in the APIs Explorer on this page.
55656082996 is the ID string that I got for Google Drive from the applications:list APIs Explorer.
Request:
POST https://www.googleapis.com/admin/datatransfer/v1/transfers?key={YOUR_API_KEY}
{
"oldOwnerUserId": "olduser#ourdomain.com",
"newOwnerUserId": "newuser#ourdomain.com",
"applicationDataTransfers": [
{
"applicationId": "55656082996"
}
]
}
Response:
400 OK
- SHOW HEADERS -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid value for: Invalid oldOwnerUserId."
}
],
"code": 400,
"message": "Invalid value for: Invalid oldOwnerUserId."
}
}
I get the same "Invalid value for: Invalid oldOwnerUserId." response no matter if I use email addresses or usernames. I also tried excluding the applicationDataTransfers array from the response, but that also didn't work.
The documentation does not say this, but the Id cannot be the user's email address, like in all of the other Google APIs, but rather it needs to be a numeric ID for the user that you can get using the Users:get Directory API method.
I figured this out by Google searching and coming across this documentation, where they elaborate upon oldOwnerUserId by saying "# ID"
In addition to the answer above.
Here is how you can get the employee' IDs from Gsuite API in Python 3.*
def create_directory_service():
credentials = cls.get_credentials(scopes=['https://www.googleapis.com/auth/admin.directory.user'])
return build('admin', 'directory_v1', credentials=credentials, cache_discovery=Fals
service = create_directory_service()
old_owner_google_id = service.users().get(userKey=old_owner).execute()['id']
new_owner_google_id = service.users().get(userKey=new_owner).execute()['id']

Google place api - application specific search

I am trying to do application specific places search with google place api. Here is how I am adding a place:
Request:
{
"location": {
"lat": 37.760538,
"lng": -121.900879
},
"accuracy": 50,
"name": "p2p",
"types": ["other"]
}
I get success response as shown below:
Response:
{
"id" : "dfe583b1ac058750cf524f958afc5e82ade455d7",
"place_id" : "qgYvCi0wMDAwMDBhNWE4OWU4NTMzOjgwOGZlZTBhNjI3OjBjNTU1OTU4M2Q2NDI5YmM",
"reference" : "CkQxAAAAsPE72V-jhHUjj6vPy2HdC__2MhAdXanL6mlFBA4bcayRabKyMlfKFiah7U2vkoCj1P_0w9ESFSv5mfDkyufaZhIQTHBHY_jPGRHEE3EmEAGElhoUXTSylMslwHSTK5tYdstW2rOZKbw",
"scope" : "APP",
"status" : "OK"
}
When I search for this place using radar search, I get ZERO_RESULTS.
Request:
https://maps.googleapis.com/maps/api/place/radarsearch/json?key=key&radius=5000&location=37.761926,-121.891856&keyword=p2p
Response:
{
"html_attributions": [ ],
"results": [ ],
"status": "ZERO_RESULTS"
}
Is there something that I am doing the right way? Please help.
Thanks & Regards,
--Rajani
Your scope is "APP". That means you can access it (via PlaceID) from the application that created the entry only. If the location passes Google's moderation process, then it will gain scope "GOOGLE" and be accessible from the general searches.
scope — Indicates the scope of the place_id. The possible values are:
APP: The place ID is recognised by your application only. This is because your
application added the place, and the place has not yet
passed the moderation process.
GOOGLE: The place ID is available to other applications and on Google Maps.
Note: The scope field is included only in Nearby Search results and
Place Details results. You can only retrieve app-scoped places via the
Nearby Search and the Place Details requests. If the scope field is
not present in a response, it is safe to assume the scope is GOOGLE.
See: https://developers.google.com/places/documentation/search

Resources