Get inventory types

get

/rest/ofscMetadata/v1/inventoryTypes

The operation retrieves a collection of inventory types.

Configuration: You must grant permissions to the Core API and must at least set Read-Only access to the Inventory type entity in the Configuration, Applications (API permissions) screen.

Request

Query Parameters
  • The translation language code.

    Based on the value of this parameter, the translations for the name and unit of measurement of the inventory type is returned in the 'name' and 'unitOfMeasurement' fields.

    • If the value is specified, then the translated value is returned in the 'name' and 'unitOfMeasurement' fields, and the 'translations' field is not returned in the response.
    • If translation for the specified language does not exist, then the value in the 'name' and 'unitOfMeasurement' fields is returned in English.
    • If the value is not specified, then the 'translations' field is returned in the response and contains the translations to every language in the system.

    For the list of supported language codes, see Supported Language Codes.

  • The number of inventory type records 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.
  • 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.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : InventoryTypes
Type: object
An array of the inventory type records in the collection.
Show Source
  • Contains one of the following values: true or false.

    If true, then there are more results that can be retrieved with successive paging requests.

    If false or if the value is not present, then there are no more results or this is the final page. The default value is true.

  • items
  • The limit value specified in the request. If the value is not specified in the request or if the specified value is not accepted, then it defaults to 100.
  • The offset value specified in the request.
  • The total number of the inventory type records in the collection.
Nested Schema : items
Type: array
Show Source
Nested Schema : Inventory Type
Type: object
Title: Inventory Type
Show Source
  • Title: Active
    Indicates whether the inventory type is valid for creating an inventory. If the value is true, then the inventory type is listed as a possible value in the 'Inventory Type' drop-down list in Manage or Mobility apps while creating an inventory. If the value is false, then the inventory type is not listed as a value in the drop-down list.
  • Title: Label
    Inventory type label.
  • Title: Model Property
    Label of an inventory property which is used to identify model of this inventory.
  • Title: Name
    Minimum Length: 1
    Maximum Length: 40
    The translation for the name of the inventory type. If the value of the language parameter is specified, then the name is provided in the specified language. If the value is not specified, then the name is provided in English. Minimum Length: 1, Maximum Length: 40.
  • Title: Non Serialized
    Indicates whether the inventory is serialized. If the value is true, then the inventory is serialized, that is, it has a serial number. If the value is false, then the inventory is non-serialized, that is, it doesn't have a serial number.
  • Title: Quantity precision
    Number of digits after decimal point of the quantity for non-serialized inventory . '0' value means that the quantity doesn't have a fractional part.
  • Translations
    Title: Translations
    The list of translations associated with the name and unit of measurement of the inventory type. The list is only returned if the language parameter is not specified in the request. language: string - The language code of the translated text. The code in the response is two characters long. For example, 'en', 'es'.
  • Title: Unit Of Measurement
    The translation for the unit of measurement of the inventory type. If the value of the language parameter is specified, then the unit of measurement is provided the specified language. If the value is not specified, then the unit of measurement is provided in English. This attribute is used only for non-serialized inventory.
Nested Schema : Translations
Type: array
Title: Translations
The list of translations associated with the name and unit of measurement of the inventory type. The list is only returned if the language parameter is not specified in the request. language: string - The language code of the translated text. The code in the response is two characters long. For example, 'en', 'es'.
Show Source
Nested Schema : TranslationInvType
Type: object
Show Source

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

Example 1

The following example shows how to obtain a collection of inventory types by submitting a GET request on the REST resource using cURL.

Use the cURL command with the following syntax:

curl -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \
     -H 'Accept: application/json' \
     'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes/?limit=2&offset=2'

Response Header Example

The following shows an example of the response header:

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 24 Jan 2018 12:28:18 GMT
Content-Type: application/json; charset=utf-8
Connection: close

Response Body Example

The following shows an example of the response body in JSON format:

{
    "hasMore": true,
    "totalResults": 10,
    "limit": 2,
    "offset": 2,
    "items": [
        {
            "label": "DT",
            "name": "Digital Telephony",
            "active": true,
            "nonSerialized": false,
            "modelProperty": "inventory_model",
            "translations": [
                {
                    "language":"en",
                    "name": "Digital Telephony",
                    "languageISO": "en-US"
                },
                {
                    "language":"es",
                    "name": "Telefonía digital",
                    "languageISO": "es-ES"
                }
            ],
            "links": [
                {
                    "rel": "describedby",
                    "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/inventoryTypes"
                }
            ]
        },
        {
            "label": "EC",
            "name": "Ethernet Cable",
            "unitOfMeasurement": "ft",
            "active": true,
            "nonSerialized": true,
            "modelProperty": "inventory_model",
            "translations": [
                {
                    "language":"en",
                    "name": "Ethernet Cable",
                    "unitOfMeasurement": "ft",
                    "languageISO": "en-US"
                },
                {
                    "language":"es",
                    "name": "Cable Ethernet",
                    "unitOfMeasurement": "m",
                    "languageISO": "es-ES"
                }
            ],
            "links": [
                {
                    "rel": "describedby",
                    "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/inventoryTypes"
                }
            ]
        }
    ],
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes/?limit=2&offset=2"
        },
        {
            "rel": "prev",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes/?limit=2&offset=0"
        },
        {
            "rel": "next",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes/?limit=2&offset=4"
        },
        {
            "rel": "describedby",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/inventoryTypes"
        }
    ]
}

Example 2

The following example shows how to obtain a collection of inventory types by using the language parameter with the GET request on the REST resource.

Use the cURL command with the following syntax:

curl -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \
     -H 'Accept: application/json' \
     'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes/?language=en-US&limit=2&offset=2'

Response Header Example

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 24 Jan 2018 12:28:18 GMT
Content-Type: application/json; charset=utf-8
Connection: close

Response Body Example

The following shows an example of the response body in JSON format:

{
    "hasMore": true,
    "totalResults": 10,
    "limit": 2,
    "offset": 2,
    "items": [
        {
            "label": "DT",
            "name": "Digital Telephony",
            "active": true,
            "nonSerialized": false,
            "modelProperty": "inventory_model",
            "links": [
                {
                    "rel": "describedby",
                    "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/inventoryTypes"
                }
            ]
        },
        {
            "label": "EC",
            "name": "Ethernet Cable",
            "unitOfMeasurement": "ft",
            "active": true,
            "nonSerialized": true,
            "modelProperty": "inventory_model",
            "links": [
                {
                    "rel": "describedby",
                    "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/inventoryTypes"
                }
            ]
        }
    ],
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes/?limit=2&offset=2"
        },
        {
            "rel": "prev",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes/?limit=2&offset=0"
        },
        {
            "rel": "next",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes/?limit=2&offset=4"
        },
        {
            "rel": "describedby",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/metadata-catalog/inventoryTypes"
        }
    ]
}
Back to Top