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

enable to read call1 variables

iam01
Regular Contributor
Regular Contributor

i am invoking 2 APIs in updateuser json. Am facing issue with second invocation. Call1 am getting the access_token and am unable to pass the token in call2.

 

CALL1 RESPONSE:

 

 

 

"ERROR","Call response: {"access_token":"eyJ0eXAiOPZja1T6X9WWMs__zM53M3wz2CY2cRVmKhRlT7Zc1v3LHTfvg2citx2qZHh6hFvm-Xd_7ywfxqcgYU7gERTBxwYa1LVyWH0KAcfoiA3TGPDlSctQ0dN116eqLi2iUPkaT3Foot--rIrEpd0WEW75J1DkAzQBz1dlkDdqogLvlUL-LQ","expires_in":299,"scope":"rsts:sts:primaryproviderid:local:pwd","success":true,"token_type":"Bearer"}"


"ERROR","callResponseMap: [access_token:eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6InJIc1NFNEhhVlQ3UEJJTEFQMS0wNEVITXRrUSJ9.eyJpc3MiOiJodHRwczovL0FDN0IxMjEzODFEQTU1M0VDRjA0ODJDMDNGNUZCNEUwNDFDQ0I2NDQiLCJuYmYiOjE3MTA4ODMxMTAsImV4cCI6MTcxMDg4MzQxMCwiYXV0aG1ldGCY2cRVmKhRlT7Zc1v3LHTfvg2citx2qZHh6hFvm-Xd_7ywfxqcgYU7gERTBxwYa1LVyWH0KAcfoiA3TGPDlSctQ0dN116eqLi2iUPkaT3Foot--rIrEpd0WEW75J1DkAzQBz1dlkDdqogLvlUL-LQ, expires_in:299, scope:rsts:sts:primaryproviderid:local:pwd, success:true, token_type:Bearer]"

 

 

 



CALL2 ERROR:

 

 

 

"DEBUG","Got Webservice API Response: [error:Error Illegal character in path at index 72: https://d/v4/Token/${response.call1.message.access_token}]"

"ERROR","Exception in getting response in pullObjectsByRest :"
"java.lang.Exception: NullResponseFromTarget at

 

 

 

JSON:

 

 

 

{
"actions": {
"Update Login": {
"call": [
{
"name": "call1",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://ddd/oauth2/token",
"httpMethod": "POST",
"httpParams": "{\"grant_type\":\"password\",\"scope\":\"local\",\"username\":\"dddd\",\"password\":\"dddd\"}",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://d/v4/Token/${response.call1.message.access_token}",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpParams": {},
"successResponses": {
"statusCode": [
200
]
}
}
]
}
}
}

 

 

 

14 REPLIES 14

rushikeshvartak
All-Star
All-Star

Does Call 2 works in postman 

Suspecting special characters issue.


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

yes call2 work in postman.

iam01
Regular Contributor
Regular Contributor

anyway possible to fix this? i did tried URLEncode method but no luck

 

regards,

Sajid

Falcon
Saviynt Employee
Saviynt Employee

Not sure if it makes any difference but you have empty params in call. Also check if the response from call1 is a valid access token that conforms to the standard - https://jwt.io/

iam01
Regular Contributor
Regular Contributor

Falcon, I can see the response in saviynt logs.  When you said empty params where did you see that information.

 

ERROR","Call response: {"access_token":"eyJ0eXAiOPZja1T6X9WWMs__zM53M3wz2CY2cRVmKhRlT7Zc1v3LHTfvg2citx2qZHh6hFvm-Xd_7ywfxqcgYU7gERTBxwYa1LVyWH0KAcfoiA3TGPDlSctQ0dN116eqLi2iUPkaT3Foot--rIrEpd0WEW75J1DkAzQBz1dlkDdqogLvlUL-LQ","expires_in":299,"scope":"rsts:sts:primaryproviderid:local:pwd","success":true,"token_type":"Bearer"}"


