and more in a single search tool across platforms. Read the announcement here. |
12/05/2023 09:19 PM
Hello Team,
In a REST connection. I defined some variables in ConnectionJSON and tried to use them in ImportAccountEntJSON.
httpParams contained multiple parameters, host, port and authMethod should be from ConnectionJSON via binding variables. There are also additional parameters.
when I included dollar sign $ as value (in my example, it is "$T") in any of the additional parameters, it will cause the variables binding not working.
value of host will become "${connection.ConnectionInfo.host}" instead of the value "host70.ca" from ConnectionJSON.
if I removed the value with dollar sign, variables binding worked.
Do I need to escape $? I tried \\$, but it did not worked.
Below is the details of ConnectionJSON and ImportAccountEntJSON
"ConnectionJSON": {
"authentications": {
"OSService": {
"authType": "oauth2",
"url": "https://hostname/api/TestConnection",
"httpParams": {
"password": "Snp@ssw0rd",
"grant_type": "password",
"scope": "useraccount",
"client_id": "3c774f2fb7e83110cdb30652042d0ba9",
"client_secret": "`$v9R3m7[O",
"username": "admin"
},
"ConnectionInfo": {
"host": "host70.ca",
"port": "443",
"authMethod": "password"
} ,
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded" },
"authError": [
"InvalidAuthenticationToken" ],
"httpMethod": "POST",
"httpContentType": "application/x-www-form-urlencoded",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"retryFailureStatusCode": [401],
"accessToken": "Bearer token"
}
}
}
"ImportAccountEntJSON": {
"accountParams": {
"processingType":"SequentialAndIterative",
"connection": "OSService",
"createUsers": false,
"call": {
"call1": {
"http": {
"url": "https://hostname/api/getAllUsers",
"basicUrl": "<domain name>",
"hostUrl": "/api/getAllUsers",
"httpContentType": "application/json",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpParams": "{\"connectionInfo\": {\"host\": \"${connection.ConnectionInfo.host}\",
\"port\": \"${connection.ConnectionInfo.port}\",
\"authMethod\": \"${connection.ConnectionInfo.authMethod}\"
},\"customFilter\": {\"attribute_name\": \"uid\", \"filter_operator\": \"notstartswith\", \"values\": [\"T\", \"@T\", \"$T\"]}
}"
},
"listField": "result",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "uid~#~char",
"name": "username~#~char",
"displayName": "username~#~char",
"status": "#CONST#true~#~char"
}}}
}
}
Thanks in advance.
Regards,
Lynn
12/05/2023 10:03 PM - edited 12/05/2023 10:04 PM
Hello @Lynn,
Can you provide the screenshot of the Body of HTTP Paramater from the ImportAccountEntJSON,
Also to pass the information from the connection json to importaccountjson, woud be as as below..
"ConnectionJSON": {
"authentications": {
"OSService": {
"authType": "oauth2",
"url": "https://hostname/api/TestConnection",
"httpParams": {
"password": "Snp@ssw0rd",
"grant_type": "password",
"scope": "useraccount",
"client_id": "3c774f2fb7e83110cdb30652042d0ba9",
"client_secret": "`$v9R3m7[O",
"username": "admin"
},
"host": "host70.ca",
"port": "443",
"authMethod": "password"
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"authError": [
"InvalidAuthenticationToken"],
"httpMethod": "POST",
"httpContentType": "application/x-www-form-urlencoded",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"retryFailureStatusCode": [401],
"accessToken": "Bearer token"
}
}
}
"ImportAccountEntJSON": {
"accountParams": {
"processingType": "SequentialAndIterative",
"connection": "OSService",
"createUsers": false,
"call": {
"call1": {
"http": {
"url": "https://hostname/api/getAllUsers",
"basicUrl": "<domain name>",
"hostUrl": "/api/getAllUsers",
"httpContentType": "application/json",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpParams": "{\"connectionInfo\": {\"host\": \"${connection.host}\",
\"port\": \"${connection.port}\",
\"authMethod\": \"${connection.authMethod}\"
},\"customFilter\": {\"attribute_name\": \"uid\", \"filter_operator\": \"notstartswith\", \"values\": [\"T\", \"@T\", \"$T\"]}
}"
},
"listField": "result",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "uid~#~char",
"name": "username~#~char",
"displayName": "username~#~char",
"status": "#CONST#true~#~char"
}
}
}
}
}
Thanks.
12/06/2023 06:48 AM - edited 12/06/2023 06:49 AM
Hello @sudeshjaiswal ,
I tried your suggestion, but still got the same issue.
Below is the screenshot of postman, postman is working fine. the issue is the variable binding for $.
Many thanks.
Regards,
Lynn
12/06/2023 07:17 AM
12/06/2023 08:00 AM
\\$ is working:
Regards,
Lynn
12/06/2023 11:39 AM
12/06/2023 03:48 PM
\\$ Should work & its expected to escape character. $ character is used by product to evaluate dynamic value in connector hence its expected and not bug.
12/07/2023 06:46 AM