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

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

Related

how to get deleted contact_groups from Google People API

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.

Parse Server User Table Security

I am fairly new at using Parse Server (hosted in back4app) and would like to get some clarification on the pre-created 'users' table.
I am currently trying to develop a Web Application (Javascript) using Parse and I am using REST API calls to signup and login users. One thing I have noticed is that anyone can get a hold of my REST API key (through html source), but most importantly anyone can make a GET 'users' request to get all the users in the DB. These results include the username, email, and ObjectID. As a result of this anyone can make another REST call to the 'sessions' table with the ObjectID and retrieve the sessionToken (which I was planning to use as an authorization token for protected REST API calls)
I am not quite sure how this can be safely accomplish. I have search online but without much success. Any help or articles will be greatly appreciated.
Thank you
The security access is made throuh the
CLP (Class-Level-Permission) and/or ACL (on each each row).
you should have a look here :
https://parseplatform.github.io/docs/js/guide/#security
Note that : "Session objects can only be accessed by the user specified in the user field. All Session objects have an ACL that is read and write by that user only. You cannot change this ACL. This means querying for sessions will only return objects that match the current logged-in user."
REM : for a web application you should use the Parse "Javascript Key" which can be "public". Try to keep the REST API key more "private" by using it for i.e. only on "third party custom and private server" that could make REST request on your database.

Best way to store/process user-specific API key and secrets?

I'm designing an app that counts on accessing multiple API's that need the certain users credentials which are provided when a user allows access via OAuth. I'm new to designing programs like this and I'm trying to wrap my head around the easiest way to do this. Here is what I was thinking:
During the Oauth process I specify the callback url (lets call it A)
Create a POST route for url A that points to a function in the user controller
That function then parses the JSON data with the API Key+Secret, hashes the data, and stores it in a column of the user table.
Would this be the best way to go about this?
One thing I'll say is don't tie these directly to your users. Sometimes users may want to authorize multiple accounts, and sometimes multiple users may authorize the same account. Since you can only have one active refresh token per oauth account, these creds should be kept in a separate table and then linked with a many-to-many for flexibility

Is it possible to batch API calls to Gigya getUserInfo?

I have a script which is retrieving user info for a set of users in our account. First we're calling socialize.exportUsers to get all UIDs, then I'd like to retrieve user info for a subset of this. Currently I'm calling socialize.getUserInfo on each UID I want to retrieve, which is quite slow.
I'm wondering if there's a way to batch API calls together so I can retrieve user info for multiple UIDs with one call. I didn't find anything in their API documentation or Developer's Guide.
Thanks,
Scott
Unfortunately, Gigya does not currently not have API functionality that would allow you to retrieve user information back as a batch.
However, if you have an active contract with Gigya, then you should be able to contact Gigya support directly and request a user export. Gigya has an internal data migration process where they can extract all the users on an API key into a JSON file and then send you that file.

Yammer REST endpoint to get user by full name

I'm working on a migration Product that migrates data in to yammer. I want to match the user on source to user on target based on full name. How do I retrieve user from Yammer based on Full Name? There is one REST endpoint to get user by email. Is there something similar to this for user Full Name ?
It's not possible to do this with the User API as it only supports getting a user by ID or email. You might want to look at the Autocomplete API, but it might be quicker to use the Data Export API and find the user in the users.csv file. It's hard to provide recommendations when you don't explain what you app does.

Resources