RESTful API

(Feature available only in Enterprise Edition)

Password Manager Pro APIs allow to connect, interact and integrate with Password Manager Pro directly. The APIs belong to the REpresentational State Transfer (REST) category and allow you to add resources, accounts, retrieve passwords, retrieve resource/account details and update passwords programmatically.

Pre-requisite

Create API user accounts in Password Manager Pro

This is the first step in the process to configure and use password management APIs for Application-to-Application Password Management. As mentioned above, user accounts have to be created in Password Manager Pro to those who will use only the password management API. Every API user account should be attached to a single endpoint (server or desktop from where the API is used, so the user accounts are uniquely identified - for example, as user@hostname).

To create an API user account,

  • Navigate to Users tab.
  • Click the Add User button and select Add API User from the drop-down.

  • Enter the Username in the respective text field. This name identifies the API user.
  • Enter the name of the host from where the API user would access Password Manager Pro for password management operations.
  • Full Name refers to the name with which the API user would be identified in the external world. That means, in reports, audit trails and such other places where activities are traced to users.
  • Select an Appropriate Access level for the API user being added - Administrator/Password Administrator/Privileged Administrator/Password User/Custom Roles.
  • You can use Access Scope to change an Administrator/Password Administrator/Privileged Administrator into a Super Administrator by choosing the option All Passwords in the system. When you do so, they will be able to access all passwords in Password Manager Pro without any restriction. Conversely, a Super Administrator can be changed to his earlier role of Administrator/Password Administrator/Privileged Administrator by choosing the option Passwords Owned and Shared.
  • Leave the options Public key for SSH CLI access and SSL Certificate for XML-RPC API access.
  • Enable REST API by clicking the button Enable Now beside REST API.

  • Once you do this, you will see a text box for the API key. Click Generate to generate the API key. The API key is the Auth Token for your access purposes. Copy down this key and store it in some secure location for your future reference. This key will be displayed in the GUI only once and it will not be shown. If you ever lose this key, you need to come back to this GUI and regenerate the key.
  • You can set validity period for the API key - you can choose the option Never Expires if you want the key to be valid for ever. Otherwise, specify a validity date.
  • Enter the department and location.
  • Click Save.

Important Note

The API User creation is specific to the host from where the application would contact Password Manager Pro for passwords. That means, user and host are tied with each other. If you want to make use of Password Management API from more than one host, you need to create as many API users as the number of hosts. Conversely, if you wish to have many users on a single host, then again you need to create as many API users as needed.

APIs summary

PMP provides a wide range of APIs:

GET

To fetch resources, accounts, passwords, account/resource details

PUT

To change a password

POST

To create new resource and accounts

How to make use of the APIs?

Invoking the APIs

The APIs can be via HTTP POST, GET and PUT requests. All parameters in the request should be form-urlencoded. For all the APIs you need to pass AUTH token, which is mandatory.

Supported Format

PMP supports JSON format and the URL structure for would be as below:

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID>?AUTHTOKEN=(The token you have generated and copied from the GUI)

1. To get the resources owned and shared to a user

Description

To get the list of resources which are owned by or shared to an API user.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

None

Sample Request

curl -k https://192.168.xx.xx:7272/restapi/json/v1/resources?AUTHTOKEN=B9A1809A-5BF7-4459-9ED2-8D4F499CB902

Sample Output

In the output (as shown in the sample below), you will get all the resources owned and shared by the specific API user.


2. To get the accounts that are part of a resource

Description

To get the list of accounts and resource details present in the resource. Resource ID can be obtained from the GET RESOURCES API (explained above).

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

None

Sample Request

curl -k https://192.168.xx.xx:7272/restapi/json/v1/resources/303/accounts?AUTHTOKEN=B9A1809A-5BF7-4459-9ED2-8D4F499CB902


Sample Output

In the output (as shown in the sample below), you will get all the resources owned and shared by the specific API user.


Note: If password access control had been enabled AND If the password status is 'IN USE', you will see the output as [ In use ].


3. To get details of an account

Description

To get the details of an account that is part of a resource, you need to pass both Resource ID and Account ID to fetch the required details.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID>?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

None

Sample Request

curl -k https://192.168.xx.xx:7272/restapi/json/v1/resources/303/accounts/307?AUTHTOKEN=B9A1809A-5BF7-4459-9ED2-8D4F499CB902

Sample Output


4. To get the password of an account that is part of a resource

Description

To get the password of an account that is part of a resource, you need to pass both Resource ID and Account ID to fetch the required details.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID>/password?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

In case the setting at your end demands a reason to be supplied for retrieving a password, 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":{"Details":{"REASON":"Need the password to Login Windows Server","TICKETID":"7"}}}

Sample Request

curl -k https://192.168.xx.xx:7272/restapi/json/v1/resources/303/accounts/307/password?AUTHTOKEN=B9A1809A-5BF7-4459-9ED2-8D4F499CB902


curl -X GET -k -H "Content-Type: text/json" --url 'https://192.168.xx.xx:7272/restapi/json/v1/resources/303/accounts/307/password?AUTHTOKEN=B9A1809A-5BF7-4459-9ED2-8D4F499CB902&INPUT_DATA=\{"operation":\{"Details":\{"REASON":"Need the password to Login Windows Server","TICKETID":"7"\}\}\}'

Sample Output


Note: If there occurs any problem on retrieving password, the reason will be displayed as part of message.


5. To change the password of an account

Description

To change the password of an account that is part of a resource, you need to pass both Resource ID and Account ID to fetch the required details. If the ticketing system is enabled, you need to pass ticket ID for validation.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID>/password?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

PUT

Input Data

