Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/01/2024 12:49 AM - last edited on 07/01/2024 01:14 AM by Sunil
Hi All,
We have a REST connector based application integration, where we have tried connecting the application using the below JSON and is was resolved with Connection Successful update.
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Authentication": "xxxxxxxxxxxxxxxxxxxx",
"Accept": "application/json"
},
"authError": [
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"url": "https://xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"httpMethod": "GET",
"httpContentType": "application/json",
"errorPath": "errorCode",
"maxRefreshTryCount": 5,
"tokenResponsePath": "",
"tokenType": "Bearer",
"authHeaderName": "",
"accessToken": "bearerabc",
"retryFailureStatusCode": [
401,
403
]
}
}
}
But while we try to pull the data using the below importjson, it did not work. Although the job is showing success, but the results are not coming up.
IMPORTJSON
{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"includeExistingInActiveAccounts": true,
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://XXXXXXXXXXXXXXXXXXXXXXXXXX",
"httpHeaders": {
"Authentication": "XXXXXXXXXXXXXXXXXXXXXX",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "id~#~char",
"displayName": "name~#~char",
"customproperty1": "id~#~char",
"customproperty2": "name~#~char",
"customproperty3": "email~#~char",
"customproperty4": "application~#~char"
}
}
}
}
}
But when we run the GET command in the POSTMAN it gives us proper response as we shared with you.
Please find the response format of the data, whereas we are just pulling id, name, email and application attribute as of now.
{
"id": "xxxxx",
"name": "xxxx",
"email": "xxxxxxxx",
"application": "xxxxx",
"entitlements": [
{
"id": "xxxx"
},
{
"id": "xxxxx"
}
]
}
Request you to please suggest some ways to pull the data. Also please verify if the importjson needs some update.
Also please find the attached log for reference.
Please find the new thread.
Thanks
[This message has been edited by moderator to merge reply comment]
Solved! Go to Solution.
07/01/2024 09:59 AM
{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"includeExistingInActiveAccounts": true,
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://XXXXXXXXXXXXXXXXXXXXXXXXXX",
"httpHeaders": {
"Authorization": "Bearer ${accessToken}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"keyField": "id",
"colsToPropsMap": {
"id": "accountID~#~char",
"name": "displayName~#~char",
"email": "customproperty3~#~char",
"application": "customproperty4~#~char"
}
}
}
}
}
Key changes and points to consider:
07/01/2024 10:36 AM
Hi @rushikeshvartak ,
Thanks for the update. I have checked it, but please not while we pass Authorization as a header for teh API , it gives 401 , as per the app team we need to pass Authentication as a header name.
I checked the details as suggested by you, and also passed the API key in the access token, but it did not work.
It gave 401 error.
Below are the error lines:
07/01/2024 10:39 AM
Pass both Authentication and Authorization
07/01/2024 11:00 AM
Hi @rushikeshvartak ,
Same out put, this is what we are trying.
ConnectionJSOn:
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json",
"Authentication": "xxxxxxxxxxkeyxxxxxxxx"
},
"authError": [
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"url": "https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"httpMethod": "GET",
"httpContentType": "application/json",
"errorPath": "errorCode",
"maxRefreshTryCount": 5,
"tokenResponsePath": "",
"tokenType": "Bearer",
"authHeaderName": "",
"accessToken": "abc",
"retryFailureStatusCode": [
401,
403
]
}
}
}
Importjson
{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"includeExistingInActiveAccounts": true,
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"httpHeaders": {
"Authentication": "xxxxxxxxxxxxxxxkeyxxxxxxxxxxxxxxxxxxxxxxxx",
"Authorization": "Bearer ${accessToken}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"keyField": "id",
"colsToPropsMap": {
"id": "accountID~#~char",
"name": "displayName~#~char",
"email": "customproperty3~#~char",
"application": "customproperty4~#~char"
}
}
}
}
}
Still the job goes into error state. And its the same error that comes up. If i try to pass in postman also with both the Authentication and Authorization, it throws me 401.
Attaching postman output for reference.
Please suggest.
Thanks
07/01/2024 11:16 AM
GET is not supported in Connection JSON . Use GETWITHBODY
07/01/2024 11:33 AM
hI @rushikeshvartak ,
No change, same response, the job fails with an error same as the earlier. Please suggest.
Thanks
07/01/2024 11:36 AM
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/02/2024 01:36 AM
07/02/2024 08:37 AM
Hi @rushikeshvartak ,
Any update from your end?
Thanks and appreciate your help on this.
We have also requested the App team if we can modify the header name to Authorization for the API, but that is not possible it seems.
07/02/2024 11:11 AM
Authorization is supported Authentication method by Saviynt. Please get it updated by App team
07/03/2024 12:22 AM
Hi @rushikeshvartak ,
Can you please share any reference document concluding this, so that we can share it with the App team as a reference.
Thanks
07/04/2024 05:11 PM
Refer https://docs.saviyntcloud.com/bundle/Dev-Handbook-REST-v24x/page/Content/Developers-Handbook.htm