- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
06-13-2019 12:01 AM
We are trying to add an account to CyberArk via REST API, currently we receive the following message in the PVWA
[03/06/2019 | 12:54:45.005308] | {pid= 2488} | {tid= 5208} | :: | CAWS002E Error occurred: System.NullReferenceException: Object reference not set to an instance of an object.
at au5.a(Exception A_0)at auo.t()at CyberArk.PasswordVault.WebServices.WF.PIMServices.AddAccount(AccountParms account).
We are using the following variables in the body:
@(
@{"Key" = "safe"; "value"= "testacc"}
@{"Key" = "platformID"; "value"= "WinDomain"}
@{"Key" = "address"; "value"= "abc.org"}
@{"Key" = "accountName"; "value"= "Operating Systems-WinDomain-abc.org-testacc"}
@{"Key" = "password"; "value"= "Mez_nwyirT4ajk"}
@{"Key" = "username"; "value"= "tesacc"}
@{"Key" = "disableAutoMgmt"; "value"= "false"}
)
Anyone has any suggestions or an example of adding an account this way
06-13-2019 12:30 AM
Hi @kkr _ Can you please double check the syntax you are using in your request? The request you provide is not in the right format.. ( Its looks like a SOAP request )
Right Syntax should be similar to below :
{
"account" : {
"safe":"P-LIN-ROOT-SSHKEYS",
"platformID":"WinDomain",
"address":"cyberarkdemo.com",
"accountName":"AccountName",
"password":"Password123",
"username":"Svc_BambooHR",
"disableAutoMgmt":"false",
"disableAutoMgmtReason":"N/A",
"groupName":"",
"groupPlatformID":"",
"properties":
[
{"Key":"Port", "Value":"<port>"},
{"Key":"ParamName", "Value":"Parameter value"}
]
}
}
06-13-2019 12:38 AM
@Nirmal, your syntax is based on 'REST'?
06-13-2019 12:38 AM
@Nirmal, your syntax is based on 'REST'?
06-13-2019 01:48 AM
what are you using to run the rest code? postman , powershell or any other stuff? its worth checking out @Pete Maan powershell modules for Rest API automation
06-13-2019 01:57 AM
@kkr _ which API URL are you using in order to attempt to add the account?
https://<IIS_Server_Ip>/PasswordVault/WebServices/PIMServices.svc/Account ?
or
https://<IIS_Server_Ip>/PasswordVault/api/Accounts ?
i.e. Classic API or V10 API?
06-13-2019 02:03 AM
We are using Powershell
06-13-2019 02:07 AM
The classic API: https://<IIS_Server_Ip>/PasswordVault/WebServices/PIMServices.svc/Account
06-13-2019 02:09 AM
As per answer from @Nirmalkumar Dhanaraj - the format of your JSON needs to be corrected.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

