Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/31/2023 09:20 AM
Below is the JSON I used for account imports from Keepnet. My connection is successful (Ran test connection params simple get successfully) I was able to import an account with this API https://api.keepnetlabs.com/api/target-users/Psd88ApFLYKx - import account JSON below.
{ "accountParams": { "connection": "acctAuth", "createUsers": false, "processingType": "SequentialAndIterative", "call": { "call1": { "callOrder": 0, "stageNumber": 0, "http": { "url": "https://api.keepnetlabs.com/api/target-users/<UserIDHere>", "httpHeaders": { "Authorization": "${access_token}", "Content-Type": "application/json" }, "httpMethod": "GET", "httpParams": { "pageNumber": 0, "pageSize": 3000, "orderBy": "resourceId", "ascending": true } }, "listField": "data", "keyField": "accountID", "colsToPropsMap": { "accountID": "resourceId~#~char", "name": "email~#~char", "displayName": "email~#~char", "customproperty2": "firstName~#~char", "customproperty3": "lastName~#~char", "customproperty4": "isActive~#~char" } } } }, "entitlementParams": {}, "acctEntParams": {} }
Here is the request for the single user, which the account imported just fine. It is a GET
The issue with that is it only returns one user at a time rather than all of them. (You'll notice the URL has a hard-coded user ID) The endpoint for this application that allows us to import all users is a POST to this URL "https://api.keepnetlabs.com/api/target-users/search" which when we try doesn't work, JSON posted below.
{ "accountParams": { "connection": "acctAuth", "createUsers": false, "processingType": "SequentialAndIterative", "call": { "call1": { "callOrder": 0, "stageNumber": 0, "http": { "url": "https://api.keepnetlabs.com/api/target-users/search", "httpHeaders": { "Authorization": "${access_token}", "Content-Type": "application/json" }, "httpMethod": "POST", "httpParams": { "pageNumber": 0, "pageSize": 3000, "orderBy": "resourceId", "ascending": true } }, "listField": "data.results", "keyField": "accountID", "colsToPropsMap": { "accountID": "resourceId~#~char", "name": "email~#~char", "displayName": "email~#~char", "customproperty2": "firstName~#~char", "customproperty3": "lastName~#~char", "customproperty4": "status~#~char" } } } }, "entitlementParams": {}, "acctEntParams": {} }
Here is the postman return for ALL users, which is the POST request
Saviynt call and response logs attached as well, thanks.
11/02/2023 12:28 AM
Hello @rp781,
You need to pass the body in the form of the string,
{
"accountParams": {
"connection": "acctAuth",
"createUsers": false,
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://api.keepnetlabs.com/api/target-users/search",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"httpMethod": "POST",
"httpParams": "{\"pageNumber\": 0,\"pageSize\": 3000,\"orderBy\": \"resourceId\",\"ascending\": true}}",
"listField": "data.results",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "resourceId~#~char",
"name": "email~#~char",
"displayName": "email~#~char",
"customproperty2": "firstName~#~char",
"customproperty3": "lastName~#~char",
"customproperty4": "status~#~char"
}
}
}
},
"entitlementParams": {},
"acctEntParams": {}
}
}
Thanks.
11/02/2023 04:22 PM
11/06/2023 06:44 PM
Hello @rp781 ,
Could you please try with the below json once,
{
"accountParams": {
"connection": "acctAuth",
"createUsers": false,
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://api.keepnetlabs.com/api/target-users/search",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"httpMethod": "POST",
"httpParams": "{\"pageNumber\": 0, \"pageSize\": 3000, \"orderBy\": \"resourceId\", \"ascending\": true}",
"listField": "data.results",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "resourceId~#~char",
"name": "email~#~char",
"displayName": "email~#~char",
"customproperty2": "firstName~#~char",
"customproperty3": "lastName~#~char",
"customproperty4": "status~#~char"
}
}
}
},
"entitlementParams": {},
"acctEntParams": {}
}
}
Thanks
11/14/2023 10:13 AM
Hi @sudeshjaiswal - This does not work. There is nothing wrong with the formatting. Simply changing the method to a GET and adding a userID at the end of the URL ( that one is doable with a GET ) we receive an individual user successfully. This problem seems to be specific to POST calls.
I can't find in the docs anything about supporting POST in imports and I need to confirm if this is possible and if there is anything specific that needs to be done to support this.
11/14/2023 10:56 PM
Hello @Baver,
Post is supported in the importaccountjson,
Could you please share the complete debug log.
Thanks.