Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Credentials can be accessed and modified through this API using four services: GET, POST, PUT, and PATCH. These four services allow for the retrieval, creation, complete update, and partial update of Credentialscredentials.

Authentication - Use Basic Authentication for this API.

...

Request

Parameter
Required
Type
Description
IdYesURLURL parameter for the Id which is used to find and return a Credential

Response Codes

HTTP Code
Description
200Credential was found and returned
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Credential not found
500Unexpected internal server error

Example

If we a Credential in our database with an Id of 11004 and the following attributes

Code Block
themeEclipse
titleCredential - 11004
{
	"credentialId": 11004,
    "versionNumber": 1,
    "credentialName": "GET Example Name",
    "isActive": true,
    "credentialScope": "ENVINST",
    "credentialStoreId": 11000,
    "credentialInputs": [
        {
            "versionNumber":1,
            "inputValue": "TestPassword",
            "credentialStoreInputDefId": 12000
        }
    ]
}

When we run a GET request at the following URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/11004

The GET request would return the following JSON Credential object

Code Block
themeEclipse
titleCredential GET Return JSON
{
	"credentialId": 11004,
    "versionNumber": 1,
    "credentialName": "GET Example Name",
    "isActive": true,
    "credentialScope": "ENVINST",
    "credentialStoreId": 11000,
    "credentialInputs": [
        {
            "versionNumber":1,
            "inputValue": "TestPassword",
            "credentialStoreInputDefId": 12000
        }
    ]
}

GET by Query Parameters

This GET service will return a list of Credentials in the form of JSON objects based on the query parameters credentialId, credentialName, credentialScope, and credentialStoreId. Credentials are only returned if they match ALL of the specified query parameters. If no query parameters are given, this request will return the entire list of Credentials. The credentialName parameter returns Credentials that contain the specified parameter. The other parameters must be equal to the Credentials.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v2/administration/security/credential?

Append the following character sequences to the above URL to specify Query parameters.
Use '&' between successive query parameters: 

credentialId={credentialId}

credentialName={credentialName}

credentialScope={credentialScope}

credentialStoreId={credentialStoreId}

Examples:
To Specify the
code
NAME parameter only:

http://host:port/flexdeploy/rest/v2/administration/security/credential?credentialName={credentialName}

To Specify the
code and group code
NAME AND SCOPE parameters:

http://host:port/flexdeploy/rest/v2/administration/security/credential?credentialName={credentialName}&credentialScope={credentialScope}

To Specify the name,
group code, and sub group code
SCOPE, AND CREDENTIAL STORE ID parameters:

http://host:port/flexdeploy/rest/v2/administration/security/credential?credentialName={credentialName}&credentialScope={credentialScope}&credentialStoreId={credentialStoreId}

...

Output when querying by Credential Scope "ENVINST" through http://host:port/flexdeploy/rest/v2/administration/security/credential?credentialScope=ENVINST

Code Block
titleSample JSON Output
collapsetrue
[	
	{
		"credentialId": 11004,
    	"versionNumber": 1,
    	"credentialName": "GET Example Name 1",
    	"isActive": true,
    	"credentialScope": "ENVINST",
    	"credentialStoreId": 11000,
    	"credentialInputs": [
        	{
            	"versionNumber":1,
            	"inputValue": "TestPassword",
            	"credentialStoreInputDefId": 12000
        	}
    	]
	},
	{
		"credentialId": 11004,
    	"versionNumber": 1,
    	"credentialName": "GET Example Name 2",
    	"isActive": false,
    	"credentialScope": "ENVINST",
    	"credentialStoreId": 11020,
    	"credentialInputs": [
        	{
            	"versionNumber":1,
            	"inputValue": "TestPassword123",
            	"credentialStoreInputDefId": 13000
        	}
    	]
	},
]

...

Attributes
Type
Required
Description
credentialNameStringNoYesName of Credential.
isActiveBooleanNo

Whether or not this Credential is active. Defaults to true.

credentialScopeStringNoYes

Scope of the Credential. Possible values are ENDPOINT, INST, or ENVINST.

