RESTful API109 minutes to read
IntroductionPAM360 APIs allow you to connect, interact and integrate with PAM360 directly. The APIs belong to the REpresentational State Transfer (REST) category. PAM360 APIs use the GET, PUT, and POST methods to offer a wide range of operations such as creating resources and adding accounts to them, adding SSL certificates and SSH keys, associating SSH keys with resources, retrieving passwords, retrieving resource/account details, updating passwords programmatically, sharing resources/accounts to users and so on. PrerequisiteCreating API user accounts is the first step in the process of configuring REST APIs for Application-to-Application password management. Click here to know how to create an API user account. APIs SummaryMethods Used to Invoke APIsGETTo fetch resources, accounts, passwords, account/resource details PUTTo change a password POSTTo create new resource and accounts How to Make Use of the APIs?Invoking the APIsThe APIs can be invoked via HTTP POST, GET and PUT requests. All parameters in the request should be form-urlencoded. For all the APIs you need to pass the AUTH token, which is mandatory. Supported FormatPAM360 supports the JSON format and the URL structure for it is given below: URLhttps://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID> HeaderAUTHTOKEN=<<Authtoken_generated_from_PAM360>> PAM360 provides a wide range of APIs to:
Note: Please note that each API call made to the PAM360 server requires the authentication token (AUTHTOKEN) to be passed in the request header only. 1. Resources1.1 Get the Resources Owned and Shared to a UserDescriptionTo get the list of resources which are owned by or shared to an API user. URLhttps://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources Header AUTHTOKEN=<<Authtoken_generated_from_PAM360>> HTTP MethodGET Input DataNone Sample Requestcurl -k -H "AUTHTOKEN:<<Authtoken_generated_from_PAM360>>"https://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources Sample OutputIn the output (as shown in the sample below), you will get all the resources owned and shared by the specific API user. { 1.2 Create a New ResourceDescriptionTo create a new resource in PAM360. Input DataYou need to pass input data such as name of the resource, account name, resource type, password, URL, description, notes and any other additional fields at the resource and account levels. You can add as many as 40 custom fields (20 each at resource and account levels). Of these, resource name, account name, resource type and password are mandatory. INPUT_DATA={ URLhttps://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources HeaderAUTHTOKEN=<<Authtoken_generated_from_PAM360>> HTTP MethodPOST Sample Requestcurl -X POST -k -H "AUTHTOKEN:<<Authtoken_generated_from_PAM360>>" -H "content-Type: text/json" https://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources --data-urlencode "INPUT_DATA={\"operation\":{\"Details\":{\"RESOURCENAME\":\"Windows Server\",\"ACCOUNTNAME\":\"Administrator\",\"RESOURCETYPE\":\"Windows\",\"PASSWORD\" :\"Test@123\",\"RESOURCEPASSWORDPOLICY\":\"Strong\",\"ACCOUNTPASSWORDPOLICY\":\"Strong\",\"RESOURCECUSTOMFIELD\":[{\"CUSTOMLABEL\":\"Secure Resource\",\"CUSTOMVALUE\":\"YES\"}],\"ACCOUNTCUSTOMFIELD\":[{\"CUSTOMLABEL\":\"Secure Account\",\"CUSTOMVALUE\":\"YES\"}]}}}" Sample Output {"operation":{ Note: If you want to add a new resource under Administrator/Password Administrator/Privileged Administrator an additional parameter "OWNERNAME" having the value of that particular user should be added to the resource details. While adding the resource to AD user, the username must be in the format "Domain-Name\\UserName". INPUT_DATA={ "operation":{ "Details":{ "RESOURCENAME":"Windows Server", "ACCOUNTNAME":"Administrator", "RESOURCETYPE":"Windows", "PASSWORD":"Test@123", "NOTES":"Testing API", "RESOURCEURL":"http://windowsserver/adminconsole", "OWNERNAME":"admin", "RESOURCECUSTOMFIELD":[ { "CUSTOMLABEL":"Secure Resource", "CUSTOMVALUE":"YES" } ], "ACCOUNTCUSTOMFIELD":[ { "CUSTOMLABEL":"Secure Account", "CUSTOMVALUE":"YES" } ] } } } Note: If you want to add a resource to a static resource group, an additional parameter "RESOURCEGROUPNAME" having the value of that particular resource group should be added to the resource creation input. If the group already exists, this resource will be added to that group; otherwise, a new group with the name specified here will be created. INPUT_DATA={ "operation":{ "Details":{ "RESOURCENAME":"Windows Server", "ACCOUNTNAME":"Administrator", "RESOURCETYPE":"Windows", "PASSWORD":"Test123#@!", "NOTES":"Testing API", "RESOURCEURL":"http://windowsserver/adminconsole", "RESOURCEGROUPNAME":"Windows Servers", "RESOURCECUSTOMFIELD":[ { "CUSTOMLABEL":"Secure Resource", "CUSTOMVALUE":"YES" } ], "ACCOUNTCUSTOMFIELD":[ { "CUSTOMLABEL":"Secure Account", "CUSTOMVALUE":"YES" } ] } } } Note: You can also add files as a separate resource in PAM360. To add a file as a new resource, the 'Content-Type' in the request has to be modified as shown in the sample below. Once you have modified, you just have to pass the file along with it. INPUT_DATA={ "operation":{ "Details":{ "RESOURCENAME":"Active Directory", "ACCOUNTNAME":"Administrator", "RESOURCETYPE":"License Store", "PASSWORD":"Test123#@!", "NOTES":"Testing API", "RESOURCEURL":"http://windowsserver/adminconsole" } } } Sample Requestcurl -X POST -k -H "Content-Type: multipart/form-data" -F 'file=@standalonesample.txt' -F 'INPUT_DATA={"operation":{"Details":{"RESOURCENAME":"Windows erver","ACCOUNTNAME":"Administrator","RESOURCETYPE":"File Store", "PASSWORD":"Test123#@!","NOTES":"Testing API","RESOURCEURL":"http://windowsserver/adminconsole"}}}' 'https://<Host-Name-of-PAM360-Server OR IP address>ort>/ restapi/json/v1/resources?AUTHTOKEN=<<Authtoken_generated_from_PAM360>> 1.3 Get the Resource ID using the Resource NameDescriptionTo fetch the resource ID, you can provide the resource name alone in the URL. URLhttps://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/resourcename/{RESOURCENAME} HeaderAUTHTOKEN=<<Authtoken_generated_from_PAM360>> HTTP MethodGET Input DataNone Sample Requestcurl -k -H "AUTHTOKEN:<<Authtoken_generated_from_PAM360>>"https://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/resourcename/test Sample Output{"operation":{"name": "GET_RESOURCEID","result":{"status": "Success","message": "Resource ID fetched successfully for the given resource name."}, "Details":{"RESOURCEID": "1"}} 1.4 Delete a Resource in PAM360DescriptionTo delete a resource for the given resource ID. Resource ID can be obtained from the GET RESOURCES API (explained above). URLhttps://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/{resourceid} HeaderAUTHTOKEN=<<Authtoken_generated_from_PAM360>> HTTP MethodDELETE Input DataNone Sample Requestcurl -X DELETE -k -H "AUTHTOKEN:<<Authtoken_generated_from_PAM360>>" https://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/2 Sample Output { "operation":{ "name":"DELETE RESOURCE" "result":{"status":"Success" "message":"Resources deleted successfully."}
} 1.5 Get the Resource ID and Account IDDescriptionTo get the resource ID and account ID, you need to pass the resource name and account name in the URL. URLhttps://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/getResourceIdAccountId? RESOURCENAME=(Resourcename)&ACCOUNTNAME=(Account name) HeaderAUTHTOKEN=<<Authtoken_generated_from_PAM360>> HTTP MethodGET Input DataNone Sample Requestcurl -k -H "AUTHTOKEN:<<Authtoken_generated_from_PAM360>>" "https://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/getResourceIdAccountId?RESOURCENAME=MSSQLServer&ACCOUNTNAME=system" Sample Output {"operation":{"name":"GET_RESOURCEACCOUNTID","result":{"status":"Success","message":"Resource ID and account ID fetched successfully for the given resource
name and account name." }, 1.6 Edit ResourcesDescriptionTo edit resources in PAM360. URLhttps://severname:port/restapi/json/v1/resources/{RESOURCEID} HeaderAUTHTOKEN=<<Authtoken_generated_from_PAM360>> HTTP MethodPUT Input Data(Optional inputs are given in grey) Sample InputNote: If you want to edit resource type, an additional parameter "RESOURCETYPE" having the value of that particular resource type should be added to the input. While editing 'Resource Type' cannot be changed from Key Store, File Store, License Store, Rackspace, and AWS IAM to other resource types and viceversa. INPUT_DATA={ "operation" : { "Details": { "RESOURCENAME" : "Test", "LOCATION" : "4th floor", "RESOURCEURL" : "http://test", "RESOURCEPASSWORDPOLICY":"Strong", "DEPARTMENT" : "Test", "RESOURCEDESCRIPTION" : "Created for quality assurance", "RESOURCETYPE" : "Windows", "RESOURCECUSTOMFIELD" : [ { "CUSTOMLABEL" : "Secure Resource", "CUSTOMVALUE" : "YES" } ] } } } Sample Requestcurl -X PUT -k -H "AUTHTOKEN:<<Authtoken_generated_from_PAM360>>" https://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/1 --data-urlencode "INPUT_DATA={\"operation\":{\"Details\":{\"RESOURCENAME\":\"Test\",\"LOCATION\":\"4thfloor\",\"RESOURCEURL\":\"http://test\",\"RESOURCEPASSWORDPOLICY\":\"Strong\",\"DEPARTMENT\": \"Test\", \"RESOURCEDESCRIPTION\" : \"Created for quality assurance\", \"RESOURCECUSTOMFIELD\" : [{\"CUSTOMLABEL\" : \"Secure Resource\", \"CUSTOMVALUE\" : \"YES\" }]}}}" Sample Output{"operation":{ "name":"EDIT RESOURCE", "result":{"status":"Success","message":"Resource Test modified successfully."}}} 1.7 Get License Keys, Files, Digital Certificates, Documents, Images, etc.DescriptionTo get files, keys, certificates, etc. that are either an individual resource or a part of other resources. URLhttps://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID>/downloadfile HeaderAUTHTOKEN=<<Authtoken_generated_from_PAM360>> HTTP MethodGET Input DataIn case the setting at your end demands a reason to be supplied for downloading the file, you need to pass the following details as input. If the ticketing system is enabled, you need to pass ticket ID for validation. INPUT_DATA={"operation":{ Sample Requestcurl -i -k -H "AUTHTOKEN:<<Authtoken_generated_from_PAM360>>"https://<Host-Name-of-PAM360-Server OR IP address>:<Port>/restapi/json/v1/resources/1501/accounts/3601/downloadfile 1.8 Fetch All Associated Remote App IDs
| |