Resource Type API v2

Resource Type API v2

Available from 5.6.0.1

Resource Types 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 Resource Types.

Authentication - Use Basic Authentication for this API.

GET

There are two implementations of GET. One will find a Resource Type with the given Id and return the JSON representation of the Resource Type. The other will find a list of Resource Types matching the parameters supplied to it.

GET by ID

This GET service will find a Resource Type with the given Id and return the JSON representation of the object.

API URL

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

Request

Parameter

Required

Type

Description

Parameter

Required

Type

Description

Id

Yes

URL

URL parameter for the Id which is used to find and return a Resource Type

Response Codes

HTTP Code

Description

HTTP Code

Description

200

Resource Type was found and returned

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

404

Resource Type not found

500

Unexpected 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

Resource type GET Return JSON
{ "description": "Postman test data1", "ownerType": "Workflow", "resourceTypeName": "Get Example Name", "isActive": true, "createdOn": 1629882360332, "versionNumber": 1, "createdBy": "fdadmin", "resourceTypeId": 20408, "updatedBy": "fdadmin", "updatedOn": 1629882360332 }

GET by Query Parameters

This GET service will return a list of Resource Types in the form of JSON objects based on the query parameters resourceTypeId, resourceTypeName, ownerType, and isActive. Resource Types 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 Resource Types. The resourceTypeName parameter returns Resource Types that contain the specified parameter. The other parameters must be equal to the Resource Types.

API URL

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

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

resourceTypeId={resourceTypeId}

resourceTypeName={resourceTypeName}

isActive={isActive}

ownerType={ownerType}

Examples:
To Specify the code parameter only:

http://host:port/flexdeploy/rest/v2/administration/resourcetype?resourceTypeId={resourceTypeId}

To Specify the code and group code parameters:

http://host:port/flexdeploy/rest/v2/resourcetype?resourceTypeId={resourceTypeId}&resourceTypeName={resourceTypeName}

To Specify the name, group code, and sub group code parameters:

http://host:port/flexdeploy/rest/v2/resourcetype?resourceTypeId={resourceTypeId}&resourceTypeName={resourceTypeName}&ownerType={ownerType}

The query parameters are not case sensitive. Searching by resourceTypeName=NAME is the same as searching by resourceTypeName=name.

Request

Parameter

Required

Type

Description

Parameter

Required

Type

Description

resourceTypeId

No

Query - Long

This is a URL query parameter for the Resource Type Id which is used to search the Resource Types.

Equals search

resourceTypeName

No

Query - String

This is a URL query parameter for the Resource Type Name which is used to search the Resource Types.

Like ignore case search

ownerType

No

Query - String

This is a URL query parameter for the Owner Type which is used to search the Resource Types.

Equals ignore case search

isActive

No

Query - Boolean

This is a URL query parameter for the Is Active which is used to search the Resource Types.

Equals search

Response Codes

HTTP Code

Description

HTTP Code

Description

200

Search successful and results returned

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

500

Unexpected internal server error

Example

Output when querying by isActive through http://host:port/flexdeploy/rest/v2/administration/resourcetype?isActive=false

Sample JSON Output
[ { "description": "Postman test data 1 updated", "ownerType": null, "resourceTypeName": "Get Example Name updated1", "isActive": false, "createdOn": 1629882360332, "versionNumber": 1, "createdBy": "fdadmin", "resourceTypeId": 20408, "updatedBy": "fdadmin", "updatedOn": 1629883055449 } ]

POST

The POST service will create a new Resource Type with the same attributes as the given JSON object. It returns the JSON representation of the Resource type that was just created with an updated ID attribute.

API URL

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

Request

Attributes

Type

Required

Description

Attributes

Type

Required

Description

resourceTypeName

String

Yes

Name of Resource Type

isActive

Boolean

No

Whether or not this Resource Type is active.

description

String

No

Description of the Resource Type.

ownerType

String

No


Owner Type value of the Resource Type.

Response Codes

HTTP Code

Description

HTTP Code

