Site Category
The site category record exposes a site category to REST web services.
This record:
-
is not a subrecord
-
contains the following subrecords:
-
categoryListLayout
-
correlatedItemListLayout
-
itemListLayout
-
parentCategory
-
relatedItemListLayout
-
siteMapPriority
-
storeDisplayImage
-
storeDisplayThumbnail
-
website
-
-
contains the following sublists:
-
presentationItem
-
translations
-
audience
-
tag_subs_machine
-
For more information about working with site categories in the UI, see Creating Site Categories.
For information about using the REST API Browser, see The REST API Browser.
Record ID
The record ID for a site category REST record is sitecategory.
Prerequisites
You must enable the following features before you can use this record through REST web services:
-
Site Builder (Web Store)
-
Site Builder (Website)
For more information, see Marketing Automation Overview and Enabling Web Store Features.
To use all the fields on this record, you must enable: Advanced Site Customization, Multiple Web Sites, Upsell Manager, URL Component Aliases, Multi-Language, Create bundles with SuiteBundler, File Cabinet, SuiteCloud Development Framework, Document Publishing, and Multi-Location Inventory.
Additional Details
Consider the following when working with the site category record:
-
The following sublists aren't supported in REST:
-
audience
-
tag_subs_machine
-
-
The translations sublist can only be read and updated. It can't be updated with a POST request.
-
The siteCategoryType subrecord is read-only and set to the value: PRES.
-
For the string fields: description and storeDetailedDescription, the string value must be enclosed in HTML paragraph tags (<p>). For example:
-
description: <p>description</p>
-
storeDetailedDescription: <p>store detailed description</p>
-
-
For the presentationItem sublist, the itemtype and presentationitem fields have the following fixed values:
-
itemtype is set to INVTITEM
-
presentationitem is set to the Item ID+\u0003+item type
The following is an example of a complete presentationItem sublist for a POST request:
'presentationItem': { 'items': [ { 'item': { 'id': '99' }, 'itemType': { 'id': 'INVTITEM' }, 'presentationItem': '99\u0003INVTITEM' } ] } 'presentationItem': { 'items': [ { 'item': { 'id': '99' }, 'itemType': { 'id': 'INVTITEM' }, 'presentationItem': '99\u0003INVTITEM' } ] } -
-
For the translations sublist, the locale field is accessed as a string for a PATCH request.
The following is an example of a complete translations sublist for a PATCH request:
'translations': { 'items': [ { 'locale': 'es_ES', 'description': 'updated description', 'displayName': 'updated displayName', 'language': 'Spanish', 'pageTitle': 'updated pageTitle' } ] } -
For a translations sublist, the locale field is accessed as a subrecord for a GET request.
The following is an example of a GET response:
'translations': { 'items': [ { 'locale': { 'id': 'es_ES' }, 'description': 'updated description', 'displayName': 'updated displayName', 'language': 'Spanish', 'pageTitle': 'updated pageTitle' } ] }
Code Samples
The following samples show common actions for a site category.
POST Request
POST /services/rest/record/v1/siteCategory HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Content-Type: application/json
Authorization: OAuth realm="",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="',oauth_version="1.0",oauth_signature=""
Content-Length: 983
{
"categoryListLayout": {"id": "90"},
"correlatedItemsListLayout": {"id": "71"},
"excludeFromSiteMap": false,
"isInactive": false,
"isOnline": true,
"itemListLayout": {"id": "91"},
"metaTagHtml": "testTag",
"itemId": "Test name REST",
"pageTitle": "Test title",
"parentCategory": {"id": "10"},
"presentationItem": {
"items": [
{
"item": {"id": "99"},
"itemtype": {"id": "INVTITEM"},
"presentationItem":"99\u0003INVTITEM"
}
]
},
"relatedItemsListLayout": {"id": "81"},
"searchKeywords": "Test search",
"description": "<p>sectionDescription</p>",
"storeDetailedDescription": "<p>sectionDetailedDescription</p>",
"website": {"id": "1"},
"siteMapPriority": {"id": "0.2"},
"storeDisplayImage": {"id": "28"},
"storeDisplayThumbnail": {"id": "32"},
"urlComponent": "01234567890",
"externalId": "exteranlId999999"
}
PATCH Request for Updating Translations
PATCH /services/rest/record/v1/siteCategory/22946?replace=translations HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Content-Type: application/json
suiteScriptLog: true
Authorization: OAuth realm="",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="",oauth_version="",oauth_signature=""
Content-Length: 918
{
"translations": {
"items": [{
"locale": "cs_CZ",
"description": "updated",
"displayName": "updated",
"language": "Czech",
"pageTitle": "updated"
},{
"description": "updated",
"displayName": "updated",
"language": "Spanish",
"locale": "es_ES",
"pageTitle": "updated"
},{
"description": "updated",
"displayName": "updated",
"language": "French (France)",
"locale": "fr_FR",
"pageTitle": "updated"
},{
"description": "updated",
"displayName": "updated",
"language": "Japanese",
"locale": "ja_JP",
"pageTitle": "updated"
}
]
}
}