and more in a single search tool across platforms. Read the announcement here. |
05/16/2023 03:43 AM
Hi Team,
We have an usecase where we are trying to import entitlements using REST connector, API response for entitlements are stored in Array form and scim based.
Response for entitlements
"urn:ietf:params:scim:schemas:extension:spend:2.0:Role": {
"roles": [
{
"roleName": "REQ_USER"
},
{
"roleName": "EXP_USER"
}
]
}
We are able to import by mentioning array index number like roles[1], so it will bring the rolename at [1] position.
"entitlement_value": "urn:ietf:params:scim:schemas:extension:spend:2~dot#0:Role.roles[1].roleName~#~listAsString"
How can we bring all the rolenames and store it in entitlement_values, as this response array is a multivalued attribute and we may need to use iterator.
Can anyone tell me how we can achive this.
Regards
Solved! Go to Solution.
05/16/2023 09:17 AM
Can you share the complete JSON part of entitlementParams you have defined.
05/17/2023 12:11 AM
"entitlementParams": {
"processingType": "SequentialAndIterative",
"entTypes": {
"Roles": {
"entTypeOrder": 0,
"entTypeLabels": {},
"call": {
"call1": {
"connection": "userAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://**********************************************",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "urn:ietf:params:scim:schemas:extension:spend:2~dot#0:Role.roles[*].roleName~#~listAsString",
"entitlement_value": "urn:ietf:params:scim:schemas:extension:spend:2~dot#0:Role.roles[*].roleName~#~listAsString",
"acctEntMappingInfoColumnFromEnt": "STORE#ACC#ENT#MAPPINGINFO~#~char"
}
}
}
}
}
}
05/17/2023 12:16 AM
I also used this->
"entitlementParams": {
"processingType": "SequentialAndIterative",
"entTypes": {
"Roles": {
"entTypeOrder": 0,
"entTypeLabels": {},
"call": {
"call1": {
"connection": "userAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://*************************************************88",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "#CONST#${List responseList = response.urn:ietf:params:scim:schemas:extension:spend:2~dot#0:Role.roles; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if(count <= size){return dataMap.roleName}else{return null}}}~#~listAsString",
"entitlement_value": "#CONST#${List responseList = response.urn:ietf:params:scim:schemas:extension:spend:2~dot#0:Role.roles; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if(count <=size ){return dataMap.roleName}else{return null}}}~#~listAsString",
"acctEntMappingInfoColumnFromEnt": "STORE#ACC#ENT#MAPPINGINFO~#~char"
}
}
}
}
}
}
As mentioned in earlier with index like roles[1] value getting imported, but as a whole entitlement list not getting imported.
Can you please let me know how can we achieve this.
Regards,
Atrayee Dutta
05/17/2023 02:59 AM - edited 05/17/2023 02:59 AM
Hi @AtrayeeDutta
Please try with the below JSON to import entitlements. If it still fails, share the complete API response
{
"accountParams": {},
"entitlementParams": {
"connection": "userAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Roles": {
"entTypeOrder": 0,
"entTypeLabels": {},
"call": {
"call1": {
"connection": "userAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://*****",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "urn:ietf:params:scim:schemas:extension:spend:2~dot#0:Role.roles",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "roleName~#~char",
"entitlement_value": "roleName~#~char"
}
}
}
}
}
},
"acctEntParams": {}
}
Thank you
Vedanth B.K
05/19/2023 03:40 AM
Hi Vedant,
It worked, thank you.
Regards,
Atrayee Dutta
05/24/2023 09:44 AM
Hi @Vedanth_BK ,
In the same for acctEntParams what should be the config for acc-ent map,
"acctEntParams": {
"connection": "userAuth",
"entTypes": {
"Roles": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"processingType": "http",
"http": {
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"url": "https://us2.api.concursolutions.com/profile/spend/v4/Users/3f42cc7c-2e6f-41cc-a491-dfddb4138da8",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "",
"entKeyField": "entitlementID",
"acctKeyField": "accountID",
"acctIdPath": "id",
"entIdPath": "roleName"
}
}
}
}
}
and
"acctEntParams": {
"connection": "userAuth",
"entTypes": {
"Roles": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"processingType": "http",
"http": {
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"url": "https://us2.api.concursolutions.com/profile/spend/v4/Users/3f42cc7c-2e6f-41cc-a491-dfddb4138da8",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "urn:ietf:params:scim:schemas:extension:spend:2~dot#0:Role.roles",
"entKeyField": "entitlementID",
"acctKeyField": "accountID",
"acctIdPath": "id",
"entIdPath": "roleName"
}
}
}
}
}
Its not mapping the acc-ent , if entIdPath is with the indexes its mapping
Can you please let me know how can we resolve this?
Regards,
Atrayee
05/25/2023 11:36 PM
Hi Team,
Any solution for this?
Regards,
Atrayee
05/26/2023 07:24 AM
Hi @AtrayeeDutta ,
Please share the response for the API that returns the mapping information. Also, provide a brief overview of the response and let me know which ID needs to be passed in the URL.
Thanks
Vedanth
05/28/2023 11:55 PM
Hi Vedant,
Response JSON:
{
"schemas": [
"urn:ietf:params:scim:schemas:extension:spend:2.0:Role",
"urn:ietf:params:scim:schemas:extension:spend:2.0:WorkflowPreference",
"urn:ietf:params:scim:schemas:extension:spend:2.0:User",
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:Payroll",
"urn:ietf:params:scim:schemas:extension:spend:2.0:UserPreference",
"urn:ietf:params:scim:schemas:extension:spend:2.0:Approver",
"urn:ietf:params:scim:schemas:extension:spend:2.0:Delegate",
"urn:ietf:params:scim:schemas:ScimResource"
],
"id": "*********************************",
"meta": {
"resourceType": "User",
"created": null,
"lastModified": "2023-05-10T16:03:58.013Z",
"location": "https://us2.api.concursolutions.com/profile/spend/v4/Users/**************************",
"version": null
},
"urn:ietf:params:scim:schemas:extension:spend:2.0:User": {
"reimbursementCurrency": "AUD",
"reimbursementType": null,
"ledgerCode": "SAP",
"country": "AU",
"budgetCountryCode": null,
"stateProvince": null,
"locale": "en-US",
"cashAdvanceAccountCode": "",
"testEmployee": false,
"nonEmployee": false,
"biManager": null,
"customData": [
{
"id": "custom20",
"value": "5500"
},
{
"id": "custom10",
"value": ""
},
{
"id": "custom21",
"value": "AU",
"syncGuid": "51b28bb4-1974-a940-ba05-c92bc0c34aa6",
"href": "https://us2.api.concursolutions.com/list/v4/items/******************"
},
{
"id": "custom9",
"value": "55:Manager II"
},
{
"id": "custom17",
"value": "0000027233"
},
{
"id": "custom16",
"value": ""
},
{
"id": "custom3",
"value": "8000"
},
{
"id": "orgunit1",
"value": "5500",
"syncGuid": "1305a67e-3939-b74a-875c-d2a30f6cc27c",
"href": "https://us2.api.concursolutions.com/list/v4/items/*****************"
},
{
"id": "custom4",
"value": "SEL"
},
{
"id": "orgunit2",
"value": "86159",
"syncGuid": "******************",
"href": "https://us2.api.concursolutions.com/list/v4/items/*****************"
},
{
"id": "custom1",
"value": "MULT"
},
{
"id": "custom2",
"value": "MULT"
},
{
"id": "custom7",
"value": "N"
},
{
"id": "custom8",
"value": "N"
},
{
"id": "custom5",
"value": "KEY"
},
{
"id": "custom6",
"value": "N"
}
]
},
"urn:ietf:params:scim:schemas:extension:spend:2.0:Approver": {
"report": [
{
"approver": {
"value": "**********************"
},
"primary": true
}
]
},
"urn:ietf:params:scim:schemas:extension:spend:2.0:Delegate": {},
"urn:ietf:params:scim:schemas:extension:spend:2.0:Role": {
"roles": [
{
"roleName": "REQ_USER"
},
{
"roleName": "EXP_USER"
}
]
},
"urn:ietf:params:scim:schemas:extension:spend:2.0:UserPreference": {
"showImagingIntro": false,
"expenseAuditRequired": "REQUIRED",
"allowCreditCardTransArrivalEmails": false,
"allowReceiptImageAvailEmails": false,
"promptForCardTransactionsOnReport": true,
"autoAddTripCardTransOnReport": false,
"promptForReportPrintFormat": true,
"defaultReportPrintFormat": "RECEIPTS",
"showTotalOnReport": true,
"showExpenseOnReport": "PARENT",
"showInstructHelpPanel": true,
"useQuickItinAsDefault": false
},
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:Payroll": {},
"urn:ietf:params:scim:schemas:extension:spend:2.0:WorkflowPreference": {
"emailStatusChangeOnCashAdvance": true,
"emailAwaitApprovalOnCashAdvance": true,
"emailStatusChangeOnReport": true,
"emailAwaitApprovalOnReport": true,
"promptForApproverOnReportSubmit": false,
"emailStatusChangeOnTravelRequest": true,
"emailAwaitApprovalOnTravelRequest": true,
"promptForApproverOnTravelRequestSubmit": false,
"emailStatusChangeOnPayment": false,
"emailAwaitApprovalOnPayment": false,
"promptForApproverOnPaymentSubmit": false
}
}
Here this the entitlement data for user with user ID as account key given in the same above response.
"urn:ietf:params:scim:schemas:extension:spend:2.0:Role": {
"roles": [
{
"roleName": "REQ_USER"
},
{
"roleName": "EXP_USER"
}
]
},
ID: "id": "123*********************************",
URL for ent params and acctent mappings param: https://us2.api.concursolutions.com/profile/spend/v4/Users/*********
Regards,
Atrayee
05/30/2023 12:38 AM
Hi @AtrayeeDutta
Analyzing the response, I can see that you have incorrectly utilised the processing type in the accountEntParams. Please use httpAcctToEnt as the processing type; samples are available in our REST connector guide. This is because you receive the role information in the response after providing the accountId in the URL.
REST Connector guide->Developers handbook->ImportAccountEntJSON->Processing type->httpAccToEnt
Thank you
Vedanth B.K
06/14/2023 05:29 AM
Hi Vedant,
With processing type as httpAcctToEnt also its not mapping entitlements.
This is just for testing with 1 user id mentioned in url, in case of full import, no ids will be mentioned over url.
Regards
06/15/2023 01:28 AM
Hi @Vedanth_BK ,the above response is for one single user, when importing for bulk all entitlements not coming in and also mapping is not working. As its for all user and acc-id not in url, using processing type as http, able to import all accounts from different URL.Issue coming in ent import for all and mapping. Accounts are from one URL, ent and acc-ent from another, there is no seperate url only for ent import.
I think there is some issue in listfield and paths, tried many ways.
Can you please help on this.
Regards,
Atrayee
06/15/2023 03:20 AM
Hi @AtrayeeDutta ,
Please correct me if I'm wrong, but it appears the GET roles API also offers information about mapped accounts.
Please use the processingtype "entToAcctMapping" if this is the case.
Thank you
Vedanth B.K
06/15/2023 05:42 AM
Hi Vedanth,
What about the list field for ent import and mapping. All ent data and mapping data we are getting from the above response. Is the list field config correct for entparams and actentparams as I have configured in the accentJSON attached above?
Regards,
Atrayee
06/15/2023 08:51 AM
Get roles API is offering all account and inside accounts JSON in response there are roles associated.
07/19/2023 08:34 AM
Can you confirm if this is still and issue or was it fixed.