credentialStoreIdLongNoYesThe unique id of the associated Credential Store.
credentialInputsList<CredentialInputDataObject>YesList of the Credential Input Data Objects that are associated with this Credential.

Response Codes

...

HTTP Code

...

Description

...

CredentialInputDataObject can include the following attributes:

AttributesTypeRequiredDescription
inputValueDepends on inputYesValue for credential input
credentialStoreInputDefIdLongYesId of input definition. Can be found using the Credential Store Provider API.

Response Codes

HTTP Code
Description
201Credential was created successfully
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
500Unexpected internal server error

...

Code Block
titleSample JSON Input
collapsetrue
{
    "credentialName": "POST Example Name",
    "isActive": true,
    "credentialScope": "ENVINST",
    "credentialStoreId": 11000,
    "credentialInputs": [
        {
   
        "versionNumber":1,
            "inputValue": "TestPassword",
            "credentialStoreInputDefId": 12000
        }
    ]
}

...

Code Block
titleSample JSON Output
collapsetrue
{
	"credentialId": 11004,
    "versionNumber": 1,
    "credentialName": "POST Example Name",
    "isActive": true,
    "credentialScope": "ENVINST",
    "credentialStoreId": 11000,
    "credentialInputs": [
        {
            "versionNumber":1,
            "inputValue			"credentialId": 11004,
			"updatedBy": "TestPasswordfdadmin",
            "credentialStoreInputDefId": 12000
        }			"updatedOn": "2021-09-10T12:59:34.821+0000",
			"createdBy": "fdadmin",
			"createdOn": "2021-09-10T12:59:34.821+0000",
			"isEncrypted": true,
           ]
}

PUT

This PUT service will update all attributes of a Credential with the given Id based on the attributes of the supplied JSON object.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/{Id}

Request

...

Attributes

...

Type

...

Description

...

 "versionNumber":1,
            "inputValue": "*****",
            "credentialStoreInputDefId": 12000,
			"credentialInputId": 284872
        }
    ]
}

PUT

This PUT service will update all attributes of a Credential with the given Id based on the attributes of the supplied JSON object.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/{credentialId}

Request

No
Attributes
Type
Required
Description
credentialIdURLYesURL parameter for the Id which is used to find and update a Credential.
credentialNameStringYesName of Credential.
isActiveBooleanNo

Whether or not this Credential is active. Defaults to true if nothing is passed.

credentialScopeStringNoYes

Scope of the Credential.

credentialStoreIdLong

Possible values are ENDPOINT, INST, or ENVINST. Scope cannot be updated with a PATCH request as it is locked in after creation.

credentialStoreIdLongYesThe unique id of the associated Credential Store. Credential store id cannot be updated with a PATCH request as it is locked in after creation.
credentialInputsList<CredentialInputDataObject>NoYesList of the Credential Input Data Objects that are associated with this Credential. If currently associated Credential Input Data Object(s) are not in input list, those Data Objects will be unassigned from this Credential.

i.e. at the end of successful request, the Credential will have mapped Property Sets matching to input request.

Response Codes

HTTP Code

CredentialInputDataObject can include the following attributes:

AttributesTypeRequiredDescription
200Credential
inputValueDepends on inputYesValue for credential input
credentialStoreInputDefIdLongYesId of input definition. Can be found using the Credential Store Provider API.

Response Codes

HTTP Code
Description
200Credential was found and updated
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Credential not found
500Unexpected internal server error

Example

If we had an Credential in our database with an Id of 11104 and had the following attributes

Code Block
titleCurrent Credential
collapsetrue
{
	"credentialId": 11004,
    "versionNumber": 1,
    "credentialName": "PUT Example Name",
    "isActive": true,
    "credentialScope": "ENVINST",
    "credentialStoreId": 11000,
    "credentialInputs": [
         {
			"credentialId":            "versionNumber":1,
            "inputValue": "TestPassword",
            "credentialStoreInputDefId": 12000
        }11004,
			"updatedBy": "fdadmin",
			"updatedOn": "2021-09-09T12:59:34.821+0000",
			"createdBy": "fdadmin",
			"createdOn": "2021-09-09T12:59:34.821+0000",
			"isEncrypted": true,
           ]
}

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/11104

