Versions Compared

Key

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

Anchor
Top
Top

...

Info
titleBase URL for Project Properties REST API

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

Table of Contents
maxLevel2

...

Info
titleAPI URL

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

Parameters


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 Codes

HTTP Code
Description
200Project was found and it's properties returned
400Bad request
401Unauthorized
404Project was not found with the specified project id
500Unexpected internal server error


...


Info
titleAPI URL

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


Code Block
themeEclipse
titleSample PUT JSON Request
[
      {
      "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"
   }
]

Parameters

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
401Unauthorized
404Project not found
500Unexpected internal server error


...

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.


Info
titleAPI URL

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


Parameters

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 Codes


HTTP Code
Description
200Project was found and it's Properties were updated
400Bad request
401Unauthorized
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

Code Block
themeEclipse
titleProject 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/project/12723

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

Code Block
themeEclipse
titleProject 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

Code Block
themeEclipse
titleProject 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"
   }
]


Back to Top

...