and more in a single search tool across platforms. Read the announcement here. |
07/08/2024 07:30 AM - edited 07/08/2024 10:33 PM
Hi,
I am trying to import entitlements in REST connector. There are 2 calls to get the entitlement data including pagination.
I want to use the response of CALL1 in the URL of CALL2 for ex:
Call 1 response:
Call 2 url: https://x.apis.com/big/v2/projects/ric-dev/queries/job_KkVNnGaDRWoiq7my_fXLiHIZ?pageToken=BFA6URMHSAAQAA...................&maxResults=40&timeoutMs=10
I want to utilize the jobid and pageToken in the URL of next call
I tried below approach but its giving error
Error:
Json:
"entTypes": {
"business_area": {
"entTypeOrder": 0,
"call": {
"call1": {
"showJobHistory": true,
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://x.apis.com/big/v2/projects/ric-dev/queries",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpParams": "{\"defaultDataset\": {\"datasetId\": \"aditya\", \"projectId\": \"ric-dev\"}, \"dryRun\": false, \"kind\": \"bigquery#queryRequest\", \"maxResults\": 0, \"preserveNulls\": false, \"query\": \"SELECT id,attribute_id,attribute_value,attribute_value_displaytext,attribute_value_description FROM scm_attribute_values where attribute_id in (1)\", \"timeoutMs\": 10, \"useLegacySql\": false, \"useQueryCache\": true}",
"httpContentType": "application/json",
"httpMethod": "POST"
},
"disableDeletedEntitlements": true
},
"call2": {
"showJobHistory": true,
"callOrder": 1,
"stageNumber": 1,
"http": {
"url": "https://x.apis.com/big/v2/projects/ric-dev/queries/${response?.call1?.jobReference?.jobId}?pageToken...",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"listField": "rows.f",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "v[0]~#~char",
"entitlement_value": "v[0]~#~char",
"DISPLAYNAME": "v[2]~#~char",
"DESCRIPTION": "v[3]~#~char",
"ENTITLEMENT_GLOSSARY": "v[4]~#~char",
"acctEntMappingInfoColumnFromEnt": "STORE#ACC#ENT#MAPPINGINFO~#~char"
},
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.pageToken==null?null:'https://x.apis.com/big/v2/projects/ric-dev/queries/' + response?.completeResponseMap?.jobReference.jobId + '?pageToken=' + response?.completeResponseMap?.pageToken + '&maxResults=10&timeoutMs=10'}"
}
},
"disableDeletedEntitlements": true
}
}
}
}
Thanks,
Aditya
07/08/2024 11:43 AM
Call 1 response does not seems complete
Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️
07/09/2024 05:54 AM - edited 07/09/2024 05:55 AM
Hi Rushikesh,
The Json is working fine when I hardcode the Job ID and Page token values in URL like below:
It is not resolving the variables
Error:
Got null response statusCode with erroMsg - [error:Error Illegal character in path at index 85: https://dummy.com/queries/${response.call1.jobReference.jobId}?pageToken=${response.call1.pageToken}...]
Below is postman response of call1:
cURL for call1:
curl --location 'https://dummy.com/queries' \
--header 'Content-Type: application/json' \
--header 'Authorization: XXX' \
--data '{
"defaultDataset": {
"datasetId": "iam",
"projectId": "p1"
},
"dryRun": false,
"kind": "q#queryRequest",
"location": "",
"maxResults": 1,
"parameterMode": "",
"preserveNulls": false,
"query": "SELECT id FROM scm_attribute_values where attribute_id in (1)",
"timeoutMs": 10,
"useLegacySql": false,
"useQueryCache": true
}'
cURL for call2:
curl --location 'https://dummy.com/queries/job_M2DC?pageToken=BGHIA&maxResults=2&timeoutMs=10&location=europe-west3' \
--header 'Authorization: XXX' \
--data ''
I have attached the import Json for reference.
Thanks,
Aditya Verma
07/22/2024 07:06 AM
07/22/2024 09:07 AM
{
"accountParams": {},
"entitlementParams": {
"connection": "oauthConnection",
"processingType": "SequentialAndIterative",
"successResponses": {
"statusCode": [200]
},
"entTypes": {
"business_area": {
"entTypeOrder": 0,
"call": {
"call1": {
"showJobHistory": true,
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://dummy.com/queries",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpParams": "{\"defaultDataset\": {\"datasetId\": \"iam\", \"projectId\": \"project\"}, \"dryRun\": false, \"kind\": \"q#queryRequest\", \"maxResults\": 20, \"preserveNulls\": false, \"query\": \"SELECT id,attribute_id,attribute_value,attribute_value_displaytext,attribute_value_description FROM scm_attribute_values where attribute_id in (1)\", \"timeoutMs\": 10, \"useLegacySql\": false, \"useQueryCache\": true}",
"httpContentType": "application/json",
"httpMethod": "POST"
},
"listField": "rows.f",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "v[0]~#~char",
"entitlement_value": "v[0]~#~char",
"DISPLAYNAME": "v[2]~#~char",
"DESCRIPTION": "v[3]~#~char",
"ENTITLEMENT_GLOSSARY": "v[4]~#~char"
},
"disableDeletedEntitlements": true
},
"call2": {
"showJobHistory": true,
"callOrder": 1,
"stageNumber": 2,
"http": {
"url": "https://dummy.com/queries/${response.call1.jobReference.jobId}?pageToken=${response.call1.pageToken}&maxResults=20&timeoutMs=10&location=europe-west3",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"inputParams": {
"entitlementname": "business_area"
},
"listField": "rows.f",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "v[0]~#~char",
"entitlement_value": "v[0]~#~char",
"DISPLAYNAME": "v[2]~#~char",
"DESCRIPTION": "v[3]~#~char",
"ENTITLEMENT_GLOSSARY": "v[4]~#~char"
},
"pagination": {
"nextUrl": {
"nextUrlPath": "${response.call1.pageToken == null ? null : 'https://dummy.com/queries/' + response.call1.jobReference.jobId + '?pageToken=' + response.call1.pageToken + '&maxResults=2&timeoutMs=10&location=europe-west3'}"
}
},
"disableDeletedEntitlements": true
}
}
}
}
},
"acctEntParams": {}
}
07/29/2024 12:04 PM
Hi @rushikeshvartak ,
The pagination block was working fine, I am facing issue in the URL of call2.
The response variable is not resolving in the URL:
"call2": {
"showJobHistory": true,
"callOrder": 1,
"stageNumber": 2,
"http": {
"url": "https://dummy.com/queries/${response.call1.jobReference.jobId}?pageToken=${response.call1.pageToken}&maxResults=20&timeoutMs=10&location=europe-west3",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
}
Let me know how I can resolve this.
Thanks,
Aditya
07/29/2024 12:14 PM
${response.call1.message.jobReference.jobId}
07/31/2024 01:58 AM - edited 07/31/2024 01:59 AM
Hi @rushikeshvartak ,
I am getting below error in logs, I have put this variable in the URL ${response.call1.message.jobReference.jobId}
I think the URL is not resolving the dynamic variable "${}"
URL:
"url": "https://dummy.com/ric-dev4x1/queries/${response.call1.message.jobReference.jobId}?pageToken=${response.call1.message.pageToken}&maxResults=20&timeoutMs=10&location=europe-west3"
Error:
Got Webservice API Response: [error:Error Illegal character in path at index 85: https://dummy.com/ric-dev-n-auth-hub-4x1/queries/${response.call1.message.jobReference.jobId}?pageTo...]
Got null response statusCode with erroMsg - [error:Error Illegal character in path at index 85: https://dummy.com/ric-dev-n-auth-hub-4x1/queries/${response.call1.message.jobReference.jobId}?pageTo...]
Error while getting Access Import response for entType- business_area, url- https://dummy.com/ric-dev-4x1/queries/${response.call1.message.jobReference.jobId}?pageToken=${respo... is: null
I am attaching the import json for reference. (line 90)
Thanks,
Aditya