how to get deleted contact_groups from Google People API - ruby

We use people api to get a list of contact_groups.
Although we use sync_token, we cannot get deleted groups. But people list do not have this problem. How to solve?
service = Google::Apis::PeopleV1::PeopleServiceService.new
service.client_options.application_name = 'xxx'
service.authorization=Signet::OAuth2::Client.new(credentials)
response = service.list_contact_groups(sync_token: xxxx-xxxx-xxxx)

Contactgroups.list returns a list of contact groups a contact group contains a Contact group metadata which contains a deleted paramater.
True if the contact group resource has been deleted. Populated only for contactGroups.list requests that include a sync token.
I am not 100% sure i understand your question.
Search only deleted
There is no way to search only on deleted groups. You are going to have to cache the full contactgroups.list method and scan the data locally.
Data not returned
If you are not seeing the deleted groups and you are 100% sure that this user has access to this information. Then i would suggest that this information is not available via the api it is a common issue that not all of the fields in Google apis are publicly available to third party developers like us. If this is the case then i suggest that you post an issue on the forum here that the information should be populated.

Related

ServiceNow API - How to get all users and all their attributes

I am trying to use the ServiceNow API for the first time and I need to get a list of all the users in the sys_user table with all of their available fields/attributes like date created, updated etc.
I tried GET request to this URI:
https://myinstance.service-now.com/api/now/table/sys_user
But the response only returns the Users and some of their attributes but not all of the ones I can see in the portal.
What is the correct URI to make the REST call to get all users and their fields/attributes?
I'm assuming you want to access SN API from another application? Cause if you want to do that from within SN, there is the GlideRecord server API you can use.
Now when you access the table API from external source, you do that through a registered user - depending on this user and their roles, you might see all or only some of the user attributes. Also, if you add specific Query Parameters to your request like sysparm_query or sysparm_fields, this will limit what you get.
ACLs (Access Control Lists) is the mechanism in ServiceNow restricting access to Table API. So I would encourage you to check there. Perhaps you will need to create a technical user with sufficient roles to access the data you need.
Also the REST API Explorer which is found in SN Navigator can be of help to quickly test your table queries.
Hope that helps a bit!
In general table api returns all the columns associated to the table unless until if you have specified the specific column list in sysparam_fields, can you please try in post man or try the same api call from rest api explorer in Servicenow to understand the behavior. H

Microsoft Graph Get Calendars of All Users

I'm trying to use the Microsoft Graph API to get the calendars of all the users in an organization. Is there a way for an admin with the appropriate permissions can get all user calendars with one request to the API? I'm aware that it is possible by first retrieving a list of all the users then using the user IDs to send a request for each's calendars. I'd like to avoid this approach so that I can avoid making too many calls to the API. I'd also like to be able to do this without every using having to share their calendars with the admin. Does support for something like this exist? Thanks.
No, it is not possible to get all Calendars of all users in one request.
You can do it only over the way you described.
There are two part to your question:
1: Get all calendars of all users in call: This is not possible.
2: Get access to calendars with users explicitly sharing the calendars. This is possible using app-only access tokens.
https://developer.microsoft.com/en-us/graph/docs/concepts/auth_v2_service

How to uniquely identity a pipedrive account?

We are trying to integrate our platform with Pipedrive. As far as we have researched, in a pipedrive account, there is one admin and he can add multiple users. And the users later can login in their respective accounts.
What we are trying to make sure is that once a Pipedrive account is integrated with our platform, the same account should not be integrated twice. So, I need a unique identifier, that lets me know whether the account has already been integrated.
My initial approach was to check the api key. But it was not successful, since every users in an account have different API Keys.
After a bit of research, I found out that there is an identifier called company_id which is common for all the users in an account. But I could not find anything regarding it in documentation. So, I am not 100% confident to go ahead and implement it in our code.
Does anyone have an idea about this?
Pipedrive support rep here.
The most sure-fire way to ensure this is to make a GET request against http://api.pipedrive.com/v1/users?api_token=your_token_here.
You are correct in assuming the company_id in the additional_data object in the response is static and won't change across any users on the account.
Note that a Pipedrive account may have more than one admin, and that non-admins (regular users) might have visibility (and editing) restrictions in place, which may cause some of your GET, PUT and DELETE requests to fail.
In case you're not doing this already, I'd thus advise filtering the data array from the abovementioned endpoint for user.is_you to equal true and check whether the is_admin property is set to 1 during "registration" to ensure the user setting up the integration is an admin.
Hope this helps!
I'm not quite sure what you're asking for. Are you looking for a unique identifier for each user?
Each user has an id, you can get all users by calling
https://api.pipedrive.com/v1/users?api_token=____
This will return a JSON Object with data on your users, including their names and associated IDs. Admins are just users with different privilege levels. All admins are users, but not all users are admins. All users are part of a company, the company is identified by the first part of the Pipedrive account url ie.
https://FooCompany.pipedrive.com
Are you trying to see if a certain company has been integrated already?

Google Drive File Resource is missing permissions data

I'm using the ruby sdk for Google Drive, API v2. When using the files.list or files.get method, the response does not contain permissions. The documentation indicates that it should:
permissions[] list The list of permissions for users with access to this file.
I am able to fetch the permissions in a separate API call (permissions.list with fileId). This indicates to me that the client has the correct permissions to see this information, but for some reason the API is not returning it with the files.list or files.get calls.
Is there something I need to do to ensure the permissions field is present when using the files.list call? I would very much like to avoid turning a (N/PageSize) problem in to an N problem.
Note: I have omitted including the relevant code and responses because they are pretty much as expected, except for permissions. For example, the userPermission, and owners attributes are present.
Thanks!
This property is not set by default, but you can explicitly call for it in the request url. You will have to rely on 'partial response', in which you can set the desired parameters to consult or list. You can read more on the subject here: https://developers.google.com/drive/web/performance#partial-response; and the implementation for ruby can be found on this site: https://developers.google.com/api-client-library/ruby/guide/performance#fields

Google Api: Unable to fetch updated profiles using "updated-min"

I tried to fetched updated user profiles of the users in my domain using the "updated-min" query parameter, but still I got the list of all the users from the domain, I have used the below URL for the same:
https://www.google.com/m8/feeds/profiles/domain/DomainName/full?updated-min=2012-08-24T00:00:00&access_token="+access_token+"&v=3.0"
Please let me know if I am missing something.
I believe the updated-min parameter does not work with the profile data api. It only works with the Contact API. https://developers.google.com/google-apps/contacts/v3/#retrieving_contacts_using_query_parameters
If you take a look at the documentation, you can see that it is supported for Contact APi. But it doesn't mention the support for Profile data api anywhere in the documentation.

Resources