You need to pass input data such as new password, reset type and reason. Reset type should be either LOCAL or REMOTE.

        INPUT_DATA={
   "operation":{
      "Details":{
         "NEWPASSWORD":"Test@12345$",
         "RESETTYPE":"LOCAL",
         "REASON":"Password Expired"
         "TICKETID":"7"
      }
   }
}

Sample Request

curl -X PUT -k -H "Content-Type: text/json" --url https://192.168.xx.xx:7272/restapi/json/v1/resources/303/accounts/307/password?AUTHTOKEN=B9A1809A-5BF7-4459-9ED2-8D4F499CB902 -d INPUT_DATA=\{"operation":\{"Details":\{"NEWPASSWORD":"Test12345$","RESETTYPE":"LOCAL","REASON":"test","TICKETID":"7"\}\}\}

Sample Output

{
 "operation":{
  "name":"CHANGE PASSWORD",
  "result":{
   "status":"Success",
   "message":"Password changed successfully"
  }
 }
}

Note: If there occurs any problem on changing password, the reason will be displayed as part of message.


6. To create a new resource

Description

To create a new resource in PMP.

Input Data

You 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={
         "operation":{
         "Details":{
         "RESOURCENAME":"Windows Server",
         "ACCOUNTNAME":"Administrator",
         "RESOURCETYPE":"Windows",
         "PASSWORD":"Test123#@!",
         "NOTES":"Testing API",
         "RESOURCEURL":"http://windowsserver/adminconsole",
         "RESOURCECUSTOMFIELD":[
            {
               "CUSTOMLABEL":"Secure Resource",
               "CUSTOMVALUE":"YES"
            }
         ],
	"ACCOUNTCUSTOMFIELD":[
            {
               "CUSTOMLABEL":"Secure Account",
               "CUSTOMVALUE":"YES"
            }
         ]
      }
   }
}
        

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Sample Request

curl -X POST -k -H "Content-Type: text/json" 
'https://192.168.39.29:7272/restapi/json/v1/resources?AUTHTOKEN=B9A1809A-5BF
7-4459-9ED2-8D4F499CB902' -d 
'INPUT_DATA={"operation":{"Details":{"RESOURCENAME":"Windows 
Server","ACCOUNTNAME":"Administrator","RESOURCETYPE":"Windows","PASSWORD"
:"Test123#@!","NOTES":"Testing 
API","RESOURCEURL":"http://windowsserver/adminconsole","RESOURCECUSTOMFIEL
D":[{"CUSTOMLABEL":"Secure Resource","CUSTOMVALUE":"YES"}],"ACCOUNTCUSTOMFIELD":[{
"CUSTOMLABEL":"Secure Account","CUSTOMVALUE":"YES"}]}}}

Sample Output

{
 "operation":{
  "name":"CREATE RESOURCE",
  "result":{
   "status":"Success",
   "message":"Resource Windows Server has been added successfully"
  }
 }

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":"Test123#@!",
         "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 Password Manager Pro. 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 Request

curl -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://192.168.xx.xx:7272/
restapi/json/v1/resources?AUTHTOKEN=F73552FD-DDC2-415E-BF5D-06CFA519658B'

7. To get the account ID and resource ID

Description

To get the account ID and resource ID, you need to pass the resource name and account name in the URL.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/getResourceIdAccountId?AUTHTOKEN=(The token you have generated and copied from the GUI)&RESOURCENAME=(Resource name)&ACCOUNTNAME=(Account name)

HTTP Method

GET

Input Data

None

Sample Request

curl -k https://192.168.xx.xx:7272/restapi/json/v1/resources/getResourceIdAccountId?AUTHTOKEN=B9A1809A-5BF7-4459-9ED2-8D4F499CB902&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."
  },
  "Details":{
   "RESOURCEID":"303",
   "ACCOUNTID":"307"
  }
 }
}

8. To delete a resource in PMP

Description

To delete a resource for the given resource ID. Resource ID can be obtained from the GET RESOURCES API (explained above).

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/{resourceid}?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

DELETE

Input Data

None

Sample Request

curl -X DELETE https://192.168.xx.xx:7272/restapi/json/v1/resources/307?AUTHTOKEN=iddPyMeUOnv9huR%2BzLfan1GbB4VYZ4%2F7UDHfbpY8socCJ7C1%2BVUyhjtcRHlysShHeLf9va63EEkt%0A4x%2FG42EYLQ%3D%3D

Sample Output



