Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Import Accounts using multiple API

AS5278
Regular Contributor II
Regular Contributor II

Hi All,

We have a requirement to import the accounts for an application(GitHub). I want to import the GitHub accounts + 'Teams' as accounts in the GitHub endpoint in Saviynt.

I have framed below query for this:

"accountParams": {
"connection": "acctAuth",
"createUsers": false,
"adminName": "admin",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"listField": "",
"keyField": "accountID",
"colsToPropsMap": {
"name": "login~#~char",
"accountID": "login~#~char",
"displayName": "login~#~char",
"customproperty2": "#CONST#User~#~char"
},
"disableDeletedAccounts": true,
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link==null?'':headers?.Link?.contains('next')?headers?.Link?.split(',')?.size()==2?headers?.Link?.split(',')[0]?.replace('<', '')?.replace('>; rel=\"next\"','')?.trim():headers?.Link?.split(',')[1].replace('<', '').replace('>; rel=\"next\"','').trim():''}"
}
}
},
"call2": {
"callOrder": 1,
"stageNumber": 1,
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"listField": "",
"keyField": "accountID",
"colsToPropsMap": {
"name": "name~#~char",
"accountID": "id~#~char",
"displayName": "name~#~char",
"customproperty1":"url~#~char",
"customproperty2": "#CONST#Team~#~char"
},
"disableDeletedAccounts": true,
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link==null?'':headers?.Link?.contains('next')?headers?.Link?.split(',')?.size()==2?headers?.Link?.split(',')[0]?.replace('<', '')?.replace('>; rel=\"next\"','')?.trim():headers?.Link?.split(',')[1].replace('<', '').replace('>; rel=\"next\"','').trim():''}"
}
}
}
}
},
 
This works fine and the GitHub accounts and Teams are imported as accounts in Saviynt. However, the problem is that the parameter "disableDeletedAccounts": true, is causing issues.
Everytime the all the 'Teams' that are already present in the GitHub endpoint are being 'SUSPENDED' and the same are being imported as fresh accounts.
This I believe is because in the 'call1' we are importing the GitHub users as accounts and in that API feed we are not getting the 'Teams'. So, they are getting supsended. And then in 'call2' the Teams are again freshly imported as accounts.
 
The 'accountID' is fixed to 'id' attribute of the 'Team'.
 
How do I even fix this?. Can we import accounts using multiple APIs?.
Please guide.
 
Thanks,
Atul Singh
 
xurde
4 REPLIES 4

rushikeshvartak
All-Star
All-Star

Did you removed "disableDeletedAccounts":true and tried ?

Please share logs 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

AS5278
Regular Contributor II
Regular Contributor II

@rushikeshvartakYes, when I remove "disableDeletedAccounts":true, it doesn't suspend the Teams that were previously imported.

But I need to keep the "disableDeletedAccounts":true, parameter as otherwise the accounts that actually got deleted in target system will not get suspended in Saviynt GitHub endpoint.

Is there any alternate solution to this?

Thanks,

Atul Singh

xurde

Raghu
Honored Contributor
Honored Contributor

@AS5278  please find below working import ,it will help full

{
"accountParams": {
"connection": "acctAuth",
"createUsers": false,
"adminName": "admin",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "xxxx/members?per_page=100&page=1",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"listField": "",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "login~#~char",
"displayName": "login~#~char"
},
"makeProcessingStatus": true,
"disableDeletedAccounts": true,
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link==null?'':headers?.Link?.contains('next')?headers?.Link?.split(',')?.size()==2?headers?.Link?.split(',')[0]?.replace('<', '')?.replace('>; rel=\"next\"','')?.trim():headers?.Link?.split(',')[1].replace('<', '').replace('>; rel=\"next\"','').trim():''}"
}
}
},
"call2": {
"callOrder": 1,
"stageNumber": 1,
"http": {
"url": "https://api.github.com/users/${accountName}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"listField": "",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "login~#~char",
"displayName": "login~#~char",
"customproperty1": "avatar_url~#~char",
"customproperty2": "gravatar_id~#~char",
"customproperty3": "url~#~char",
"customproperty10": "suspended_at~#~char"
},
"multiTrigger": {
"multiTriggerType": "MultiTriggerByAccountBatching",
"triggersCount": "20",
"params": {
"accountsoraccess": "accounts"
}
}
}
}
},


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

In this case use status threshold config block and remove condition from import json


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.