Create a catalog
put
/rest/ofscPartsCatalog/v1/catalogs/{catalog}/{language}
This operation creates a new catalog with the specified catalog label and the specified language.
Request
Path Parameters
-
catalog(required): string
The label of the catalog.
-
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.
Root Schema : catalogSchema
Type:
Show Source
object
-
fieldSchemas(required):
array fieldSchemas
The array of objects wherein each object describes a catalog field.
-
name(required):
string
Title:
Catalog Name
The name of the catalog. -
typeSchemas:
array typeSchemas
The array of objects wherein each object describes an item type.
Nested Schema : fieldSchemas
Type:
array
The array of objects wherein each object describes a catalog field.
Show Source
Nested Schema : typeSchemas
Type:
array
The array of objects wherein each object describes an item type.
Show Source
Nested Schema : items
Type:
Show Source
object
-
label(required):
string
Title:
Field Label
The label of the catalog field. -
name(required):
string
Title:
Field Name
The name of the catalog field. -
preview:
boolean
Title:
Field Preview
Contains one of the following values: true or false. If true, then the field is cached in online mode and included in the search results. If false, then the field is cached in offline mode and the field is excluded in the search results. -
propertyLabel:
string
Title:
Field Property Label
The label assigned to a custom property field. -
searchable:
boolean
Title:
Field Searchable
Contains one of the following values: true or false. If true, then the field is searchable. If false, then the field cannot be searched.
Nested Schema : items
Type:
Show Source
object
-
inventoryType:
string
Title:
Field Inventory Type
The inventory type that is assigned to the field. -
itemType(required):
string
Title:
Field Item Type
The item type that is assigned to the field.
Response
Supported Media Types
- application/json
- application/schema+json
204 Response
This response code indicates that the operation completed successfully. This operation does not return elements in the response body.
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 create a catalog 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 \ -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{ "name": "my_catalog", "fieldSchemas": [ { "label": "part_id", "name": "Part number", "propertyLabel": "part_number", "searchable": true, "preview": true }, { "label": "vendor", "name": "Vendor", "searchable": true, "preview": true }, { "label": "descr", "name": "Description", "searchable": true }, { "label": "price", "name": "Cost", "propertyLabel": "price", "preview": true } ], "typeSchemas": [ { "itemType": "parts", "inventoryType": "parts_general" }, { "itemType": "cartridge", "inventoryType": "parts_cartridge" } ] }'
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