{
"operation":{
"name":"DELETE RESOURCE"
"result":{"status":"Success"
"message":"Resources deleted successfully."}
}

9. To request password approval by the admin

Description

Method to request the admin for password access approval. The account id has to be passed for the same in the URL.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/accounts/{accountid}/requestpassword?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

In case the setting at your end demands a reason to be supplied for requesting a password, you need to pass the following details as input. INPUT_DATA= { "operation" : { "Details" : { "REASON" : "asdefefe"}}}

Sample Input

        {
"operation":{
"Details":{
PASSWDID":"1"
"REASON":"Testing"
			}
		}
	}

Sample Request

curl -X POST -k -H "Content-Type: text/json" https://192.168.xx.xx:7272/restapi/json/v1/accounts/7/requestpassword?INPUT_DATA= { "operation" : { "Details":{ "REASON" : "Testing"}}} &AUTHTOKEN=iddPyMeUOnv9huR%2BzLfan1GbB4VYZ4%2F7UDHfbpY8socCJ7C1%2BVUyhjtcRHlysShHeLf9va63EEkt%0A4x%2FG42EYLQ%3D%3D

Sample Output


{
"operation":{

               "name":"REQUEST_PASSWORD"  ,
               "result":{    
               "status":"Success"    ,
               "message":"Request to view password have been raised successfully"
                         },
              "Details":{
                         "STATUS" : "WAITING FOR APPROVAL / CHECKOUT" ;
                         }

           }

}

10. To get the list of password requests

Description

Method to get the list of password requests to be approved or rejected by the admin who is logged in.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/accounts/passwordaccessrequests?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

None

Sample Input

INPUT_DATA= { "operation" : { "Details" : { "REASON" : "Testing", "TICKETID" : "7"}}}

Sample Request

curl -k https://192.168.xx.xx:7272/restapi/json/v1/accounts/passwordaccessrequests?AUTHTOKEN=iddPyMeUOnv9huR%2BzLfan1GbB4VYZ4%2F7UDHfbpY8socCJ7C1%2BVUyhjtcRHlysShHeLf9va63EEkt%0A4x%2FG42EYLQ%3D%3D

Sample Output


{
	"operation":{
	"name":"GET_PASSWORDREQUEST"
    "result":{   
    "status":"Success"  
    "message" : "Password Request fetched successfully"
    }
    "Details":  {  
    "REQUESTER USERID":"2"
    "REQUESTED BY":"guest"
	"REQUESTED BY FULLNAME" : "Guest guest"
	"PASSWORDREQUESTLIST" : [
		{
		"ACCOUNT ID"  :  "1"
       "ACCOUNT NAME" :  "ACCOUNT1"
		"RESOURCE ID":"1"
		"RESOURCE NAME":"apt-server1"
		"PASSWD ID" : "1"
		"STATUS":""
		"REQUESTED TIME":"Nov 27
		"REASON" : "For connecting the machine and update the pmp server".
		}
		{
		"ACCOUNT ID"  :  "2"
		"ACCOUNT NAME" :  "ACCOUNT2"
		"RESOURCE ID":"2"
		"RESOURCE NAME":"apt-server2"
		"PASSWD ID" : "2"
		"STATUS":""
		"REQUESTED TIME":"Nov 28
		"REASON" : "For connecting the machine and update the pmp server".
		}
		]
        }

         }

}

Note : Requester ID is the same as the ID of the user who has requested the password.


11. To reject a password request

Description

Method for the admin to reject the password requests. This requires the account ID and requester ID to be passed in the URL.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/accounts/{accountid}/requester/{requesterid}/reject?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Sample Input

    {
	"operation":{
	"Details":{
	"PASSWDID":"1"
    "REQUESTEDID" : "2" (userid of the request raised user)
	}
     }
	}
	

Note: Requester ID is the same as the ID of the user who has requested the password.

Sample Request

curl -X POST -k -H "Content-Type: text/json"
https://192.168.xx.xx:7272/restapi/json/v1/accounts/7/requester/34/reject?AUTHTOKEN= 
iddPyMeUOnv9huR%2BzLfan1GbB4VYZ4%2F7UDHfbpY8socCJ7C1%2BVUyhjtcRHlysShHeLf9va63EEkt%0A4x%2FG42EYLQ%3D%3D

Sample Output


{
"operation":{
"name" : "ADMIN_REQUEST_REJECT" 
 "result" : { 
 "status" : "Success"   
 "message": "Password Rejected successfully"
   }
 }
}

12. To approve a password request

Description

Method for the admin to approve the password requests. Here, the account ID and the Requester ID are required to be passed in the URL.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/accounts/{accountid}/requester/{requesterid}/approve?AUTHTOKEN= (The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

None

Note : Requester ID is the same as the ID of the user who has requested the password. REQUESTEDID can be obtained from the GET PASSWORDREQUEST API(REQUESTER USERID).

Sample Request

curl -X POST -k -H "Content-Type: text/json" https://192.168.xx.xx:7272/restapi/json/v1/accounts/7/requester/34/approve?AUTHTOKEN=iddPyMeUOnv9huR%2BzLfan1GbB4VYZ4%2F7UDHfbpY8socCJ7C1%2BVUyhjtcRHlysShHeLf9va63EEkt%0A4x%2FG42EYLQ%3D%3D

Sample Output


{
"operation" : { 
"name" : "ADMIN_REQUEST_APPROVE" 
"result" : {    
"status" : "Success"   
"message": "Password Approved successfully"
           }
        }
}

13. To check-in the password approved by the admin

Description

Method to check-in the password approved by the admin. The account and requester IDs have to passed in the URL for the same.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/accounts/{accountid}/requester/{requesterid}/checkin?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

    {
    "operation":{
    "Details":{
    "PASSWDID"  :  "1"
    "REQUESTEDID" : "2" (userid of the request raised user)
    }
   }
    

Note: Requester ID is the same as the ID of the user who has requested the password.


Sample Request

curl -X POST -k -H "Content-Type: text/json" https://192.168.xx.xx:7272/restapi/json/v1/accounts/7/requester/34/checkin?AUTHTOKEN=iddPyMeUOnv9huR%2BzLfan1GbB4VYZ4%2F7UDHfbpY8socCJ7C1%2BVUyhjtcRHlysShHeLf9va63EEkt%0A4x%2FG42EYLQ%3D%3D

Sample Output


{
"operation":{  
 "name"   :  "ADMIN_REQUEST_CHECKIN"   
 "result" :  {      
 "status" :  "Success"     
 "message" : "Password have been checked in successfully"  
  } 
 } 
} 

14. To checkout the password approved by the admin

Description

Method to checkout the password after being approved by the admin after request. The account ID had to be passed for the same in the URL.

URL

https://:<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/accounts/{accountid}/checkout?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

On account of customized settings that demand reason for password checkout, you need to pass the following as input. INPUT_DATA= { "operation" : { "Details":{ "REASON" : "asdefefe"}}}

Sample Input

	{
	"operation":{
    "Details":{
    "REASON":"N/A"
    }
   }
}

Sample Request

curl -X POST -k -H "Content-Type: text/json" https://192.168.xx.xx:7272/restapi/json/v1/accounts/7/checkout?INPUT_DATA= { "operation" : { "Details" : { "REASON" : "N/A"}}}&AUTHTOKEN=iddPyMeUOnv9huR%2BzLfan1GbB4VYZ4%2F7UDHfbpY8socCJ7C1%2BVUyhjtcRHlysShHeLf9va63EEkt%0A4x%2FG42EYLQ%3D%3D

Sample Output

{ 
"operation": { 
"name" : "REQUEST_CHECKOUT"  
"result" : {     
"status" :  "Success"    
            "message" : "Password have been checked out successfully" 
            "Details":{ 
                       "STATUS" : "***** [checkIn]" 
                       } 
                     } 
}

15. To create a new user

Description

Method to add an user.

URL

https:// <Host-Name-of-PMP-Server OR IP address> :7272/api/pki/restapi/user?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data (Optional Inputs are given in Grey)

{

    "operation": {
	"Details": {
	"USERNAME": "jason"
	"FIRSTNAME": "Jason"
	"LASTNAME": "Thomas"
	"EMAIL": "jason@opmanager.com"
	"PASSWORD":"Pa55w0Rd123"
	"POLICY": "Strong"
	"ROLE": "Administrator|Password Administrator|Privileged Administrator|Password Auditor|Password User"
	"ISSUPERADMIN": "true|false"
	"ISAPIUSER": "true|false"
	"ALLOWEDIPADDRESS": "ramanathan-0501"
	"DEPARTMENT": "NOC"
	"LOCATION": "Level 10 - South Wing"
	"ENABLEMOBILEACCESS": "true|false"
	"LANDLINE_COUNTRYCODE": "+1"
	"LANDLINE": "925-965-9647"
	"LANDLINE_EXT": "4675"
	"MOBILE_COUNTRYCODE": "+1"
	"MOBILE": "925-965-9648"
	"PHONEFACTOR_USERNAME": "jason1"
	"RSAUSERNAME": "jason2"
	"ENABLETWOFACTOR": "true|false"
	"PRIMARYCONTACT": "landline|mobile"
	}
    }

16. To edit resources

Description

Method to edit resources.

URL

https://severname:port/restapi/json/v1/resources/{RESOURCEID}

HTTP Method

PUT

Input Data

(Optional inputs are given in grey)

Sample Input

Note: 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.

{
"operation"    :    {
"Details":   {
"RESOURCENAME"  :  "Test",
"LOCATION" : "4th floor",
"RESOURCEURL" : "http://test",
"DEPARTMENT" : "Test",
"RESOURCEDESCRIPTION" : "Created for quality assurance",
"RESOURCETYPE" : "Windows",
"RESOURCECUSTOMFIELD" : [
	{
	"CUSTOMLABEL" : "Secure Resource",
	"CUSTOMVALUE" : "YES"
	}
	]
	}
}
}

Sample Request

curl -X PUT -k -H "Content-Type: text/json" 'https://192.168.39.29:7272/restapi/json/v1/resources/1?AUTHTOKEN=B9A1809A-5BF 7-4459-9ED2-8D4F499CB902' -d 'INPUT_DATA={"operation":{"Details":{"RESOURCENAME": "Test", "LOCATION" : "4th floor", "RESOURCEURL" : "http://test", "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."}}}


17. To delete an account under a specific resource

Description

To delete an account under a specific resource.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID>/

HTTP Method

DELETE

Sample Request

curl -X DELETE -k -H "Content-Type: text/json" 'https://192.168.xx.xx:7272/restapi/json/v1/resources/1/accounts/1? AUTHTOKEN=F73552FD-DDC2-415E-BF5D-06CFA519658B'

Sample Output

{
"operation":{
"name":"DELETE ACCOUNT",
"result":{"status":"Success","message":"Account Test123 deleted successfully."}}}

18. To get license keys, files, digital certificates, documents, images, etc.

Description

To get files, keys, certificates, etc. that are either an individual resource or a part of other resources.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID>/downloadfile

HTTP Method

GET

Input Data

In 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.

{"operation":{
   "Details":{
     "REASON":"Need the key file to connect the remote host", //optional when reason is forced
     "TICKETID":"7", // optional when ticketing system is enabled
     "ISCUSTOMFIELD":"TRUE" //optional  Need to be given if the file to be downloaded is account/resource additional field file type
     "CUSTOMFIELDTYPE":"ACCOUNT / RESOURCE" // optional -If its account additional field it must be ACCOUNT or if its resource 
     			                       additional field it must be RESOURCE
     "CUSTOMFIELDLABEL" : "LicenseFIle" // optional - Name of the resource/account additional field
           }
        }

}

Sample Request

curl -i -k https://192.168.xx.xx:7272/restapi/json/v1/resources/1501/accounts/3601/downloadfile?AUTHTOKEN=DB44AEC4-5C9F-4547-859B-77B3D8EED417


19. To create accounts under a specific resource

Description

To create multiple accounts that are associated with a specific resource ID.

Input Data

You need to pass input data such as account list, name of the accounts, passwords, description.

        INPUT_DATA={"operation":{
                    "Details":{
                    "ACCOUNTLIST": [
                     {
                      "ACCOUNTNAME":"bestest047",
                      "PASSWORD":"Pa$$Word@123",
                      "NOTES":"IT Security - BES PMP API Test"
                      },
                     {
                     "ACCOUNTNAME":"bestest048",
                     "PASSWORD":"Pa$$Word@123",
                     "NOTES":"IT Security - BES PMP API Test"
                     }	
                        ]
                       }
                      }

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts

HTTP Method

POST

Sample Request

        curl -X POST -k -H "Content-Type: text/json"  'https://192.168.xx.xx:7272/restapi/json/v1/resources/1/accounts?
        AUTHTOKEN=F73552FD-DDC2-415E-BF5D-06CFA519658B' -d  INPUT_DATA= {"operation":{ "Details":{ "ACCOUNTLIST": [{ "ACCOUNTNAME":
        "bestest047","PASSWORD":"Pa$$Word@123", "NOTES":"IT Security - BES PMP API Test"},{"ACCOUNTNAME":"bestest048",
        "PASSWORD":"Pa$$Word@123","NOTES":"IT Security - BES PMP API Test"}]}}
        

Sample Output

{"operation":
{"name":"ADD ACCOUNTS","result":
{"status":"Success","message":"Account added successfully"},
"Details":[
{"bestest047":{"STATUS":"Account added successfully"},
"bestest048":{"STATUS":"Account added successfully"}}]}}

20. To edit an account under a specific resource

Description

To edit an account under a specific resource.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resources/<Resource ID>/accounts/<Account ID>/

HTTP Method

PUT

Sample Input

{
"operation" : {
      "Details" : {
         "ACCOUNTNAME" : "Test account",
         "NOTES":"Created for quality assurance",        
         "ACCOUNTCUSTOMFIELD" : [
            {
               "CUSTOMLABEL" : "Secure Account",
               "CUSTOMVALUE" : "YES"
            }
         ]
      }
   }
}

Sample Request

curl -X PUT -k -H "Content-Type: text/json" 'https://192.168.xx.xx:7272/restapi/json/v1/resources/1/accounts/1? AUTHTOKEN=F73552FD-DDC2-415E-BF5D-06CFA519658B' -d INPUT_DATA= {"operation":{ "Details":{"ACCOUNTNAME" : "Test account", "NOTES":"Created for quality assurance", ACCOUNTCUSTOMFIELD" : [{"CUSTOMLABEL" : "Secure Account", "CUSTOMVALUE" : "YES"}]}}}

Sample Output

{"operation":{ "name":"EDIT ACCOUNT", "result":{"status":"Success","message":"Account Test account modified successfully"}}}


21. To delete a user

Description

Method to delete a specific user.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/user/{userid}

HTTP Method

DELETE

Sample Request

curl -X DELETE -k -H "Content-Type: text/json" https://192.168.xx.xx:7272/restapi/json/v1/user/307?AUTHTOKEN=iddPyMeUOnv9huR%2BzLfan1GbB4VYZ4%2F7UDHfbpY8socCJ7C1%2BVUyhjtcRHlysShHeLf9va63EEkt%0A4x%2FG42EYLQ%3D%3D

Sample Output

{"operation":{"name":"DELETE USER","result":{"status":"Success","message":"User Michael deleted Successfully"} } }


22. To create an API user

Description

Method to create an API user.

URL

https://servername:port/restapi/json/v1/user

HTTP Method

POST

Input Data

AUTHTOKEN=<token>&INPUT_DATA={"operation":{"Details":{"USERNAME":"jason","FULLNAME":"Jason 
Thomas","EMAIL":"jason@opmanager.com","POLICY":"Strong","ROLE":"Password
User","SUPERADMIN":"true|false","DEPARTMENT":"NOC","LOCATION":"Level 10 - South
Wing","ISAPIUSER":"true","HOSTNAME":"sankar-2100","EXPIRYDATE":"yyyy-mm-dd|NeverExpires"}}}

Sample Output

{"operation":{"name":"CREATE_USER","result":{"status":"Success","message":"SUCCESS"},
"Details":{"AUTHTOKEN":"7D94BAAB-CA3B-44F5-8ED9-9317DAB5AEF0"}}}

23. To create a new SSH key

Description

To create a new SSH key.

URL

https:// <Host-Name-of-PMP-Server OR IP address> :7272/api/pki/restapi/createsshkey?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The following data has to be passed as input:

{"operation":{"Details":{"keyName":"keytest",
"passPhrase":"passPhrase",
"comment":"comment",
"length":"2048",
"keyType":"SSH2_RSA"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/createsshkey?AUTHTOKEN=99AE42A9-02E0-4638-888A-D4D19225C3FE&INPUT_DATA={"operation":{"Details":{"keyName":"keytest","passPhrase":"passPhrase","comment":"comment","length":"2048","keyType":"SSH2_RSA"}}}

Sample Response

{ "name": "CreateSSHKey",
"result": {
"status": "Success",
"message": "New SSH key created successfully"v }
}


24. To fetch all the SSH keys

Description

To fetch all the discovered SSH keys.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getAllSSHKeys?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

None

Sample Request

https://<HostName>:7272/api/pki/restapi/getAllSSHKeys?AUTHTOKEN=99AE42A9-02E0-4638-888A-D4D19225C3FE

Sample Response

{
"name": "GetAllSSHKeys",
"result": {
"status": "Success",
"message": "All SSH Keys fetched successfully"
},
"totalRows": 2,
"SSHKeys": [
{
"KeyName": "key",
"KeyType": "ssh-rsa",
"KeyLength": "2048",
"FingerPrint": "4b:97:8d:aa:8d:73:89:7c:96:69:7d:10:df:b2:d0:af",
"CreatedBy": "admin",
"CreationTime": "1 days"
},
{
"KeyName": "keytest",
"KeyType": "ssh-rsa",
"KeyLength": "2048",
"FingerPrint": "69:ff:8d:8e:4d:a3:79:da:fc:09:6c:e8:01:15:66:9b",
"CreatedBy": "admin",
"CreationTime": "Today"
}
]
}


25. To fetch a particular SSH key

Description

To fetch a particular SSH key from the discovered keys.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getSSHKey?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The name of the operation and key to be passed as input

{"operation":{"Details":{"keyName":"key"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/getSSHKey?AUTHTOKEN=99AE42A9-02E0-4638-888A-D4D19225C3FE&INPUT_DATA={"operation":{"Details":{"keyName":"key"}}}

Sample Response

{
"name": "GetSSHKey",
"result": {
"status": "Success",
"message": "SSH Key key fetched successfully"
},
"SSHKey": [
{
"KeyName": "key",
"KeyType": "ssh-rsa",
"KeyLength": "2048",
"FingerPrint": "4b:97:8d:aa:8d:73:89:7c:96:69:7d:10:df:b2:d0:af",
"CreatedBy": "admin",
"CreationTime": "1 days"
}
]
}


26. To export an SSH key

Description

To export a particular SSH key.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/exportSSHKey?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The name of the operation and key have to be passed as input.

{"operation":{"Details":{"keyName":"key"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/exportSSHKey?AUTHTOKEN=99AE42A9-02E0-4638-888A-D4D19225C3FE&INPUT_DATA={"operation":{"Details":{"keyName":"key"}}}

Sample Response

Key file


27. To get SSH keys for a user

Description

To get all the SSH keys associated with a particular user.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getSSHkeysforuser?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

The username and resource name have to be passed as input.

{"operation":{"Details":{"userName":"test","resourceName":"172.21.147.80"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/getSSHkeysforuser?AUTHTOKEN=99AE42A9-02E0-4638-888A-D4D19225C3FE&INPUT_DATA={"operation":{"Details":{"userName":"test","resourceName":"172.21.147.80"}}}

Sample Response

{
"name": "GetSSHKeysForUser",
"result": {
"status": "Success",
"message": "SSH keys for user test of resource 172.21.147.80 fetched successfully"
},
"Keys": "key,keytest"
}


28. To fetch all associated users

Description

To fetch all the users associated with SSH keys.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getAllAssociatedUsers?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

None

Sample Request

https://<HostName>:7272/api/pki/restapi/getAllAssociatedUsers?AUTHTOKEN=99AE42A9-02E0-4638-888A-D4D19225C3FE

Sample Response

{
"name": "GetAllAssociatedUsers",
"result": {
"status": "Success",
"message": "All associated users fetched successfully"
},
"totalRows": 1,
"AllAssociatedUsers": [
{
"UserName": "test",
"ResourceName": "172.21.147.80"
}
]


29. To get a certificate

Description

To obtain a certificate from KMP's certificate repository.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getCertificate?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

The operation details and the name of the certificate fetched have to be passed as input.

{"operation":{"Details":{"common_name":"*.google.com"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/getCertificate?AUTHTOKEN=3E014D78-E603-413A-AC24-6392F0001283&INPUT_DATA={"operation":{"Details":{"common_name":"*.google.com"}}}

Sample Response

Certificate object


30. To get all certificates

Description

To obtain all the certificates from KMP's certificate repository.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getAllSSLCertificates?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

None

Sample Request

https://<HostName>:7272/api/pki/restapi/getAllSSLCertificates?AUTHTOKEN=3E014D78-E603-413A-AC24-6392F0001283

Sample Response

{"name":"GetAllSSLCertificates","result":{"status":"Success","message":"All SSL
Certificates fetched successfully"},"totalRows":1,"SSLCertificates":[{"CertID":1,"DNS
Name/FQDN":"ec2-54-243-44-216.compute-1.amazonaws.com","Port":443,"Common Name":"*.acquia-sites.com",
"Issuer":"Acquia Inc","FromDate":"Sep 3, 2009","ExpiryDate":"Sep 3,
2010","KeyStrength":"1024"}]}


31. To get all certificate expiry

Description

To get the expiry dates of all the certificates.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getAllSSLCertsExpiryDate?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

None

Sample Request

https://<HostName>:7272/api/pki/restapi/getAllSSLCertsExpiryDate?AUTHTOKEN=1B2BF6FA-8511-47A8-867D-CE7FFE4BFBD0

Sample Response

{"name":"GetAllSSLCertificatesExpiryDate","result":{"status":"Success","message":"Certificates expiry date fetched successfully"},"totalRows":1,"SSLCertificates_Expiry_Date":[{"Common Name":"*.acquia-sites.com","ExpiryDate":"Sep 3, 2010"}]}


32. To get certificate details

Description

To get the details of a particular certificate.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getCertificateDetails?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

The operation details and the name of the certificate have to be passed as input.

{"operation": {"Details":{"common_name":"*.google.com"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/getCertificateDetails?AUTHTOKEN=3E014D78-E603-413A-AC24-6392F0001283&INPUT_DATA={"operation": {"Details":{"common_name":"*.google.com"}}}

Sample Response

{"name":"GetCertificateDetails","result":{"status":"Success","message":"Details of certificate
apitest fetched
successfully"},"endpoint":{"hostName":"apitest","port":443,"expiry_date":"2016-11-15
15:05:10.0","from_date":"2016-09-16
15:05:10.0","certSignAlg":"SHA256withRSA","Sans":"","serial":"3472ac6d","fingerPrint":"1afa050
78aacf702e4ae7e84f182a817eea96c46","keyalg":"RSA","PublicKeyLength":2048,"PrivateKey":true},
"issue

33. To get certificate keystore

Description

To get the key store file of a particular certificate.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/getCertificateKeyStore?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

GET

Input Data

The name of the operation and the common name of the keystore file have to be passed as input.

{"operation":{"Details":{"common_name":"apitest"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/getCertificateKeyStore?AUTHTOKEN=3E014D78-E603-413A-AC24-6392F0001283&INPUT_DATA={"operation":{"Details":{"common_name":"apitest"}}}

Sample Response

KeyStore File Object


34. To delete a certificate

Description

To delete a certificate from KMP's repository.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/deleteCertificate?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

DELETE

Input Data

The operation name and the common name of the certificate have to be passed as input.

{"operation": {"Details":{"common_name":"apitest"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/deleteCertificate?AUTHTOKEN=3E014D78-E603-413A-AC24-6392F0001283&INPUT_DATA={"operation": {"Details":{"common_name":"apitest"}}}

Sample Response

{"name":"DeleteCertificate","result":{"status":"Success","message":"Certificate apitest deleted successfully."}}


35. To perform resource discovery

Description

To discover a particular resource for SSL certificates.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/sslCertSingleDiscovery?AUTHTOKEN=(The token you have generated and copied from the GUI) from the GUI)

HTTP Method

POST

Input Data

The name/IP address of the host and port number have to be passed as input.

{"operation":{"Details":{"HOST":"de-ubuntu10-1","TIMEOUT":"300","PORT":"7272"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/sslCertSingleDiscovery?AUTHTOKEN=3E014D78-E603-413A-AC24-6392F0001283&INPUT_DATA={"operation":{"Details":{"HOST":"de-ubuntu10-1","TIMEOUT":"300","PORT":"7272"}}}

Sample Response

{
"name": "Get SSL Discovery",
"totalRows": 1,
"de-ubuntu10-1": [
"SUCCESS",
"SSL Certificate discovered, demo.keymanager.com certificate found at port 7272"
]
}


36. To perform resource discovery (for a range of IP addresses)

Description

To discover a set of resources for SSL certificates.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/sslCertRangeDiscovery?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The start and end IP addresses, port number and time-out have to be passed as input.

{"operation":{"Details":{"StartIpAddress":"192.168.216.0",
"EndIpAddress":"192.168.216.3",
"TIMEOUT":"3",
"PORT":"443"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/sslCertRangeDiscovery?AUTHTOKEN=7EDC4ED5-E684-4413-9848-F0016C114874&INPUT_DATA={"operation":{"Details":{"StartIpAddress":"192.168.216.0","EndIpAddress":"192.168.216.3","TIMEOUT":"3","PORT":"443"}}}

Sample Response

{ "name": "Get SSL Discovery",
"totalRows": 4,
"192.168.216.1": [
"FAILURE",
"Connection failed,no certificate found at port 443"
],
"192.168.216.0": [
"FAILURE",
"Connection timed out,no certificate found at port 443"
],
"192.168.216.3": [
"FAILURE",
"Connection timed out,no certificate found at port 443"
],
"192.168.216.2": [
"FAILURE",
"Connection timed out,no certificate found at port 443"
]
}


37. To create CSR

Description

To create a certificate signing request.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/api/pki/restapi/createCSR?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The following data need to be passed as input.

{"operation":{"Details":{"CNAME":"mytestcert",
"ALT_NAMES":"test",
"ORGUNIT":"hhh",
"ORG":"h",
"LOCATION":"hh",
"STATE":"h",
"COUNTRY":"hh",
"PASSWORD":"bbbbbbbb",
"VALIDITY":"888",
"ALG":"RSA",
"LEN":"4096",
"SIGALG":"SHA256",
"StoreType":"PKCS12"}}}

Sample Request

https://<HostName>:7272/api/pki/restapi/createCSR?AUTHTOKEN=C6506112-6113-42C9-AD3
F-4A3AEF9476C9&INPUT_DATA={"operation":{"Details":{"CNAME":"mytestcert","ALT_NAMES":"test","ORGUNIT":
"hhh","ORG":"h","LOCATION":"hh","STATE":"h","COUNTRY":"hh","PASSWORD":"bbbbbbbb",
"VALIDITY":"888","ALG":"RSA","LEN":"4096","SIGALG":"SHA256",
"StoreType":"PKCS12"}}}

Sample Response

{"name":"CreateCertificate","result":{"status":"Success","message":"CSR saved successfully"}}


38. To create certificate

Description

To create an SSL certificate.

HTTP Method

POST

Input Data

The following data have to be passed as input:

{"operation":{"Details":{"CNAME":"mytestcert",
"ALT_NAMES":"test",
"ORGUNIT":"hhh",
"ORG":"h",
"LOCATION":"hh",
"STATE":"h",
"COUNTRY":"hh",
"PASSWORD":"bbbbbbbb",
"VALIDITY":"888",
"ALG":"RSA",
"LEN":"4096",
"SIGALG":"SHA256",
"StoreType":"PKCS12"}}}


39. To get the ID of a user

Description

To get the ID of a user by passing their username.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/user/getUserId?AUTHTOKEN=(The token you have generated and copied from the GUI)&USERNAME=(username)

Header

orgName= (org display name)

HTTP Method

GET

Input Data

None

Sample Request

https://<Host-Name-of-PMP-Server OR IP  address>:7272/restapi/json/v1/user/getUserId?AUTHTOKEN=FAB6CE62-160D-4790-BD8F-C93200D14536&USERNAME=user1


Sample Response

{
"operation": {
"name":"get_USERID",
"result": { "status":"Success","message":"User Id for the specified username  have been fetched successfully"},"Details":{"USERID":"1"}}}


40. To delete a user with their username

Description

To delete a user by passing their username.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/user?AUTHTOKEN=AUTHTOKEN=(The token you have generated and copied from the GUI)&USERNAME=(username) HTOKEN=(The token you have generated and copied from the GUI)&USERNAME=(username)

Header

orgName= (org display name)

HTTP Method

DELETE

Input Data

None

Sample Request

https://<Host-Name-of-PMP-Server OR IP  address>:7272/restapi/json/v1/user?AUTHTOKEN=FAB6CE62-160D-4790-BD8F-C93200D14536&USERNAME=mano


Sample Response

{"operation":{"name":"DELETE USER","result":{"status":"Success","message":"User mano deleted successfully"}}}


41. To add a user to a user group

Description

To add a user to a user group by passing their username and the user group to which they should be added.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/user/addUserToUserGroup?AUTHTOKEN=(The token you have generated and copied from the GUI)&USERNAME=(username)&USERGROUPNAME=(usergroupname)

Header

orgName= (org display name)

HTTP Method

POST

Input Data

None

Sample Request

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/user/addUserToUserGroup?AUTHTOKEN=FAB6CE62-160D-4790-BD8F-C93200D14536&USERNAME=mano&USERGROUPNAME=TestGroup


Sample Response

{"operation":{"name":"ADD USER TO USERGROUP","result":{"status":"Success","message":"User mano added to User Group TestGroup successfully"}}}


42. To lock a user

Description

To lock a user by passing their username.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/user/lock?AUTHTOKEN=(The token you have generated and copied from the GUI)&USERNAME=(username)

Header

orgName= (org display name)

HTTP Method

POST

Input Data

None

Sample Request

https://<Host-Name-of-PMP-Server OR IP  address>:7272/restapi/json/v1/user/lock?AUTHTOKEN=FAB6CE62-160D-4790-BD8F-C93200D14536&USERNAME=apiuser


Sample Response

{"operation":{"name":"LOCK USER","result":{"status":"Success","message":"User account apiuser locked successfully."}}}


43. To unlock a user

Description

To unlock a user by passing their username.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/user/unlock?AUTHTOKEN=(The token you have generated and copied from the GUI)&USERNAME=(username)

Header

orgName= (org display name)

HTTP Method

PUT

Input Data

None

Sample Request

https://<Host-Name-of-PMP-Server OR IP  address>:7272/restapi/json/v1/user/unlock?AUTHTOKEN=FAB6CE62-160D-4790-BD8F-C93200D14536&USERNAME=apiuser


Sample Response

{"operation":{"name":"UNLOCK USER","result":{"status":"Success","message":"User account apiuser unlocked successfully. "}}}


44. To import an SSH key

Description

To import an SSH key.

URL

https://<hostname>:6565/api/pki/restapi/addSSHKey?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The following data is to be passed as input:

{
"operation":
{
"Details":
{
"keyName":"testkey","passphrase":"passtrix"
}
}
}

Sample Request

curl -X POST -k -H 'Content-Type: multipart/form-data' -F INPUT_DATA={"operation":{"Details":{"keyName":"testkey","passphrase":"passtrix"}}} -F File=@D:/certs/keys/test1-passtrix/test1_Jul-21-2017-15_56.key https:// :6565/api/pki/restapi/addSSHKey?AUTHTOKEN=A3164150-4C15-4AA4-918E-F258F38149F8

Sample Response

{
"name":"addSSHKey","result":
{
"status":"SUCCESS","message":"Key imported successfully"
}
}


45. To associate an SSH key

Description

To associate an SSH key.

URL

https://<hostname>:6565/api/pki/restapi/associateKey?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The following data is to be passed as input:

{
"operation":
{
"Details":
{
"keyName":"testkey","resourceName":"test.csez.zohocorpin.com","userName":"test"
}
}
}

Sample Request

https://<hostname>:6565/api/pki/restapi/associateKey?AUTHTOKEN=A3164150-4C15-4AA4-918E-F258F38149F8&INPUT_DATA={"operation":{"Details":{"keyName":"testkey","resourceName":"test.csez.zohocorpin.com","userName":"test"}}}

Sample Response

{
"name": "associateKey", "result":
{ "status": "Success", "message": "Key associated successfully"
}
}


46. To dissociate an SSH key

Description

To dissociate an SSH key.

URL

https://<hostname>:6565/api/pki/restapi/dissociateKey?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The following data is to be passed as input:

{
"operation":
{
"Details":
{
"keyName":"testkey","resourceName":"test.csez.zohocorpin.com","userName":"test"
}
}
}

Sample Request

https://<hostname>:6565/api/pki/restapi/dissociateKey?AUTHTOKEN=A3164150-4C15-4AA4-918E-F258F38149F8&INPUT_DATA={"operation":{"Details":{"keyName":"testkey","resourceName":"test.csez.zohocorpin.com","userName":"test"}}}

Sample Response

{
"name": "dissociateKey", "result":
{
"status": "SUCCESS", "message": "Key dissociated successfully."
}
}


47. To create a dynamic resource group

Description

To create a dynamic resource group in PMP.

URL

https://<Host-Name-of-PMP-Server OR IP address>:7272/restapi/json/v1/resourcegroup?AUTHTOKEN=(The token you have generated and copied from the GUI)

HTTP Method

POST

Input Data

The following data is to be passed as input:

{
"operation": {
"Details": {
"critgroup": "CG1",
"critdesc": "description about CG1",
"RuleCriteria": "Low",
"NoHelpDeskRetrieval": "false",
"andor": "and",
"NoOfCriteria": 2,
"condition_1": "RESOURCENAME",
"operator_1": "CONTAINS",
"valuefield_1": "win",
"condition_2": "LOGINNAME",
"operator_2": "CONTAINS",
"valuefield_2": "pmp"
}
}
}

Sample Request

curl -X POST -k -H "Content-Type: text/json"
'https://192.168.39.29:7272/restapi/json/v1/resourcegroup?AUTHTOKEN=B9A1809A-5BF
7-4459-9ED2-8D4F499CB902' -d
'INPUT_DATA={
"operation": {
"Details": {
"critgroup": "CG1",
"critdesc": "description about CG1",
"RuleCriteria": "Low",
"NoHelpDeskRetrieval": "false",
"andor": "and",
"NoOfCriteria": 2,
"condition_1": "RESOURCENAME",
"operator_1": "CONTAINS",
"valuefield_1": "win",
"condition_2": "LOGINNAME",
"operator_2": "CONTAINS",
"valuefield_2": "pmp"
}
}
}

Sample Output

{
"operation":
{
"name":"CREATE RESOURCE GROUP",
"result":
{
"status":"Success",
"message":"Group CG1 has been added successfully."
}
}
}


©2014, ZOHO Corp. All Rights Reserved.

Top