Project Properties API

Project Properties can be accessed and modified through this API using three services: GET,PUT, and PATCH. These three services allow for the retrieval, complete update, and partial update of Project Properties.

Authentication - Use Basic Authentication for this API.

GET

There is one implementation which will find a list of Project Properties associated with the URL specified Project and return the JSON representation of the list of Project Properties.

GET by ID

This GET service will find list of Project Properties associated with the given Project and return the JSON representation of the list. 

API URL

http://host:port/flexdeploy/rest/v1/project/{projectid}/property

Request

Parameter
Type
Required
Description

projectid

URLYesThis is a URL parameter for the Project Id which is searched to find and return the Properties associated with it.

Response

AttributesTypeDescription
propertyNameStringThis is the name of the definition of a Project Property
propertyValueStringThe value associated with the property name

Response Codes

HTTP Code
Description
200Project was found and it's properties returned
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Project was not found with the specified project id
500Unexpected internal server error

Example

If we had a Project in our database with an Id of 11101 and the following properties.

Project 11101 Properties
	{
      "propertyName": "Approved Check Script",
      "propertyValue": "MyCheckScript"
   },
      {
      "propertyName": "ServiceNow Password",
      "propertyValue": "Password"
   },
      {
      "propertyName": "ServiceNow Port",
      "propertyValue": "MyPort"
   },
      {
      "propertyName": "ServiceNow URL",
      "propertyValue": "MyURL"
   },
      {
      "propertyName": "ServiceNow User Name",
      "propertyValue": "MyUserName"
   }

When we run a GET request at the following URL

http://host:port/flexdeploy/rest/v1/project/11101

The GET request would return the following JSON Project Property list

Project 11101 Properties GET Return JSON
[
      {
      "propertyName": "Approved Check Script",
      "propertyValue": "MyCheckScript"
   },
      {
      "propertyName": "ServiceNow Password",
      "propertyValue": "*****"
   },
      {
      "propertyName": "ServiceNow Port",
      "propertyValue": "MyPort"
   },
      {
      "propertyName": "ServiceNow URL",
      "propertyValue": "MyURL"
   },
      {
      "propertyName": "ServiceNow User Name",
      "propertyValue": "MyUserName"
   }
]

PUT

This PUT service will update the propertyValue of each property in the project associated with the Project id specified in the URL.

API URL

http://host:port/flexdeploy/rest/v1/project/{projectid}/property

Request

AttributesTypeRequiredDescription
projectidURLYesThis is the Id of the Project which will have it's Properties updated.
propertyNameStringNo

This is the name of the type of the single property associated with it. (Can be many)

propertyValueStringNoThis is the value that will be updated to for the property with the associated propertyName. (Can be many)

Note: unlisted properties will default to null.

Response Codes

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

Example

If we had an Project in our database with a Project Id of 25262 and the following Properties

Sample PUT JSON Request
[
      {
      "propertyName": "Approved Check Script",
      "propertyValue": "MyCheckScript"
   },
      {
      "propertyName": "ServiceNow Password",
      "propertyValue": "MyPassword"
   },
      {
      "propertyName": "ServiceNow Port",
      "propertyValue": "MyPort"
   },
      {
      "propertyName": "ServiceNow URL",
      "propertyValue": "MyURL"
   },
      {
      "propertyName": "ServiceNow User Name",
      "propertyValue": "MyUserName"
   }
]

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/v1/project/25262

And the PUT request receives the following JSON Project Properties list

Project 25262 Property PUT Receive JSON
[
      {
      "propertyName": "Approved Check Script",
      "propertyValue": "Put1"
   },
      {
      "propertyName": "ServiceNow Password",
      "propertyValue": "Put2"
   },
      {
      "propertyName": "ServiceNow Port",
      "propertyValue": "Put3"
   },
      {
      "propertyName": "ServiceNow URL",
      "propertyValue": "Put4"
   },
      {
      "propertyName": "ServiceNow User Name",
      "propertyValue": "Put5"
   }
]

The PUT request would then update the Project Properties of the Project with Id 25262 and return the  following JSON Project Properties list.

Project Properties PUT Return JSON
[
      {
      "propertyName": "Approved Check Script",
      "propertyValue": "Put1"
   },
      {
      "propertyName": "ServiceNow Password",
      "propertyValue": "*****"
   },
      {
      "propertyName": "ServiceNow Port",
      "propertyValue": "Put3"
   },
      {
      "propertyName": "ServiceNow URL",
      "propertyValue": "Put4"
   },
      {
      "propertyName": "ServiceNow User Name",
      "propertyValue": "Put5"
   }
]

PATCH

This PATCH service will update an existing Project's Properties with the information passed through a JSON object. If a property is not listed it will not be updated in the Project.

API URL

http://host:port/flexdeploy/rest/v1/project/{projectid}/property

Request

AttributesTypeRequiredDescription
projectIdURLYesThis is the Id of the Project which will have it's Properties updated.
propertyNameStringNo

This is the name of the type of the single property associated with it. (Can be many)

propertyValueStringNoThis is the value that will be updated to for the property with the associated propertyName. (Can be many)

Response

AttributesTypeDescription
propertyNameStringThis is the name of the definition of a Project Property
propertyValueStringThe value associated with the property name

Response Codes

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

Example

If we had a Project in our database with an Id of 12723 and had the following attributes

Project Properties PATCH JSON
[
      {
      "propertyName": "Approved Check Script",
      "propertyValue": "MyCheckScript"
   },
      {
      "propertyName": "ServiceNow Password",
      "propertyValue": "MyPassword"
   },
      {
      "propertyName": "ServiceNow Port",
      "propertyValue": "MyPort"
   },
      {
      "propertyName": "ServiceNow URL",
      "propertyValue": "MyURL"
   },
      {
      "propertyName": "ServiceNow User Name",
      "propertyValue": "MyUserName"
   }
]

When we run a PATCH request at the following URL

http://host:port/flexdeploy/rest/v1/project/12723

And the PATCH request receives the following JSON Project Properties object,

Project PATCH Receive JSON
[ 
   {
       "propertyName": "ServiceNow URL",
       "propertyValue": "PatchedURL"
    },
       {
       "propertyName": "ServiceNow User Name",
       "propertyValue": "PatchedUserName"
    }
]

The PATCH request would then update the specified Project's Properties and return the  following JSON object

Project Properties PATCH Return JSON
[
      {
      "propertyName": "Approved Check Script",
      "propertyValue": "MyCheckScript"
   },
      {
      "propertyName": "ServiceNow Password",
      "propertyValue": "MyPassword"
   },
      {
      "propertyName": "ServiceNow Port",
      "propertyValue": "MyPort"
   },
      {
      "propertyName": "ServiceNow URL",
      "propertyValue": "PatchedURL"
   },
      {
      "propertyName": "ServiceNow User Name",
      "propertyValue": "PatchedUserName"
   }
]
The following macros are not currently supported in the footer:
  • style