And the PUT request receives the following JSON Credential object,

Code Block
titleSample JSON Input
collapsetrue
{ "versionNumber":1,
            "inputValue": "*****",
    "credentialName": "PUT Example Name",     "isActivecredentialStoreInputDefId": true12000,
			"credentialInputId": 284872
   "credentialScope": "INST",    }
"credentialStoreId": 12000,     "credentialInputs": [
        {
            "versionNumber":1,
 ]
}

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/11104

And the PUT request receives the following JSON Credential object,

Code Block
titleSample JSON Input
collapsetrue
{
    "credentialName": "PUT Example Name",
    "inputValueisActive": "TestPassword1234"true,
       "credentialScope": "INST",
    "credentialStoreInputDefIdcredentialStoreId": 12000,
    "credentialInputs": [
       }, 		{
            "versionNumber":1,inputValue": "TestPassword1234",
            "credentialStoreInputDefId": 12000
        },
		{
            "inputValue": "TestPass1999",
            "credentialStoreInputDefId": 12010
        }
    ]
}

The PUT request would then update the Credential with Id 11104 and return the following JSON Credential object.

Code Block
titleSample JSON Output
collapsetrue
{
	"credentialId": 11004,
    "versionNumber": 1,
    "credentialName": "PUT Example Name",
    "isActive": true,
    "credentialScope": "INST",
    "credentialStoreId": 12000,
    "credentialInputs": [
         {
			"credentialId":            "versionNumber":1,
            "inputValue": "TestPassword1234",
            "credentialStoreInputDefId": 12000
        },
		{11004,
			"updatedBy": "fdadmin",
			"updatedOn": "2021-09-10T12:59:34.821+0000",
			"createdBy": "fdadmin",
			"createdOn": "2021-09-10T12:59:34.821+0000",
			"isEncrypted": true,
            "versionNumber":1,
            "inputValue": "TestPass1999*****",
            "credentialStoreInputDefId": 12010
 12000,
			"credentialInputId": 24895
      }  },
		  ]
}

PATCH

This PATCH service will update the information of the Credential of the specified Id with the non-null parameters of the JSON. The parameters that are null or missing will not be changed in the Credential.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/{Id}

Tip

The only required attribute is the Credential Id in the URL.

Request

...

Attributes

...

Type

...

Description

...

Whether or not this Credential is active.

Defaults to true if nothing is passed.

...

Scope of the Credential.

...

If input Credential Input Data Object(s) is not already associated, it will be associated to Credential but existing Data Object assignment that are not in PATCH request will not be unassigned.

i.e. input list is considered as append to existing assignments.

Response Codes

...

HTTP Code

...

Description

...

Example

...

{
			"credentialId": 11004,
			"updatedBy": "fdadmin",
			"updatedOn": "2021-09-10T12:59:34.821+0000",
			"createdBy": "fdadmin",
			"createdOn": "2021-09-10T12:59:34.821+0000",
			"isEncrypted": true,
            "versionNumber":1,
            "inputValue": "*****",
            "credentialStoreInputDefId": 12010,
			"credentialInputId": 284872
        }
    ]
}

PATCH

This PATCH service will update the information of the Credential of the specified Id with the non-null parameters of the JSON. The parameters that are null or missing will not be changed in the Credential.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/{credentialId}


Tip

The only required attribute is the Credential Id in the URL.

Request

Attributes
Type
Required
Description
credentialIdURLYesURL parameter for the Id which is used to find and update a Credential.
credentialNameStringNoName of Credential.
isActiveBooleanNo

Whether or not this Credential is active.

credentialScopeStringNo

Scope of the Credential. Possible values are ENDPOINT, INST, or ENVINST. Scope cannot be updated with a PATCH request as it is locked in after creation.

credentialStoreIdLongNoThe unique id of the associated Credential Store. Credential store id cannot be updated with a PATCH request as it is locked in after creation.
credentialInputsList<CredentialInputDataObject>NoList of the Credential Input Data Objects that are associated with this Credential. 

