09/19/2023
01:06 AM
- last edited on
09/19/2023
01:50 AM
by
Sunil
Hi Team,
I'm unable to remove account using POST method but able to remove the account using DELETE method. I need to use POST method because need to enable back the account after been disabled. Can you please help to check on this issue. Attached RemoveAccountJSON query for your reference.
Thank you,
Error message :
{"auditDetails":{"Role":[{"headers":{"Keep-Alive":"timeout=5, max=100","Server":"Apache","X-Content-Type-Options":"nosniff","Connection":"Keep-Alive","Date":"Tue, 19 Sep 2023 07:54:41 GMT","Allow":"GET, POST, PUT, PATCH, DELETE","Strict-Transport-Security":"max-age=31536000; includeSubDomains","Cache-Control":"max-age=0","Content-Security-Policy":"frame-ancestors 'self' *.service-now.com","Vary":"Cookie","Set-Cookie":"cookiesession1=678A3E0E07780CAEF504BB84512DA20A;Expires=Wed, 18 Sep 2024 07:54:40 GMT;Path=/;HttpOnly","Content-Length":"83","X-XSS-Protection":"1; mode=block","Content-Type":"application/json"},"message":{"code":405,"errors":[{"message":"Method \"POST\" not allowed."}],"statusCode":405},"statusCode":405,"description":null,"status":"Failed"}]},"Role":{"headers":{"Keep-Alive":"timeout=5, max=100","Server":"Apache","X-Content-Type-Options":"nosniff","Connection":"Keep-Alive","Date":"Tue, 19 Sep 2023 08:02:09 GMT","Allow":"GET, POST, PUT, PATCH, DELETE","Strict-Transport-Security":"max-age=31536000; includeSubDomains","Cache-Control":"max-age=0","Content-Security-Policy":"frame-ancestors 'self' *.service-now.com","Vary":"Cookie","Set-Cookie":"cookiesession1=678A3E0E855682270351550C29903360;Expires=Wed, 18 Sep 2024 08:01:57 GMT;Path=/;HttpOnly","Content-Length":"83","X-XSS-Protection":"1; mode=block","Content-Type":"application/json"},"message":{"code":405,"errors":[{"message":"Method \"POST\" not allowed."}],"statusCode":405},"statusCode":405,"description":null,"status":"Failed"}}
RemoveAccountJSON :
{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [
{
"name": "Role",
"connection": "userAuth",
"url": "https://removed.com.my/api/v3/cmp/users/${account.customproperty8.substring(18,)}",
"httpMethod": "POST",
"httpParams": "{ \"username\": \"${arsTasks.accountName}\",\"firstName\": \"${user.firstname}\",\"lastName\": \"${user.lastname}\",\"email\": \"${user.email}\",\"isActive\": \"false\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"successResponses": {
"httpContentType": "application/json",
"statusCode": [201]
}
}]
}
[This message has been edited by moderator to remove hyperlink to URL]
09/19/2023 07:48 AM
Hi @Isyraf ,
Does the API you mentioned works with POST method if you hit it via postman?
Thanks,
Smitha
09/19/2023 07:59 PM
hi @smitg ,
The POST method work with other json but it didnt work with the RemoveAccountJSON. Only able to use DELETE method. But when I tried to use PATCH method, it will showing this error :
{"Role":{"headers":{"Server":"Apache","X-Content-Type-Options":"nosniff","Connection":"close","Date":"Wed, 20 Sep 2023 02:53:28 GMT","Allow":"GET, POST, PUT, PATCH, DELETE","Strict-Transport-Security":"max-age=31536000; includeSubDomains","Cache-Control":"max-age=0","Content-Security-Policy":"frame-ancestors 'self' *.service-now.com","Vary":"Cookie","Set-Cookie":"cookiesession1=678A3E0E63D831E3EC3C426DBE59AEB4;Expires=Thu, 19 Sep 2024 02:53:28 GMT;Path=/;HttpOnly","Content-Length":"110","X-XSS-Protection":"1; mode=block","Content-Type":"application/json"},"message":{"code":400,"errors":[{"message":"Unsupported media type \"application/x-www-form-urlencoded\" in request."}]},"statusCode":400,"description":null,"status":"Failed"}}
09/19/2023 10:27 PM
@Isyraf In that case REST API you are hitting for remove account JSON supports only 'DELETE' method. Its not the issue with Saviynt
09/21/2023 07:48 PM
Hi @smitg ,
Im getting this error now, can you please help to check on this.
Exception in creating original http params:groovy.lang.MissingMethodException: No signature of method: java.util.LinkedHashMap.startsWith() is applicable for argument types: (java.lang.String) values: [[]
2023-09-22 02:43:56,989 [Thread-184] DEBUG rest.RestProvisioningService - connection: userAuth
2023-09-22 02:43:57,022 [Thread-184] ERROR rest.RestProvisioningService - Error in processWebservicegroovy.lang.MissingMethodException: No signature of method: com.saviynt.provisoning.rest.RestUtilService.getDynamicBindString() is applicable for argument types: (java.util.LinkedHashMap, java.util.HashMap) values: [[isActive:false], [ServiceAccountOwnerMap:[:], ...]]
Possible solutions: getDynamicBindString(java.lang.String, java.util.Map)
09/21/2023 11:11 PM
@Isyraf can you share the latest JSON
09/21/2023
11:38 PM
- last edited on
09/22/2023
12:20 AM
by
Sunil
Hi @smitg ,
This is my latest JSON for importAccountJSON and RemoveAccountJSON. Appreciate your help.
RemoveAccount:
{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://<removed>.com.my/api/v3/cloudbolt/users/${account.customproperty8.substring(18,)}",
"httpMethod": "PATCH",
"httpParams": { "isActive": false },
"httpHeaders": {
"Authorization": "${access_token}"
},
"successResponses": {
"httpContentType": "application/json",
"statusCode": [200]
}
}]
}
ImportAccount:
{
"accountParams": {
"connection": "userAuth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://<removed>.com.my/api/v3/cmp/users/",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "_embedded.users",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "username~#~char",
"displayName": "#CONST#${response._links.self.href != null? response.'firstName'+' '+ response.'lastName' : null}~#~char",
"customproperty2": "email~#~char",
"status": "isActive~#~char",
"customproperty6": "superAdmin~#~char",
"customproperty7": "devopsAdmin~#~char",
"customproperty8": "apiAccess~#~char",
"customproperty9": "globalViewer~#~char",
"customproperty10": "lastActivityTime~#~char",
"customproperty11": "passwordResetQuestion~#~char",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
},
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?._links.next==null?null: 'https://<removed>.com.my'+response.completeResponseMap?._links.next.href }"
}
}
}
}
},
"entitlementParams": {
"processingType": "SequentialAndIterative",
"entTypes": {
"Group": {
"entTypeOrder": 0,
"call": {
"call1": {
"connection": "userAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://<removed>.com.my/api/v3/cmp/groups/?filter=parent:2",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "_embedded.groups",
"keyField": "entitlement_value",
"colsToPropsMap": {
"entitlement_value": "id~#~char",
"displayName": "name~#~char",
"customproperty10": "type~#~char",
"customproperty11": "parent__title~#~char"
},
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?._links.next==null?null: 'https://<removed>.com.my'+response.completeResponseMap?._links.next.href}"
}
},
"disableDeletedEntitlements": true
}
}
}
}
},
"acctEntParams": {
"connection": "userAuth",
"entTypes": {
"Group": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"processingType": "httpEnttoAcct",
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://<removed>.com.my/api/v3/cmp/groups/",
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"listField": "_embedded.groups",
"entKeyField": "entitlement_value",
"acctIdPath": "user_id",
"acctKeyField": "accountID"
}
}
}
}
}
}
[This message has been edited by moderator to mask url]
11/28/2023 04:04 AM
Were you able to find the solution to this? thanks
11/28/2023 04:47 AM
Share postman response