Example adding account

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Example adding account

L1 Bithead

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

10 REPLIES 10

L5 Sessionator

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"}

]

}

}

 

@Nirmal, your syntax is based on 'REST'?

@Nirmal, your syntax is based on 'REST'?

L6 Presenter

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

L4 Transporter

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

L6 Presenter

@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?

 

We are using Powershell

The classic API: https://<IIS_Server_Ip>/PasswordVault/WebServices/PIMServices.svc/Account

As per answer from @Nirmalkumar Dhanaraj​ - the format of your JSON needs to be corrected.

Yes..

  • 653 Views
  • 10 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!