If input Credential Input Data Object(s) is not already associated, it will be associated to Credential but existing Data Object assignment that are not in PATCH request will not be unassigned.

i.e. input list is considered as append to existing assignments.

CredentialInputDataObject can include the following attributes:

AttributesTypeRequiredDescription
inputValueDepends on inputYesValue for credential input
credentialStoreInputDefIdLongYesId of input definition. Can be found using the Credential Store Provider API.

Response Codes

HTTP Code
Description
200Credential was found and patched
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Credential not found
500Unexpected internal server error

Example

If we had a Credential in our database with an Id of 11104 and had the following attributes

Code Block
titleCurrent Credential
collapsetrue
{
	"credentialId": 11004,
    "versionNumber": 1,
    "credentialName": "PUT Example Name",
    "isActive": true,
    "credentialScope": "INST",
    "credentialStoreId": 11000,
    "credentialInputs": [
         {
			"credentialId": 11004,
			"updatedBy": "fdadmin",
			"updatedOn": "2021-09-09T12:59:34.821+0000",
			"createdBy": "fdadmin",
			"createdOn": "2021-09-09T12:59:34.821+0000",
			"isEncrypted": true,
            "versionNumber":1,
            "inputValue": "*****",
            "credentialStoreInputDefId": 12000,
			"credentialInputId": 284895
        }
    ]
}

When we run a PATCH request at the following URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/11104

And the PATCH request receives the following JSON Credential object,

Code Block
titleCurrent Credential
collapsetrue
{
	"credentialId":
11004,     "versionNumber": 1,
    "credentialName": "PUT Example Name",
    "isActive": true,
    "credentialScope": "ENVINST",
    "credentialStoreId": 11000INST",
    "credentialInputs": [
        {
            "versionNumber":1,
            "inputValue": "TestPasswordTestPass1999",
            "credentialStoreInputDefId": 1200012010
        }
    ]
}

When we run a The PATCH request at would then update the Credential with Id 11104 and return the following URL

http://host:port/flexdeploy/rest/v2/administration/security/credential/11104

And the PATCH request receives the following JSON Credential object,JSON Credential object.

Info

Only the fields present in the PATCH JSON will modify the original JSON Credential object. All other fields will remain unchanged.


Code Block
titleCurrent CredentialSample JSON Output
collapsetrue
{
    "credentialScope	"credentialId": "INST"11004,
    "credentialInputsversionNumber": [1,
    "credentialName": "PUT Example  {Name",
            "versionNumber"isActive":1,
     true,
       "inputValuecredentialScope": "TestPass1999INST",
       "credentialStoreId": 11000,
    "credentialStoreInputDefIdcredentialInputs": 12010[
        } {
			"credentialId": 11004,
 ]
}

The PATCH request would then update the Credential with Id 11104 and return the following JSON Credential object.

Info

Only the fields present in the PATCH JSON will modify the original JSON Credential object. All other fields will remain unchanged.

Code Block
titleSample JSON Output
collapsetrue
{
	"credentialId": 11004			"updatedBy": "fdadmin",
			"updatedOn": "2021-09-09T12:59:34.821+0000",
			"createdBy": "fdadmin",
			"createdOn": "2021-09-09T12:59:34.821+0000",
			"isEncrypted": true,
    "versionNumber": 1,        "credentialNameversionNumber":1,
"PUT Example Name",     "isActive": true,     "credentialScopeinputValue": "INST*****",
    "credentialStoreId": 11000,        "credentialInputscredentialStoreInputDefId": [
        {12000,
			"credentialInputId": 284895
        },
		 {
 			"versionNumbercredentialId":1 11004,
			"updatedBy": "fdadmin",
			"updatedOn": "2021-09-10T12:59:34.821+0000",
        "inputValue			"createdBy": "fdadmin",
			"createdOn": "TestPassword2021-09-10T12:59:34.821+0000",
            "credentialStoreInputDefId": 12000
        },
		{			"isEncrypted": true,
            "versionNumber":1,
            "inputValue": "TestPass1999*****",
            "credentialStoreInputDefId": 12010,
			"credentialInputId": 284872
        }
    ]
}