Create or update a catalog item
/rest/ofscPartsCatalog/v1/catalogs/{catalog}/{language}/{itemLabel}
This operation creates or updates a catalog item with the specified catalog label, specified language, and the specified item label.
The Parts Catalog service is modified to manage the updates internally so that it does not cause constant catalog redistribution to the technician devices. All the incremental updates to the catalog are collected and applied after a certain period of time, which could take up to 4 hours.
Request
-
catalog(required): string
The label of the catalog.
-
itemLabel(required): string
The label of the catalog item.
-
language(required): string
The ISO language code (for example, 'en-US').
Use the reserved word 'all' to make the catalog available for all users regardless of configured language.
object
Catalog Item
-
fields(required):
array fields
The list of catalog item fields that allow you to filter the catalog data.
-
images:
array images
The list of images of the catalog item.
-
linkedItems:
array linkedItems
The list of linked items associated with the catalog item.
-
tags:
array tags
The list of tags associated with the catalog item.
-
type(required):
string
Title:
Catalog Item Type
The parameter that allows you to define the type of data in your catalog. -
weight:
integer
Title:
Catalog Item weight
Default 1. Item weight used for sorting during cache loading. Items with weight=0 will not be cahced for offline usage. May be used to reduce the size of the catalog cache in user devices (too many items may exceed available memory).
array
array
object
-
label(required):
string
Title:
Field Label
The label assigned to the catalog item fields. -
value(required):
string
Title:
Field Value
The value assigned to the catalog item fields. The value of the item field can be a empty string.
object
-
imageURL(required):
string
Title:
Image URL
The URL address of the image assigned to the catalog item.
object
-
data:
string
Title:
Additional Link Data
The additional linked data assigned to the catalog item. The linked data is displayed in the mobile interface. -
itemLabel(required):
string
Title:
Item Label
Minimum Length:1
Maximum Length:165
The unique label assigned to each linked item associated with the catalog item. The maximum length is 165 symbols.
Response
- application/json
- application/schema+json
204 Response
Default Response
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 create or update an item by submitting a PUT request on the REST resource:
cURL command Example
curl -u 'clientID@instanceName:clientSecret' \ -X PUT \ --url 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscPartsCatalog/v1/catalogs/my_catalog/en/RG5-7691-250CN' \ -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{ "type": "parts", "fields": [ { "label": "part_id", "value": "RG5-7691-250CN" }, { "label": "vendor", "value": "HEWLETT PACKARD" }, { "label": "descr", "value": "110V FUSER ASSEMBLY" }, { "label": "price", "value": "943.80" } ], "tags": [ "Printer", "Cartridge" ], "linkedItems": [ { "itemLabel": "RG5-7691-250CN", "data": "1" }, { "itemLabel": "RG5-7691-250CF", "data": "2" }, { "itemLabel": "RG5-7691-250CZ", "data": "3" } ], "images": [ { "imageURL": "https://www.storage-service.com/rg5_7691_250cz.png" }, { "imageURL": "https://www.storage-service.com/rg5_7691_250cf.png" } ] }'
Response Header Example
The following shows an example of the response header.
HTTP/1.1 200 OK Server: nginx Date: Thu, 07 Feb 2019 16:28:18 GMT Content-Type: application/json; charset=utf-8 Connection: close
Response Body Example
204 Response Operation completed successfully