"ERROR","callResponseMap: [access_token:eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6InJIc1NFNEhhVlQ3UEJJTEFQMS0wNEVITXRrUSJ9.eyJpc3MiOiJodHRwczovL0FDN0IxMjEzODFEQTU1M0VDRjA0ODJDMDNGNUZCNEUwNDFDQ0I2NDQiLCJuYmYiOjE3MTA4ODMxMTAsImV4cCI6MTcxMDg4MzQxMCwiYXV0aG1ldGCY2cRVmKhRlT7Zc1v3LHTfvg2citx2qZHh6hFvm-Xd_7ywfxqcgYU7gERTBxwYa1LVyWH0KAcfoiA3TGPDlSctQ0dN116eqLi2iUPkaT3Foot--rIrEpd0WEW75J1DkAzQBz1dlkDdqogLvlUL-LQ, expires_in:299, scope:rsts:sts:primaryproviderid:local:pwd, success:true, token_type:Bearer]"

 

 

{
"actions": {
"Update Login": {
"call": [
{
"name": "call1",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://ddd/oauth2/token",
"httpMethod": "POST",
"httpParams": "{\"grant_type\":\"password\",\"scope\":\"local\",\"username\":\"dddd\",\"password\":\"dddd\"}",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://d/v4/Token/${response.call1.message.access_token}",
"httpMethod": "POST",
"httpContentType": "application/json",
 
"httpHeaders": {
"Content-Type": "application/json","Authorization": "${access_token}"
},
"httpParams": {},
"successResponses": {
"statusCode": [
200
]
}
}
]
}
}
}

 


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

iam01
Regular Contributor
Regular Contributor

I suspect this path.

${response.call1.message

 Is this correct path/variable? 

adarshk
Saviynt Employee
Saviynt Employee

Set "Authorization": "${access_token}"

iam01
Regular Contributor
Regular Contributor

@adarshk, the second call don't need authorization header and the concern was why this variable is not resolving.

 

 

In url instead of token I tried scope, token_type just to See if the value getting resolved but it's not resolving.

@rushikeshvartak  authorization header is not required for the second call.

 

@Falcon I to feel the same. I checked in jwt.io and it gets resolved. However if you you look at the response along with token it contains scope and token_type. I even tried with scope and token_type just to see if it's get resolved but no luck. Any idea what's causing it? Today I will try the same json with different APIs just to make sure it's not a json issue.

 

Even though its not needed saviynt every call have set of mandatory fields hence you can’t skip


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

Ha interesting, will update you shortly.

@rushikeshvartak out of scope question, for the APIs basically which have different names for authorization header. Example: for okta it's a ststoken. 

Now in this case, we have to pass both ststoken header and authorization header ?

iam01
Regular Contributor
Regular Contributor

@adarshk @rushikeshvartak @Falcon 

Could you please try this in your test envs. Thanks in advance

===================

Fake APIs available on internethttps://reqres.in/

 

{
"actions": {
"Update Login": {
"call": [
{
"name": "call1",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://reqres.in/api/user",
"httpMethod": "POST",
"httpParams":"{\"name\": \"mm\" }",
"httpHeaders": {
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
},
{
"name": "call",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://reqres.in/api/user",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "123",
"Content-Type": "application/json"
},
"httpParams": "{\"name\": \"${response.call1.message.id}\" }",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
}
}

{
"actions": {
"Update Login": {
"call": [
{
"name": "Update Login",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://reqres.in/api/user",
"httpMethod": "POST",
"httpParams":"{\"name\": \"mm\" }",
"httpHeaders": {
"Content-Type": "application/json","Authorization": "123"

},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
},
{
"name": "Update Login",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://reqres.in/api/user",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "123",
"Content-Type": "application/json"
},
"httpParams": "{\"name\": \"${response.call1.message.id}\" }",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
}
}


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