Install an inventory
post
/rest/ofscCore/v1/resources/{resourceId}/inventories/{inventoryId}/custom-actions/install
This operation installs the specified inventory for the specified resource. The operation changes the inventory status to 'installed' and adds it to the 'installed' list of inventories for the specified activity.
If the inventory is associated with a segmentable activity, then the Activity ID must be specified.
Request
Path Parameters
-
inventoryId(required): integer
The unique identifier of the inventory in Oracle Field Service.
-
resourceId(required): string
The unique identifier of the resource to which the inventory is assigned or the activity (that has the inventory assigned to it) is assigned.
Root Schema : Inventory Custom Action
Type:
objectTitle:
Inventory Custom ActionThe schema of the request body object for this operation.
Show Source
-
activityId:
integer
Title:
Activity IDThe unique identifier of the activity in Oracle Field Service. -
quantity:
number
Title:
Quantity of InventoryThe quantity of the inventory.
Response
Supported Media Types
- application/json
200 Response
This section describes the 200 status response for this operation.
Default Response
This section describes the default error response for this operation.
Root Schema : Error
Type:
objectError response
Show Source
-
detail:
string
The detailed information about the error.
-
status:
string
The HTTP status code.
-
title:
string
The summary of the error message.
-
type:
string
The URL of the page containing the error details.
Examples
The following example shows how to install a inventory for a resource by submitting a POST request on the REST resource.
Example of Request Header
The following shows an example of the request header.
POST /rest/ofscCore/v1/resources/44035/inventories/21258547/custom-actions/install HTTP/1.0 Authorization: Basic c29hcEB5YW1hdG86MQ== Host: <instance_name>.fs.ocs.oraclecloud.com Accept: */*
Example of Request Body
The following example shows the contents of the request body in JSON format.
{
"quantity": "30",
"activityId": "4225279"
}Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK Server: nginx/1.6.2 Date: Fri, 24 Jul 2015 08:35:48 GMT Content-Type: application/json; charset=utf-8 Connection: close
Example of Response Body
The following example shows the contents of the response body in JSON format.
{
"inventoryId": 21258547,
"status": "install",
"inventoryType": "EC",
"serialNumber": "werwerwerwe",
"quantity": 30,
"resourceId": "44011",
"activityId": 21258547,
"links": [
{
"rel": "canonical",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/inventories/21258547"
},
{
"rel": "describedby",
"href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/metadata-catalog/inventories"
}
]
}