Search query on Okta Users API - okta

I am trying to run a query in our instance of okta using postman. The problem I am running into is that Postman says it has syntax errors. Exact wording "Invalid search criteria.". Here is a partial copy copy of my structure:
{
"id": "00u1c9lvdpsArq00J0h8",
"status": "ACTIVE",
"created": "2017-02-28T18:55:23.000Z",
"activated": "2017-02-28T18:55:24.000Z",
"statusChanged": "2017-02-28T18:55:24.000Z",
"lastLogin": null,
"lastUpdated": "2017-05-01T10:30:59.000Z",
"passwordChanged": null,
"profile": {
"login": "lynn#enterthepicture.com",
"firstName": "Lynn",
"lastName": "Harvey",
"mobilePhone": null,
"email": "lynn#enterthepicture.com",
"secondEmail": null,
"primaryPhone": "4169329890"
},
"credentials": {
"provider": {
"type": "ACTIVE_DIRECTORY",
"name": "idm.sni"
}
},
The query I am trying to run is {{url}}/api/v1/users?search=credentials.provider.name eq "idm.sni"
If anyone has any suggestion I would greatly appreciate the help.

The search expression needs to be URL encoded, an example can be found here: http://developer.okta.com/docs/api/resources/users.html#list-users-with-search
So in your example, the request URL would need to look like {{url}}/api/v1/users?search=credentials.provider.name%20eq%20%22idm.sni%22.
I hope this helps!

Related

How to get only specific fields with Google Directory API users.list

The documentation (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list#query-parameters) says you can use customFieldMask to get only specific fields. I cannot figure out the format/structure of this property.
For example, given this for a user:
{
"kind": "admin#directory#user",
"id": "...",
"etag": "\"...\"",
"primaryEmail": "...",
"name": {
"givenName": "...",
"familyName": "...",
"fullName": "......"
},
"emails": [
{
"address": "...",
"primary": true
}
]
}
I only want to get primaryEmail but I can't figure out how.
Send "users(primaryEmail)" in the fields parameter, not in the customFieldMask parameter.
The Directory API can't retrieve the 'primaryEmail' with the customFieldMask attribute, with this attribute you can only specify the custom schema names that you create in the Admin console.

Cannot save a very simple fhir patient bundle

I am trying to save this very simple fhir patient bundle against https://vonk.fire.ly/Bundle, by doing a PUT using Postman, however I am not able to get it working. When I simply copy the inner Patient resource data and do a PUT directly to the https://vonk.fire.ly/Patient endpoint it works just fine (for example - I just did it to this url https://vonk.fire.ly/Patient/deb7338181).
Can someone please please point me in the direction of what exactly it is going wrong here in this bundle??
{
"resourceType": "Bundle",
"id": "b6ec685a-26a2-4bb3-814b-841fba6a6edb",
"meta": {
"lastUpdated": "2018-05-29T23:45:32Z"
}
"type": "transaction",
"entry": [
{
"resource": {
"resourceType": "Patient",
"id": "deb73381811",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>"
},
"active": true,
"name": [
{
"use": "official",
"family": "Chalmers1",
"given": [
"Peter1",
"James1"
]
}
],
"gender": "male",
"birthDate": "1974-12-25"
},
"request": {
"method": "POST",
"url": "Patient"
}
}
]
}
If you want to send a transaction to a FHIR server, you do a POST of the transaction Bundle to the endpoint, just like you mention in your comment. Within the transaction, for each entry you have to set the request part to the kind of request you want.
For your Patient entry you have asked the server to do a POST, which means a create with a server assigned ID. If you want the server to use your own ID, you should instruct it to perform a PUT, which is usually an update, but can also be used for create with your own ID.
The syntax for the update request is:
"request": {
"method": "PUT",
"url": "Patient/<my_patient_id>"
}
Please note that although it is a valid FHIR request and Vonk allows it, not all servers will.

Access control at property level (hiding/showing properties in api response based on the role)

I have a spring-boot based micro-service generated using JHipster.
I am using keycloak as my Auth Server. I could enable Role-based & scope based authorization on my resources(apis).
Now the requirement is: based on the role of the client, I need to restrict the information to send in the response (either mask the attributes or nullify them).
eg:
consider the following api to get the person's profile
/api/person/{id}
{
"name": {
"firstName": "Jack",
"lastName": "Sparrow"
},
"gender": "MALE",
"emails": {
"details": [
{
"emailId": "jack.sparrow#gmail.com"
}
]
},
"phones": {
"details": [
{
"phoneNumber": "1234567890",
"countryCode": "+1"
}
]
},
"addresses": {
"details": [
{
"addressLine1": "aaaaaaaa",
"addressLine2": "bbbbbbb",
"city": "cccccc",
"state": "ddddd",
"country": "South Africa",
"postalCode": "987654"
}
]
},
"photo": "string",
"nationality": "South Africa",
"countryOfResidence": "string",
"active": true,
"createdAt": 1537431339569,
"modifiedAt": 1537436600693,
"createdBy": "admin",
"modifiedBy": "admin"
}
Now, when a person with BASIC role calls this API, the requirement is to show only basic information like:
- name, gender
If he has INTERMEDIATE role then we can send something more than basic but not full information. eg: name, gender, photo, nationality
If he has ADMIN role then we can send the complete information.
Can anyone please let me know What is the best approach to achieve this.
-- Thanks in advance :)

How to add JSON array to elasticsearch using Postman

I have tried to add sample data set using postman as following way,
POST URL: http://localhost:9200/allData
Add to postman body as json
{
"index": "allData",
"type": "all",
"id": 1006,
"body": {
"id": 1006,
"url": "https://en.wikiversity.org/wiki/Principles_of_Management",
"title": "Principles of Management",
"author": "",
"rate": 0,
"ratedBy": 0,
"datePublished": "2018-01-01T00:00:00",
"publishedDate": "2018-01-01"
}
}
But it is given following error.
No handler found for uri [/] and method [POST]
Someone please help me to solve this issue. Thanks
There are certain issues with your request:
Elasticsearch index names cannot have uppercase so in your case it should be alldata not allData.
The format of the URL is wrong.
Your URL should be in the below format:
http://localhost:9200/{indexname}/{type}/{id}
which in your case must be:
http://localhost:9200/alldata/all/1006
So you should perform a POST request to the above url with the body as:
{
"id": 1006,
"url": "https://en.wikiversity.org/wiki/Principles_of_Management",
"title": "Principles of Management",
"author": "",
"rate": 0,
"ratedBy": 0,
"datePublished": "2018-01-01T00:00:00",
"publishedDate": "2018-01-01"
}
Have a look at the Elasticsearch Reference Guide.
Hope it helps !

amazon lex showing invalid response

Facing Problem in lex.Written code in lambda for question and answer getting answer from the database to the lambda function perfectly but the amazon lex is showing invalid response Received error response from Lambda: Unhandled.
but everything written in the code showing correct answer my config file
{
"currentIntent": {
"slots": {
"Name": "ramya",
"Hi": "What is your given/family name?"
},
"name": "Firstone",
"confirmationStatus": "None"
},
"bot": {
"alias": "$LATEST",
"version": "$LATEST",
"name": "Ramya"
},
"userId": "John",
"invocationSource": "DialogCodeHook",
"outputDialogMode": "Text",
"messageVersion": "1.0",
"sessionAttributes": {}
}
Help me out
Thanks in advance

Resources