07/26/2023 05:27 AM
Hi ,
In our API call for users list we have a combination of basic auth credentials and access token to retrieve users.
The following is the connection json for the same , please suggest what shall be the way to inculcate the both authorizations in the user import api call
error we get while doing a save&test connection is 401 unauthrorized
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://<URL>",
"httpMethod": "POST",
"httpParams": {"client_id": "<clientid>",
"client_secret": "<clientsecret>",
"grant_type": "client_credentials"},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "Couldn't authenticate you",
"authError": [
"Couldn't authenticate you"
],
"timeOutError": "Read timed out",
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Beare 5RQX5CgeakC",
"testConnectionParams": {
"http": {
"url": "https://<URL>",
"httpHeaders": {
"Authorization": "${access_token}",
"APIKey": "<APIKEY>",
"Content-Type": "application/json",
"Accept": "application/json",
"USERNAME": "<username>",
"PASSWORD": "<password>"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"successResponse": [
200
],
"successResponsePath": "",
"errors": [
"Couldn't authenticate you"
],
"errorPath": "error"
}
}
}
}
07/26/2023 05:33 AM - edited 07/26/2023 05:34 AM
Hi @Abdul_Gaffar can you please try with the below JSON? I have added the retryFailureStatusCode
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://<URL>",
"httpMethod": "POST",
"httpParams": {
"client_id": "<clientid>",
"client_secret": "<clientsecret>",
"grant_type": "client_credentials"
},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "Couldn't authenticate you",
"authError": [
"Couldn't authenticate you"
],
"timeOutError": "Read timed out",
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abcd",
"retryFailureStatusCode": [
401
],
"testConnectionParams": {
"http": {
"url": "https://<URL>",
"httpHeaders": {
"Authorization": "${access_token}",
"APIKey": "<APIKEY>",
"Content-Type": "application/json",
"Accept": "application/json",
"USERNAME": "<username>",
"PASSWORD": "<password>"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"successResponse": [
200
],
"successResponsePath": "",
"errors": [
"Couldn't authenticate you"
],
"errorPath": "error"
}
}
}
}