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

/site/create

Creates a new site.

The user must be authenticated and have write permissions to the site group where the site will be added.

For the purposes of linguistic processing, content belonging to a site is assumed to be mono-lingual.

Request

The request object has the following fields:

Name

Type

Required

Description

siteGroupId

String

Yes

The identifier of the site group of which the site will be added.

name

String

Yes

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

associated with the site.

timeZone

String

Yes

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").

automaticCrawling

Boolean

No

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

/profile/content/push

or documents are updated using

/document/update

.

language

String

Yes

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. This must be set for documents to be fed to the site search index used for

/document/update

,

/document/search

and

Cxense Content

.

crawlingCookies

Array of String

No

See

/site

.

crawlingRules

Array of Crawling Rules

No

See

/site

.

Response

The response object has the following fields:

Name

Type

Description

id

String

Identifier for the newly created 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/create '{"siteGroupId":"9222300742653756873","name":"Example site","url":"https://www.example.com","country":"US","timeZone":"America/Los_Angeles"}'
{
 "id": "9222300742735526873"
 "name": "Example site",
 "url": "https://www.example.com",
 "country": "US",
 "timeZone": "America/Los_Angeles",
}

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: