Create resource inventory

post

/rest/ofscCore/v1/resources/{resourceId}/inventories

This operation will create a new inventory assigned to the specified resource. The inventory will have status = 'resource'.

Request

Path Parameters
Body ()
Root Schema : Create inventory request
Type: object
Title: Create inventory request
Show Source
  • Title: Inventory Type
    Type of the inventory as defined in OFSC. The inventory type marks inventory as serialized (identified by its serial number) or non-serialized (having no serial number).
  • Title: Quantity
    Quantity of inventory
  • Title: Serial Number
    Serial number that is unique among inventories of the same type

Response

Supported Media Types

201 Response

Body ()
Root Schema : Inventory
Type: object
Title: Inventory
Equipment that can be installed or deinstalled during an activity
Show Source
  • Title: Activity Id
    Id of activity this inventory is assigned to. This field will be empty for inventories with status=resource
  • Title: Exchanged Inventory Id
    If an inventory was exchanged by resource with another inventory, then this field contains Inventory Id of the inventory it was exchanged with
  • Title: Inventory Id
    Unique identifier of inventory in Oracle Field Service Cloud
  • Title: Inventory Type
    Type of the inventory as defined in OFSC. The inventory type marks inventory as serialized (identified by its serial number) or non-serialized (having no serial number).
  • Title: Quantity
    Quantity of inventory
  • Title: Resource Id
    Resource that has this inventory (or resource that is assigned an activity that has this inventory)
  • Title: Serial Number
    Serial number that is unique among inventories of the same type
  • Title: Status
    Allowed Values: [ "customer", "resource", "installed", "deinstalled" ]
    Current status of inventory: whether it is located e.g. at customers site, or in technicians truck

Default Response

Error response
Body ()
Root Schema : Error
Type: object
Show Source

Examples

The following example shows how to create a resource inventory by submitting a POST request on the REST resource.

Example of Request Header

The following shows an example of the request header.

PUT /rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP/inventories HTTP/1.0
Authorization: Basic c29hcEB5YW1hdG86MQ==
Host: api.etadirect.com
Accept: */*
Content-Type: application/json; charset=utf-8
Content-Length: 228

Example of Request Body

The following shows an example of the request body in JSON format.

{
        "inventoryType": "NORMAL",
        "resourceId": "44001",
        "status": "provider"
}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 201 Created
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.

{
        "inventoryId": 21258594,
        "status": "provider",
        "inventoryType": "NORMAL",
        "serialNumber": "",
        "quantity": 1,
        "exchangedInventoryId": 0,
        "resourceId": "44035"
}