Anchor | ||||
---|---|---|---|---|
|
...
Example
If we had a Project in our database with an Id of 11101 and the following properties.
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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/project/
{11101
}
The GET request would return the following JSON Project Property list
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "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" } ] |
...
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/project/
{25262
}
And the PUT request receives the following JSON Project Properties list
...
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 | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/project/{projectid} |
...
Parameters
Attributes | Type | Required | Description |
---|---|---|---|
projectid | URL | Yes | This is the Id of the Project which will have it's Properties updated. |
propertyName | String | No | This is the name of the type of the single property associated with it. (Can be many) |
propertyValue | String | No | This is the value that will be updated to for the property with the associated propertyName. (Can be many) |
Response Codes
HTTP Code | Description |
---|---|
200 | Project was found and it's Properties were updated |
400 | Bad request |
401 | Unauthorized |
404 | Project not found |
500 | Unexpected internal server error |
Example
If we had a Project in our database with an Id of 12723 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "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 | ||||
---|---|---|---|---|
| ||||
[ { "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 | ||||
---|---|---|---|---|
| ||||
[ { "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" } ] |
...