07/26/2023 03:10 AM
This is the error I see in the logs. What am I doing wrong?
FYI API is working through postman with Basic auth.
Solved! Go to Solution.
07/26/2023 03:18 AM
Hi @anuragG ,
Check your token response path is correct or not.
"tokenResponsePath": "access_token",
Share authentication response you are getting in postman.
07/26/2023 04:43 AM - edited 07/26/2023 04:45 AM
@pmahalle The API does not have response when authenticated -
And API is working from postman, for eg, in 2nd picture, you can see attribute XGUID - ADWPM2 with Status 200.
Same is getting populated in the target table-
07/26/2023 04:59 AM
@anuragG can you try with the below JSON?
{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "<URL>",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"userName": "<username>",
"password": "<pass>"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic WFJYX1dQUl3c1XndkRjkjeGg3",
"retryFailureStatusCode": [
401
],
"apiRateLimitConfig": {
"retryAfterCalls": 100,
"retryWaitSeconds": 60
}
}
}
}
07/26/2023 05:46 AM
hi @naveenss Issue still persists, still getting the below error-
2023-07-26 12:31:02,019 [quartzScheduler_Worker-5] ERROR rest.RestProvisioningService - Access Token is null..
07/26/2023 05:49 AM
@anuragG are you getting this in the createAccount JSON? can you please share the JSON you're using. Not the connection JSON btw.
07/26/2023 05:57 AM - edited 07/26/2023 05:59 AM
@naveenss Yes, PFB createacc JSON below-
{
"accountIdPath": "accountName",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "<url>",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${com.adw.PersonStatus.Personstatus(user.customproperty49)}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"${com.adw.CountryCodeConverter_2.convertToThreeLetterCode(user.customproperty3)}\", \"COMPANY\": \"${user.companyname}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"${com.adw.ManagerData.Mdp(user.owner.toString())}\", \"MANAGER_XGUID\": \"${com.adw.ManagerData.xguid(user.owner.toString())}\", \"TIME_STAMP\": \"${com.adw.SystemDateCalculator.getFormattedSystemDate()}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"successResponses": {
"statusCode": [200]
}
}]
}
07/26/2023 06:00 AM
Hi @anuragG I see the connectionName in connnection JSON is acctAuth. but in create acc json, it is userAuth. Please change it to "acctAuth" like below and retry again.
"connection": "acctAuth"
07/26/2023 06:08 AM
@anuragG Connection name is wrong in createaccount json. Correct it as per the connection json.
"connection": "acctAuth"