We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

/site/update

Update a site.

The user must be authenticated and have write permissions to the site.

Request

The request object has the following fields:

Name

Type

Required

Description

siteId

String

Yes

The identifier of the site to update.

name

String

No

Site name. Maximum 32 characters.

url

String

No

Site URL. Should specify a URL that represents the site. Maximum 250 characters. See also

/site

.

country

String

No

Site country code. Should specify the

ISO 3166-1 alpha-2

code associated with the site.

timeZone

String

No

Site time zone identifier. Should be specified using the full name from

IANA time zone database

(e.g., "America/Los_Angeles") or a GMT offset (e.g., "GMT-08:00").

sentimentDetection

Boolean

No

(Experimental) Defines if the site should use sentiment analysis to detect negative content. See

this page

for more information about the feature.

automaticCrawling

Boolean

No

When enabled urls will be automatically crawled as events are received. Defaults to enabled, can be disabled for sites where crawling is triggered using

/profile/content/push

or documents are updated using

/document/update

.

language

String

No

Language to use for content processing. If not set language will be automatically detected according to the top level domain of the processed url and/or the content.

crawlingCookies

Array of String

No

See

/site

.

crawlingRules

Array of Crawling Rules

No

See

/site

.

Fields that are not specified will not be updated. To clear a string field, set it to an empty string.

Take note: If automaticCrawling has been disabled, you will need to do a /profile/content/push of your site's top level domain (e.g. http://www.yoursitehere.com) to force site verification.

Response

The response object has the following fields:

Name

Type

Description

id

String

Identifier for the updated site.

name

String

Site name.

url

String

Site URL. Should specify an URL that represents the site.

country

String

Site country code. Should specify the

ISO 3166-1 alpha-2

associated with the site.

timeZone

String

Site time zone identifier. Should be specified using the full name from

IANA time zone database

(e.g. "America/Los_Angeles") or a GMT offset (e.g. "GMT-08:00").

sentimentDetection

Boolean

(Experimental) If false, we do not do sentiment detection for this site. If true, sentiment analysis is done. See

Sentiment Analysis

for more details.

automaticCrawling

Boolean

If false, no automatic crawling will be performed. See

/document/update

and

/profile/content/push

for how to manually update content for the site.

language

String

Language to use for content processing. If not set language will be automatically detected according to the top level domain of the processed url and/or the content.

crawlingCookies

Array of String

Cookie strings the crawler will set in the browser before loading a page. Each according to https://tools.ietf.org/html/rfc6265#section-4.1.1 with required domain attribute. The only difference from this rfc is that in order for cookie to be applied to subdomains, it must have a leading dot (e.g ".domain.com").

crawlingRules

Array of Crawling Rules

Rules for adding meta tags to a page during crawling, see below.

createdAt

String

The creation time. Only available for customer admin (?customerAdmin=true)

createdBy

String

User name of person who created user. Only available for customer admin (?customerAdmin=true)

lastChangedAt

String

The last changing time. Only available for customer admin (?customerAdmin=true)

lastUpdatedBy

String

User name of last person who modified user. Only available for customer admin (?customerAdmin=true)

The url field is also used for verification purposes when creating a site search index. The validation occurs on top private domain, e.g., foo.com, foo.co.jp, or foo.co.uk. The top private domain is extracted from the url field and documents under that are allowed to enter the index. It is not currently possible to configure specific subdomains or subpaths, e.g., foo.com/bar/, for site search purposes. Note that the url field has to be where the site is actually hosted and not a redirect link. E.g., if you have a site example.com that redirects to example.othersite.com then othersite.com is the correct value.

Crawling rules

Each Crawling Rule is an object with the following fields

Name

Type

Required

Description

target

String

Yes

A meta tag will be created with this name and content from the sources, if any of the sources have a value. At most 100 characters.

sources

Array of Sources

Yes

A list of sources. The first source that has a value will be used.

Each Source is an object with the following fields

Name

Type

Required

Description

type

String

Yes

One of meta, javascript, cookie, ignore

name

String

Yes

The name of the source meta tag, javascript variable or expression, or cookie, depending on type. At most 100 characters.

dataSeparator

String

No

The string by which the data should be split.

Examples

Bash
$ python cx.py /site/update '{"siteId":"9222300742735526873","name":"New example site"}'
{
 "id": "9222300742735526873"
 "name": "New example site",
 "url": "https://www.example.com",
 "country": "US",
 "timeZone": "America/Los_Angeles",
}

$ python cx.py /site/update '{"siteId":"9222300742735526873","crawlingRules":[{"target":"test","sources":[{"name":"jsKey","type":"javascript", "dataSeparator":"."}]]}'
{
 "id": "9222300742735526873"
 "name": "New example site",
 "url": "https://www.example.com",
 "country": "US",
 "timeZone": "America/Los_Angeles",
 "crawlingRules": [
 {
 "target": "test", 
 "sources": [
 {
 "type": "jsKey",
 "name": "javascript",
 "dataSeparator": "."
 }
 ] 
 }
 ],
}

Exclude rule examples

Strict correspondence of the article address. Exclude url equals http://example.com/article/123

JSON
{
 "sources": [
 {
 "type": "ignore",
 "name": "http://example.com/article/123"
 }
 ]
}

Non-strict correspondence of the article address. Exclude all urls contains http://example.com/article/123

JSON
{
 "sources": [
 {
 "type": "ignore",
 "name": "http://example.com/article/123*"
 }
 ]
}

Last updated: