Get resource inventories
get
/rest/ofscCore/v1/resources/{resourceId}/inventories
This operation retrieves the resource inventories for the specified resource.
Request
Path Parameters
-
resourceId(required): string
The unique identifier of the resource in Oracle Field Service.
Query Parameters
-
limit: integer
The number of items to be returned in the response. The minimum value that can be specified is 1 and the maximum value that can be specified is 100. If the specified value is greater than 100, zero, or if no value is specified, then it defaults to 100.
-
offset: integer
The record number from which the retrieval starts. The default value is zero. If no value is specified, then it defaults to zero. The value zero indicates that the retrieval will start from the beginning of the collection.
Response
Supported Media Types
- application/json
200 Response
This section describes the 200 status response for this operation.
Root Schema : Resource Inventories
Type:
object
Title:
Resource Inventories
The collection of resource inventories.
Show Source
-
items:
array Resource Inventories
Title:
Resource Inventories
An array of resource inventories.
Nested Schema : Resource Inventories
Type:
array
Title:
Resource Inventories
An array of resource inventories.
Show Source
-
Array of:
object Inventory
Title:
Inventory
The inventory that can be installed or deinstalled during an activity.
Nested Schema : Inventory
Type:
object
Title:
Inventory
The inventory that can be installed or deinstalled during an activity.
Show Source
-
activityId:
integer
Title:
Activity ID
The unique identifier of the activity to which the inventory is assigned. If the status of the inventory is set to resource, then the activity ID is not returned. -
exchangedInventoryId:
integer
Title:
Exchanged Inventory ID
The identifier of the inventory that is returned when the resource exchanges the inventory with another resource. -
inventoryId:
integer
Title:
Inventory ID
The unique identifier of inventory in Oracle Field Service. -
inventoryType:
string
Title:
Inventory Type
The inventory type specified in the request. -
quantity:
number
Title:
Quantity
The quantity of inventory specified in the request. -
resourceId:
string
Title:
Resource ID
The identifier of the resource to which the inventory is assigned. -
serialNumber:
string
Title:
Serial Number
The serial number specified in the request. -
status:
string
Title:
Status
Allowed Values:[ "customer", "resource", "installed", "deinstalled" ]
The current status of the specified inventory. It indicates the location of the inventory, for example, at customer's site, or in technician's truck.
Default Response
This section describes the default error response for this operation.
Root Schema : Error
Type:
Show Source
object
-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
Examples
The following example shows how to get resource inventories for resources by submitting a GET request on the REST resource.
Example of Request Header
The following shows an example of the request header.
GET /rest/ofscCore/v1/resources/33035/inventories HTTP/1.0 Authorization: Basic c29hcEB5YW1hdG86MQ== Host: <instance_name>.fs.ocs.oraclecloud.com Accept: */*
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK Server: nginx/1.6.2 Date: Mon, 06 Jul 2015 13:20:14 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.
{ "items": [ { "inventoryId": 20997542, "status": "provider", "inventoryType": "TV", "serialNumber": "PLBJ1C3AB", "quantity": 1, "resourceId": "44035" }, { "inventoryId": 20996913, "status": "provider", "inventoryType": "DT", "serialNumber": "58NBME39T065517", "quantity": 1, "resourceId": "44035" }, { "inventoryId": 20996675, "status": "provider", "inventoryType": "DT", "serialNumber": "HRSC63602", "quantity": 1, "resourceId": "44035" }, { "inventoryId": 20997195, "status": "provider", "inventoryType": "AT", "serialNumber": "PMUD106F8", "quantity": 1, "resourceId": "44035" } ], "total": 4, "links": [ { "rel": "canonical", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/wwwroot-master/rest/ofscCore/v1/resources/44035/inventories" }, { "rel": "describedby", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/wwwroot-master/rest/ofscCore/v1/metadata-catalog/resources" } ] }