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

Two call in ImportAccountEntJSON Rest connector

gwagh
Regular Contributor
Regular Contributor

Hi Team,

I have two different call for import account from Target. in the 1st call we are importing id, email and in the next call will get all information. How we can achieve this ? 

 

ImportAccountEntJSON :

 

{
"accountParams": 
{
"connection": "accAuth",
"processingType": "SequentialAndIterative",
"call": 
{
"call1": 
{
"callOrder": 0,
"stageNumber": 0,
"http": 
{
"httpHeaders": 
{
"Authorization":"${access_token}",
"Accept":"*/*"
},
"httpContentType": "application/json",
"httpParams": {"type":"user","action":"getlist"},
"httpMethod": "POST"
},
"listField": "records",
"keyField": "accountID",
"colsToPropsMap": 
{
"name": "email~#~char",
"accountID": "id~#~char",
"customproperty1":"employee name~#~char"
}
},
"call2": 
{
"callOrder": 0,
"stageNumber": 0,
"http": 
{
"httpHeaders": 
{
"Authorization":"${access_token}",
"Accept":"*/*"
},
"httpContentType": "application/json",
"httpParams": {"type":"user","action":"getlist","employee_id":"${response.call1.message.id}"},
"httpMethod": "POST"
},
"inputParams": {
"dependentCall": true
},
"listField": "",
"keyField": "accountID",
"nextApiKeyField": "accountID",
"colsToPropsMap": 
{
"name": "email~#~char",
"accountID": "id~#~char",
"customproperty2":"isInactive~#~char",
"customproperty3":"employeetype.refName~#~char",
"customproperty4":"lastModifiedDate~#~char",
"customproperty5":"firstName~#~char",
"customproperty6":"lastName~#~char",
"customproperty7":"middleName~#~char",
"customproperty8":"hireDate~#~char",
"customproperty9":"middleName~#~char",
"customproperty10":"dateCreated~#~char"
}
}
}
}
}
 
=============================
 
{
"accountParams": 
{
"connection": "accAuth",
"processingType": "SequentialAndIterative",
"call": 
{
"call1": 
{
"callOrder": 0,
"stageNumber": 0,
"http": 
{
"httpHeaders": 
{
"Authorization":"${access_token}",
"Accept":"*/*"
},
"httpContentType": "application/json",
"httpParams": {"type":"user","action":"getlist"},
"httpMethod": "POST"
},
"listField": "records",
"keyField": "accountID",
"colsToPropsMap": 
{
"name": "email~#~char",
"accountID": "id~#~char",
"customproperty1":"employee name~#~char"
}
},
"call2": 
{
"callOrder": 0,
"stageNumber": 0,
"http": 
{
"httpHeaders": 
{
"Authorization":"${access_token}",
"Accept":"*/*"
},
"httpContentType": "application/json",
"httpParams": {"type":"user","action":"getlist","employee_id":"${accountID}"},
"httpMethod": "POST"
},
"inputParams": {
"dependentCall": true
},
"listField": "",
"keyField": "accountID",
"nextApiKeyField": "accountID",
"colsToPropsMap": 
{
"name": "email~#~char",
"accountID": "id~#~char",
"customproperty2":"isInactive~#~char",
"customproperty3":"employeetype.refName~#~char",
"customproperty4":"lastModifiedDate~#~char",
"customproperty5":"firstName~#~char",
"customproperty6":"lastName~#~char",
"customproperty7":"middleName~#~char",
"customproperty8":"hireDate~#~char",
"customproperty9":"middleName~#~char",
"customproperty10":"dateCreated~#~char"
}
}
}
}
}
[This message has been edited by moderator to mask url]
9 REPLIES 9

Falcon
Saviynt Employee
Saviynt Employee

Disclaimer - This is an AI generated response and the feedback on this thread will be used to fine tune.

To achieve sequential and iterative account import with two different calls where the first call imports basic information (id, email) and the second call fetches additional details based on the ids fetched from the first call, you should structure your ImportAccountEntJSON to properly sequence these calls and handle dependencies. Here's an approach to structure your JSON for such a scenario:

 

{
  "accountParams": {
    "connection": "accAuth",
    "processingType": "SequentialAndIterative",
    "call": [
      {
        "callOrder": 0,
        "stageNumber": 0,
        "http": {
          "url": "https://XXXXX/netsuite-rest/igam",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Accept": "*/*"
          },
          "httpContentType": "application/json",
          "httpParams": {
            "type": "user",
            "action": "getlist"
          },
          "httpMethod": "POST"
        },
        "listField": "records",
        "keyField": "accountID",
        "colsToPropsMap": {
          "accountID": "id~#~char",
          "name": "email~#~char",
          "customproperty1": "employee name~#~char"
        }
      },
      {
        "callOrder": 1,
        "stageNumber": 1,
        "http": {
          "url": "https://XXXXX/netsuite-rest/igam",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Accept": "*/*"
          },
          "httpContentType": "application/json",
          "httpParams": {
            "type": "user",
            "action": "getdetails",
            "employee_id": "${response.call1.accountID}" // Ensure this is correctly referencing the id from call1's response
          },
          "httpMethod": "POST"
        },
        "inputParams": {
          "dependentCall": true
        },
        "listField": "", // Update this based on the actual JSON path in the response if needed
        "keyField": "accountID",
        "colsToPropsMap": {
          "accountID": "id~#~char",
          "customproperty2": "isInactive~#~char",
          "customproperty3": "employeetype.refName~#~char",
          "customproperty4": "lastModifiedDate~#~char",
          "customproperty5": "firstName~#~char",
          "customproperty6": "lastName~#~char",
          "customproperty7": "middleName~#~char",
          "customproperty8": "hireDate~#~char",
          "customproperty9": "middleName~#~char", // Duplicate, consider removing or correcting
          "customproperty10": "dateCreated~#~char"
        }
      }
    ]
  }
}

 

