Create relationships
/fscmRestApi/resources/11.13.18.05/assetLogicalHierarchyRelationships
Request
-
Metadata-Context:
If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
-
REST-Framework-Version:
The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
-
Upsert-Mode:
Contains one of the following values: true or false. If true, the server performs an Upsert operation instead of a Create operation. During an Upsert operation, the server attempts to find an existing resource that matches the payload. If a match is found, the server updates the existing resource instead of creating a new one. If not found or false (default), the server performs a Create operation. Note that the Upsert operation isn't supported for date-effective REST resources.
- application/json
object
-
HierarchyCode: string
Maximum Length:
30
Abbreviation that identifies the hierarchy instance. You can use either HierarchyId or HierarchyCode during the POST action. -
HierarchyId: integer
(int64)
Value that uniquely identifies the hierarchy instance.
-
ObjectAssetNumber: string
Maximum Length:
80
Number that identifies a parent asset instance. If the parent type is asset, you can either ObjectId or ObjectAssetNumber during the POST action. -
ObjectHierarchyCode: string
Maximum Length:
30
Abbreviation that identifies the parent hierarchy instance. If the parent object type is Hierarchy, you can use either ObjectId or ObjectHierarchyCode during the POST action. -
ObjectId: integer
(int64)
Value that uniquely identifies a parent object instance. For instance, it can be hierarchy identifier or asset identifier.
-
ObjectType: string
Maximum Length:
3
Default Value:A
Type of the parent object. Valid values are H for Hierarchy, A for Asset, and N for Node. -
RelationshipTypeCode: string
Maximum Length:
30
Default Value:ORA_HIERARCHY
Abbreviation that identifies the type of relationship. This is a read-only value that specifies whether the relationship is a logical relationship or a physical relationship. -
SubjectAssetNumber: string
Maximum Length:
80
Number that identifies a child object. If the child object type is asset, you can use either SubjectId or SubjectAssetNumber during the POST action. -
SubjectHierarchyCode: string
Maximum Length:
30
Abbreviation that identifies the child hierarchy instance. If the child object type is Hierarchy, you can use either SubjectId or SubjectHierarchyCode during the POST action. -
SubjectId: integer
(int64)
Value that uniquely identifies a child object instance. When SubjectType is Asset, this value is a valid asset identifier.
-
SubjectType: string
Maximum Length:
3
Default Value:A
Type of a child object. Valid values are H for Hierarchy, A for Asset, and N for Node.
Response
- application/json
Default Response
-
Metadata-Context(required):
If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
-
REST-Framework-Version(required):
The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
object
-
HierarchyCode: string
Maximum Length:
30
Abbreviation that identifies the hierarchy instance. You can use either HierarchyId or HierarchyCode during the POST action. -
HierarchyDescription: string
Read Only:
true
Maximum Length:240
Description of the hierarchy instance. -
HierarchyId: integer
(int64)
Value that uniquely identifies the hierarchy instance.
-
HierarchyName: string
Read Only:
true
Maximum Length:120
Name of the hierarchy instance. -
links: array
Links
Title:
Links
The link relations associated with the resource instance. -
ObjectAssetDescription: string
Read Only:
true
Maximum Length:240
Description of the parent asset instance. -
ObjectAssetNumber: string
Maximum Length:
80
Number that identifies a parent asset instance. If the parent type is asset, you can either ObjectId or ObjectAssetNumber during the POST action. -
ObjectAssetOperationOrganization: string
Read Only:
true
Maximum Length:18
Value of the organization code inside which a parent asset is operated. -
ObjectHierarchyCode: string
Maximum Length:
30
Abbreviation that identifies the parent hierarchy instance. If the parent object type is Hierarchy, you can use either ObjectId or ObjectHierarchyCode during the POST action. -
ObjectHierarchyDescription: string
Read Only:
true
Maximum Length:240
Description of the parent hierarchy instance. -
ObjectHierarchyName: string
Read Only:
true
Maximum Length:120
Name of the parent hierarchy instance. -
ObjectId: integer
(int64)
Value that uniquely identifies a parent object instance. For instance, it can be hierarchy identifier or asset identifier.
-
ObjectType: string
Maximum Length:
3
Default Value:A
Type of the parent object. Valid values are H for Hierarchy, A for Asset, and N for Node. -
ObjectTypeMeaning: string
Read Only:
true
Maximum Length:80
Meaning of the parent object type. -
PositionNumber: number
Read Only:
true
Number that specifies the order of a child node under its parent. -
RelationshipId: integer
(int64)
Read Only:
true
Value that uniquely identifies the relationship between the parent node and a child node. A node can be a hierarchy, asset, and so on. -
RelationshipTypeCode: string
Maximum Length:
30
Default Value:ORA_HIERARCHY
Abbreviation that identifies the type of relationship. This is a read-only value that specifies whether the relationship is a logical relationship or a physical relationship. -
RootHierarchyId: integer
(int64)
Read Only:
true
Value that uniquely identifies the root hierarchy instance. -
SubjectAssetDescription: string
Read Only:
true
Maximum Length:240
Description of the child asset instance. -
SubjectAssetNumber: string
Maximum Length:
80
Number that identifies a child object. If the child object type is asset, you can use either SubjectId or SubjectAssetNumber during the POST action. -
SubjectAssetOperationOrganization: string
Read Only:
true
Maximum Length:18
Value of the organization code inside which a child asset is operated. -
SubjectHierarchyCode: string
Maximum Length:
30
Abbreviation that identifies the child hierarchy instance. If the child object type is Hierarchy, you can use either SubjectId or SubjectHierarchyCode during the POST action. -
SubjectHierarchyDescription: string
Read Only:
true
Maximum Length:240
Description of the child hierarchy instance. -
SubjectHierarchyName: string
Read Only:
true
Maximum Length:120
Name of the child hierarchy instance. -
SubjectId: integer
(int64)
Value that uniquely identifies a child object instance. When SubjectType is Asset, this value is a valid asset identifier.
-
SubjectType: string
Maximum Length:
3
Default Value:A
Type of a child object. Valid values are H for Hierarchy, A for Asset, and N for Node. -
SubjectTypeMeaning: string
Read Only:
true
Maximum Length:80
Meaning of the child object type.
array
Links
object
-
href: string
Title:
hyperlink reference
The URI to the related resource. -
kind: string
Title:
kind
Allowed Values:[ "collection", "item", "describe", "other" ]
The kind of the related resource. -
name: string
Title:
name
The name of the link to the related resource. -
properties: object
properties
-
rel: string
Title:
relation
Allowed Values:[ "self", "lov", "parent", "canonical", "child", "enclosure", "action", "custom" ]
The name of the relation to the resource instance. Example: self.
object
-
changeIndicator: string
Change indicator or the ETag value of the resource instance.
Examples
This example describes how to create relationships.
Example cURL Command
Use the following cURL command to submit a request on the REST resource.
curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.resourceitem+json" -d 'request payload' "https://servername/fscmRestApi/resources/version/assetLogicalHierarchyRelationships"
Example 1 Request Body
The following example includes the contents of the request body in JSON format to create one logical hierarchy relationship under the hierarchy name using a subject asset identifier. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it creates.
{ "HierarchyId": 123456789101112, "ObjectType": "H", "ObjectId": 123456789101112, "SubjectType": "A", "SubjectId": 987654321 }
Example 1 Response Body
The following example includes the contents of the response body in JSON format:
{ "RelationshipId": 300100545631004, "RelationshipTypeCode": "ORA_HIERARCHY", "HierarchyId": 123456789101112, "RootHierarchyId": 123456789101112, "HierarchyCode": "Hierarchy_Code", "HierarchyName": "Hierarchy_Name", "HierarchyDescription": "Hierarchy_Description", "ObjectType": "H", "ObjectTypeMeaning": "Hierarchy", "ObjectId": 123456789101112, "ObjectHierarchyCode": "Hierarchy_Code", "ObjectHierarchyName": "Hierarchy_Name", "ObjectHierarchyDescription": "Hierarchy_Description", "ObjectAssetNumber": null, "ObjectAssetDescription": null, "ObjectAssetOperationOrganization": null, "SubjectType": "A", "SubjectTypeMeaning": "Asset", "SubjectId": 987654321, "SubjectHierarchyCode": null, "SubjectHierarchyName": null, "SubjectHierarchyDescription": null, "SubjectAssetNumber": "Parent_Asset_Number", "SubjectAssetDescription": "Parent_Asset_Description", "SubjectAssetOperationOrganization": "MNTALM", "PositionNumber": 1 }
Example 2 Request Body
The following example includes the contents of the request body in JSON format to create one logical hierarchy relationship under the hierarchy name using a subject asset number. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it creates.
{ "HierarchyCode": "Hierarchy_Code", "ObjectType": "H", "ObjectHierarchyCode": "Hierarchy_Code", "SubjectType": "A", "SubjectAssetNumber": "Child_Asset_Number" }
Example 2 Response Body
The following example includes the contents of the response body in JSON format:
{ "RelationshipId": 300100545631004, "RelationshipTypeCode": "ORA_HIERARCHY", "HierarchyId": 123456789101112, "RootHierarchyId": 123456789101112, "HierarchyCode": "Hierarchy_Code", "HierarchyName": "Hierarchy_Name", "HierarchyDescription": "Hierarchy_Description", "ObjectType": "H", "ObjectTypeMeaning": "Hierarchy", "ObjectId": 123456789101112, "ObjectHierarchyCode": "Hierarchy_Code", "ObjectHierarchyName": "Hierarchy_Name", "ObjectHierarchyDescription": "Hierarchy_Description", "ObjectAssetNumber": null, "ObjectAssetDescription": null, "ObjectAssetOperationOrganization": null, "SubjectType": "A", "SubjectTypeMeaning": "Asset", "SubjectId": 987654321, "SubjectHierarchyCode": null, "SubjectHierarchyName": null, "SubjectHierarchyDescription": null, "SubjectAssetNumber": "Parent_Asset_Number", "SubjectAssetDescription": "Parent_Asset_Description", "SubjectAssetOperationOrganization": "MNTALM", "PositionNumber": 1 }
Example 3 Request Body
The following example includes the contents of the request body in JSON format to create one logical hierarchy relationship for an asset underneath another asset using object and subject identifiers. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it creates.
{ "HierarchyId": 123456789101112, "ObjectType": "A", "ObjectId": 987654321, "SubjectType": "A", "SubjectId": 5678457879 }
Example 3 Response Body
The following example includes the contents of the response body in JSON format:
{ "RelationshipId": 300100545634270, "RelationshipTypeCode": "ORA_HIERARCHY", "HierarchyId": 123456789101112, "RootHierarchyId": 123456789101112, "HierarchyCode": "Hierarchy_Code", "HierarchyName": "Hierarchy_Name", "HierarchyDescription": "Hierarchy_Description", "ObjectType": "A", "ObjectTypeMeaning": "Asset", "ObjectId": 987654321, "ObjectHierarchyCode": null, "ObjectHierarchyName": null, "ObjectHierarchyDescription": null, "ObjectAssetNumber": "Parent_Asset_Number", "ObjectAssetDescription": "Parent_Asset_Description", "ObjectAssetOperationOrganization": "MNTALM", "SubjectType": "A", "SubjectTypeMeaning": "Asset", "SubjectId": 300100545630754, "SubjectHierarchyCode": null, "SubjectHierarchyName": null, "SubjectHierarchyDescription": null, "SubjectAssetNumber": "Child_Asset_Number", "SubjectAssetDescription": "Child_Asset_Description", "SubjectAssetOperationOrganization": "MNTALM", "PositionNumber": 1 }
Example 4 Request Body
The following example includes the contents of the request body in JSON format to create one logical hierarchy relationship for an asset underneath another asset using object and subject asset numbers. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it creates.
{ "HierarchyCode": "Hierarchy_Code", "ObjectType": "A", "ObjectAssetNumber": "Parent_Asset_Number" "SubjectType": "A", "SubjectAssetNumber": "Child_Asset_Number" }
Example 4 Response Body
The following example includes the contents of the response body in JSON format:
{ "RelationshipId": 300100545634270, "RelationshipTypeCode": "ORA_HIERARCHY", "HierarchyId": 123456789101112, "RootHierarchyId": 123456789101112, "HierarchyCode": "Hierarchy_Code", "HierarchyName": "Hierarchy_Name", "HierarchyDescription": "Hierarchy_Description", "ObjectType": "A", "ObjectTypeMeaning": "Asset", "ObjectId": 987654321, "ObjectHierarchyCode": null, "ObjectHierarchyName": null, "ObjectHierarchyDescription": null, "ObjectAssetNumber": "Parent_Asset_Number", "ObjectAssetDescription": "Parent_Asset_Description", "ObjectAssetOperationOrganization": "MNTALM", "SubjectType": "A", "SubjectTypeMeaning": "Asset", "SubjectId": 300100545630754, "SubjectHierarchyCode": null, "SubjectHierarchyName": null, "SubjectHierarchyDescription": null, "SubjectAssetNumber": "Child_Asset_Number", "SubjectAssetDescription": "Child_Asset_Description", "SubjectAssetOperationOrganization": "MNTALM", "PositionNumber": 1 }