Versions Compared

Key

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

...

Request

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

Response Codes

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

Example

If we a Resource Type in our database with an Id of 20408 and the following attributes

When we run a GET request at the following URL

http://host:port/flexdeploy/rest/v2/administration/resourcetype/20408

The GET request would return the following JSON Resource Type object

Code Block
themeEclipse
titleResource type GET Return JSON
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "resourceTypeName": "PostmanGet Resource Type Test REST 1Example Name",
    "isActive": true,
    "createdOn": 1629882360332,
    "versionNumber": 1,
    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 1629882360332
}

GET by Query Parameters

...

Code Block
titleSample JSON Output
[
    {
        "description": "Postman test data 1 updated",
        "ownerType": null,
        "resourceTypeName": "PostmanGet Resource Type Test REST 1 Example Name updated1",
        "isActive": false,
        "createdOn": 1629882360332,
        "versionNumber": 1,
        "createdBy": "fdadmin",
        "resourceTypeId": 20408,
        "updatedBy": "fdadmin",
        "updatedOn": 1629883055449
    }
]

...

Code Block
titleSample JSON Input
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "isActive": true,
    "resourceTypeName": "PostmanGet Resource Type Test REST 1Example Name"
}

the following Resource Type will be created in the database. Notice the updated Resource Type Id field.

Code Block
titleSample JSON Output
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "resourceTypeName": "PostmanGet Resource Type Test REST 1Example Name",
    "isActive": true,
    "createdOn": 1629882360332,
    "versionNumber": 1,
    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 1629882360332
}

...

Request

Attributes
Type
Required
Description
IdURLYesURL parameter for the Id which is used to find and update a Resource Type.
resourceTypeNameStringYesName of Resource Type.
isActiveBooleanNo

Whether or not this Resource Type is active.

Defaults to true if nothing is passed.

ownerTypeStringNo

Owner Type value of the Resource Type.

Response Codes

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

Example

If we had an Resource Type in our database with an Id of 20408 and had the following attributes

Code Block
titleCurrent Resource Type
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "resourceTypeName": "PostmanGet Resource Type Test REST 1Example Name",
    "isActive": true,
    "createdOn": 1629882360332,
    "versionNumber": 1,
    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 1629882360332
}

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/v2/administration/resourcetype/20408

And the PUT request receives the following JSON Resource Type object,

Code Block
titleSample JSON Input
{
    "description": "Postman test data 1 updated",
	"ownerType": "",
	"isActive":false,
	"resourceTypeName": "PostmanGet ResourceExample Type Test REST 1 Name updated"
}

The PUT request would then update the Resource Type with Id 20408 and return the following JSON Resource Type object.

Code Block
titleSample JSON Output
{
    "description": "Postman test data 1 updated",
    "ownerType": "",
    "resourceTypeName": "PostmanGet Resource Type Test REST 1 Example Name updated",
    "isActive": false,
    "createdOn": 1629882360332,
    "versionNumber": 2,
    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 1629882746226
}

PATCH

...

Code Block
titleCurrent Resource Type
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "resourceTypeName": "PostmanGet Resource Type Test RESTExample Name 1",
    "isActive": true,
    "createdOn": 1629882360332,
    "versionNumber": 1,
    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 1629882360332
}

...

Code Block
titleCurrent Resource Type
{
    "resourceTypeName": "PostmanGet ResourceExample Type Test REST 1 Name patched"
}

The PATCH request would then update the Resource Type with Id 20408 and return the following JSON Resource Type object.

...

Code Block
titleSample JSON Output
{
    "description": "Postman test data 1",
    "ownerType": "Workflow",
    "resourceTypeName": "PostmanGet Resource Type Test REST 1Example Name patched",
    "isActive": true,
    "createdOn": 1629882360332,
    "versionNumber": 2,
    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 1629882779169
}

...