Create Assets Structure Relationships
You can use REST API to create and update customer and enterprise assets in the asset repository. You can create and update the assets, their associated structure, part list items, and charges details.
Let's discuss creating a structure relationship between assets.
Example URL
Use this resource URL format.
Specify the parent asset identifier to which the child asset needs to be added to the asset structure; for example, parent asset identifier is 300100181820187 and the child asset identifier is 300100181820245.
POST
curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.resourceitem+json" -d 'request payload' "https://servername/fscmRestApi/resources/version/installedBaseAssets/300100181820187/child/relationships"
Example Request
Here's an example of the request body in JSON format.
This table shows the values that are required to create an asset relationship.
Value | Description |
---|---|
AssetId |
Value that uniquely identifies the child asset in the structure. You must provide the value that identifies the child asset to create the relationship. |
{ "AssetId": 300100181820245 }
Example Response
Here's an example of the response body in JSON format.
{ "RelationshipId" : 300100181822665, "AssetId" : 300100181820245, "AssetNumber" : "F/0554-328-C", "SerialNumber" : null, "ItemNumber" : null, "links" : [ { "rel" : "self", "href" : "https://servername/fscmRestApi/resources/version/installedBaseAssets/300100181820187/child/relationships/300100181822665", "name" : "relationships", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178" } }, { "rel" : "canonical", "href" : "https://servername/fscmRestApi/resources/version/installedBaseAssets/300100181820187/child/relationships/300100181822665", "name" : "relationships", "kind" : "item" }, { "rel" : "parent", "href" : "https://servername/fscmRestApi/resources/version/installedBaseAssets/300100181820187", "name" : "installedBaseAssets", "kind" : "item" } ] }