Key Points:

  • SequentialAndIterative: This processing type is correctly used to make the calls in sequence and iterate over each account ID from the first call.
  • callOrder and stageNumber: Ensure that callOrder and stageNumber for the second call (call2) are set to ensure it runs after the first call (call1). In the given template, they are sequentially ordered as 0 and 1.
  • Dependent Call: The inputParams with "dependentCall": true indicates that call2 depends on the outcome of call1. Make sure the placeholder ${response.call1.accountID} is correctly used to pass the accountID from call1 to call2. Adjust the placeholder based on the actual structure of the response if needed.
  • ListField for call2: The "listField": "" in call2 might need to be updated to correctly point to the part of the response that contains the array of account details. This depends on the structure of the API response.

Ensure that placeholders like https://XXXXX/netsuite-rest/igam and ${access_token} are replaced with actual values appropriate for your Oracle NetSuite environment and authentication context. Additionally, verify and adjust the "httpParams" and "colsToPropsMap" based on the exact API documentation and response format

gwagh
Regular Contributor
Regular Contributor

@Falcon , This provided json is not working I am not sure how to pass accountID in call2 ? can you suggest any syntax ?

Sample JSON

 

Spoiler
{
"accountParams": {
"connection": "acctAuth",
"createUsers": true,
"adminName": "admin",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"deleteLinks": false,
"accountThresholdValue": 30,
"correlateInactiveAccounts": false,
"inactivateAccountsNotInFile": false,
"deleteAccEntForActiveAccounts": true
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://api.**************.com/v1/enterprise/345992/users",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"listField": "users",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "id~#~char"
},
"disableDeletedAccounts": true
},
"call2": {
"callOrder": 1,
"stageNumber": 3,
"http": {
"url": "https://api.**************.com/v1/user/${accountName}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"inputParams": {
"dependentCall": true
},
"listField": "",
"keyField": "accountID",
"nextApiKeyField": "accountID",
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "username~#~char",
"customproperty1": "emailId~#~char",
"customproperty2": "lastName~#~char",
"customproperty3": "company~#~char",
"customproperty4": "timezone~#~char",
"customproperty5": "defaultEndpoint~#~char",
"customproperty6": "lastLogin~#~char"
}
}
}
}
}

Refer https://docs.saviyntcloud.com/bundle/Dev-Handbook-REST-v24x/page/Content/Developers-Handbook.htm

 


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

Not working, I tried below json.

 

{
"accountParams": 
{
"connection": "accAuth",
"processingType": "SequentialAndIterative",
"call": 
{
"call1": 
{
"callOrder": 0,
"stageNumber": 0,
"http": 
{
"httpHeaders": 
{
"Authorization":"${access_token}",
"Accept":"*/*"
},
"httpContentType": "application/json",
"httpParams": {"type":"user","action":"getlist"},
"httpMethod": "POST"
},
"listField": "records",
"keyField": "accountID",
"colsToPropsMap": 
{
"name": "id~#~char",
"accountID": "id~#~char",
"customproperty1":"employee name~#~char",
"customproperty10":"email~#~char"
}
},
"call2": 
{
"callOrder": 1,
"stageNumber": 1,
"http": 
{
"httpHeaders": 
{
"Authorization":"${access_token}",
"Accept":"*/*"
},
"httpContentType": "application/json",
"httpParams": {"type":"user","action":"getlist","employee_id":"${accountName}"},
"httpMethod": "POST"
},
"inputParams": {
"dependentCall": true
},
"listField": "",
"keyField": "accountID",
"nextApiKeyField": "accountID",
"colsToPropsMap": 
{
"name": "email~#~char",
"accountID": "id~#~char",
"customproperty2":"isInactive~#~char",
"customproperty3":"employeetype.refName~#~char",
"customproperty4":"lastModifiedDate~#~char",
"customproperty5":"firstName~#~char",
"customproperty6":"lastName~#~char",
"customproperty7":"middleName~#~char",
"customproperty8":"hireDate~#~char",
"customproperty9":"dateCreated~#~char"
}
}
}
}
}

share logs


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

As confirmed this issue is resolved 🙂

https://forums.saviynt.com/t5/identity-governance/two-level-access-recertification/m-p/84319#M54357


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

Hi @rushikeshvartak , yes I was checking my two forum question at the same time so Instead of here I confirmed this in another forum.

Still we are on access recertification issue. This Rest connector issue has been resolved. 

 

Thanks,

Gaurav 

Please close this thread 


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

What was the exact resolution for this issue? What was missing from the json? What is the final working json for this?