Description

201

Resource type was created successfully

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

500

Unexpected internal server error

Example

If the POST receives the following JSON Resource Type object,

Sample JSON Input
{ "description": "Postman test data1", "ownerType": "Workflow", "isActive": true, "resourceTypeName": "Get Example Name" }

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

Sample JSON Output
{ "description": "Postman test data1", "ownerType": "Workflow", "resourceTypeName": "Get Example Name", "isActive": true, "createdOn": 1629882360332, "versionNumber": 1, "createdBy": "fdadmin", "resourceTypeId": 20408, "updatedBy": "fdadmin", "updatedOn": 1629882360332 }

PUT

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

API URL

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

Request

Attributes

Type

Required

Description

Attributes

Type

Required

Description

Id

URL

Yes

URL parameter for the Id which is used to find and update a Resource Type.

resourceTypeName

String

Yes

Name of Resource Type.

isActive

Boolean

No

Whether or not this Resource Type is active.

Defaults to true if nothing is passed.

ownerType

String

No

Owner Type value of the Resource Type.

Response Codes

HTTP Code

Description

HTTP Code

Description

200

Resource Type was found and updated

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

404

Resource Type not found

500

Unexpected internal server error

Example

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

Current Resource Type
{ "description": "Postman test data1", "ownerType": "Workflow", "resourceTypeName": "Get Example 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,

Sample JSON Input
{ "description": "Postman test data 1 updated", "ownerType": "", "isActive":false, "resourceTypeName": "Get Example Name updated" }

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

Sample JSON Output
{ "description": "Postman test data 1 updated", "ownerType": "", "resourceTypeName": "Get Example Name updated", "isActive": false, "createdOn": 1629882360332, "versionNumber": 2, "createdBy": "fdadmin", "resourceTypeId": 20408, "updatedBy": "fdadmin", "updatedOn": 1629882746226 }

PATCH

This PATCH service will update the information of the Resource Type 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 Resource Type.

API URL

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

The only required attribute is the Resource Type Id in the URL.

Request

Attributes

Type

Required

Description

Attributes

Type

Required

Description

Id

URL

Yes

URL parameter for the Id which is used to find and update a Resource Type.

resourceTypeName

String

No

Name of Resource Type.

isActive

Boolean

No

Whether or not this Resource Type is active.

Defaults to true if nothing is passed.

ownerType

String

No

Owner Type value of the Resource Type.

Response Codes

HTTP Code

Description

HTTP Code

Description

200

Resource Type was found and patched

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

404

Resource Type not found

500

Unexpected internal server error

Example

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

Current Resource Type
{ "description": "Postman test data1", "ownerType": "Workflow", "resourceTypeName": "Get Example Name 1", "isActive": true, "createdOn": 1629882360332, "versionNumber": 1, "createdBy": "fdadmin", "resourceTypeId": 20408, "updatedBy": "fdadmin", "updatedOn": 1629882360332 }

When we run a PATCH request at the following URL

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

And the PATCH request receives the following JSON Resource Types object,

Current Resource Type
{ "resourceTypeName": "Get Example Name patched" }

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

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

Sample JSON Output
{ "description": "Postman test data 1", "ownerType": "Workflow", "resourceTypeName": "Get Example Name patched", "isActive": true, "createdOn": 1629882360332, "versionNumber": 2, "createdBy": "fdadmin", "resourceTypeId": 20408, "updatedBy": "fdadmin", "updatedOn": 1629882779169 }

DELETE

This DELETE service will find the Resource Type with the given Id and deletes it. 

API URL

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

The only required attribute is the Resource Type Id in the URL.

Request

Attributes

Type

Required

Description

Attributes

Type

Required

Description

Id

URL

Yes

URL parameter for the Id which is used to find and update a Resource Type.

Response Codes

HTTP Code

Description

HTTP Code

Description

200

Resource Type was deleted successfully

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

404

Resource Type not found

500

Unexpected internal server error

The following macros are not currently supported in the footer:
  • style