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

/profile/content/external/update

Lets the user upload customer-specified content profiles for pages or annotations that should be added to a page's content profile during processing. This makes it possible for the user to manually extend or override the results created by Cxense Insight.

The page whose content profile to replace or augment is referenced to via its URL. It's also possible to specify a group of URLs by using a regular expression. Some restrictions on the expressiveness of such regular expressions may apply. As per, April 2015, we only support the pattern constructs '.', '.*' and '.+'. All other matching constructs are not supported.

Exactly how a resulting content profile is computed from the provided content profile fragment is determined by the mode specified by the caller. Currently three different modes are supported:

  • Replacement: The resulting content profile equals the provided content profile fragment. I.e., the provided content profile fragment is the full content profile, and effectively fully replaces what we would otherwise have automatically computed from the page.

  • Enrichment: The resulting content profile equals the profile that we automatically compute from the page, but with the provided content profile fragment added to it. I.e., the provided content profile fragment is used to enrich what we compute.

  • Modification: A hybrid of the replacement and enrichment modes. Acts as an enrichment, except for those keys that are present in the provided content profile fragment. The values for the keys that are present in the provided content profile fragment replace (as opposed to being added to) the set of values we compute automatically for those keys. E.g., consider the case where the automatically computed content profile contains (person, john smith) and the provided content profile fragment contains (person, alan jones). With the enrichment mode the resulting content profile would contain both elements, whereas with the modification mode the resulting content profile would only contain the latter.

Use exact matching whenever possible. The following limitations currently apply, these might be modified in the future:

Description

Limit

Maximum length of a content profile entry

100

Maximum allowed pattern count per site

1000

There is no hard limit for exact matching, but it does not mean it is unlimited. Please use it sensibly.

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

Configuration uploaded via this API has to propagate through our systems to become live. This might take 10 minutes or longer. The profile changes will only be included for urls crawled after the configuration has become live.


Request

The request object has the following fields:

Name

Type

Required

Description

siteId

String

Yes

The site identifier for which the configuration rules apply.

configuration

Object

Yes

The configuration object for controlling one or more content profiles.

A configuration object has the following fields:

Name

Type

Required

Description

<identifier>

String

Yes

The resource identifier for which the provided content profile fragment applies. If match is set to "exact", this must be an URL. If match is set to "pattern", this must be a valid regular expression. The resource identifier must be unique within the site.

mode

String

Yes

Specifies how the provided content profile fragment should be applied to yield the final content profile. Currently allowed values are enrich, replace and modify.

match

String

Yes

Specifies how the resource identifier should be interpreted and applied to a page's URL. Matching happens based on normalized URLs. Currently allowed values are exact and pattern.

profile

Array of Object

Yes

The provided content profile fragment. See, e.g.,

/profile/content/fetch

for documentation of the profile object's structure.

For regular expressions, some restrictions on their expressiveness may apply. Also note that for regular expressions the backslash character has to be suitably escaped when being passed as JSON. E.g., a regular expression matching anything that starts with http://video.example.org/ would thus become http://video\\.example\\.org/.*.

Response

The response object has the following fields:

Name

Type

Description

count

Integer

The number of configuration entries that were added.

Examples

Bash
$ cat mydata.json
{
 "siteId": "9222300742735526873"
 "configuration": {
 ".*example.co.*?/": {
 "match": "pattern",
 "mode": "enrich",
 "profile": [
 {
 "groups": [
 {
 "group": "abc-description",
 "weight": 0.75
 }
 ],
 "item": "example commercial"
 },
 {
 "groups": [
 {
 "group": "abc-usertype",
 "weight": 0.5
 }
 ],
 "item": "business user"
 }
 ]
 },
 "https://example.net/": {
 "match": "exact",
 "mode": "replace",
 "profile": [
 {
 "groups": [
 {
 "group": "abc-description",
 "weight": 0.5
 }
 ],
 "item": "example network equipment site"
 }
 ]
 },
 "https://example.org/": {
 "match": "exact",
 "mode": "replace",
 "profile": [
 {
 "groups": [
 {
 "group": "abc-description",
 "weight": 0.7
 }
 ],
 "item": "example organization site"
 }
 ]
 }
 }
}

$ cat mydata.json | cx.py /profile/content/external/update '-'

Last updated: