Excerpt |
---|
Private content search |
Search for content available to a specific entity. The result may also include public content.
|
Endpoint ID: | 9004 |
Method: | Image Modified |
URL: |
POST: /user/dp-key/{dpKey}/content/searchPOST: /user/content/tagged/entity/id/{entity-id}/search /content/tagged/entity/ext-key/{ |
extKeyextType/contentdp | keydialogportal™ master key id | Rubiq entity ID that uniquely identifies |
the account to search content. | an entity |
| ext-key | External key that uniquely identifies |
the account to search content. an entity |
| ext-type | Type of external key |
Request body: |
JSON data with information about the content to be searched | compare: | Defines logical operator to be applied for search criteria. Possible valid values are ["=", "<", ">", "<=", ">=","between", "empty", "notempty"]A JSON object describing the search parameters. |
| compareValue1: | Required if "compare" has value. Possible valid values of "compare" are ["=", "<", ">", "<=", ">=", "between"] |
| compareValue2: | Required if "compare" has value "between" |
Optional fields: |
| tags: | JSON array of Tags. |
| preferPrivate | If omitted, limit is set to "false". |
| fromDate: | Date value defining content active start date. The date must be in UTC, for example "2014-01-01T01:00Z". |
| limit: | The maximum number of content to return. If omitted, limit is set to 1 |
| offset: | The offset in search results from where to return data. If omitted, offset is set to 0 |
tags | An array of tags | Optional fields: |
| limit | The maximum number of content items to return. If omitted, limit is set to 1. |
| offset | A search offset, used together with limit to implement a paging system. If omitted, offset is set to 0. |
| fromDate | UTC date used to filter search results by the content activeFrom date if it exists, or otherwise the created date. |
| toDate | UTC date used to filter search results by the content activeTo date. Content with no activeTo date will always be included. |
| preferPrivate | When true , private content will be returned before public content. If omitted, preferPrivate is set to false . |
| data | An array of data filters. All filters are applied, so the example below could be read as "data with key 'a' between 5.1 and 5.9, where there is no 'x' data" key | The data key that is to be matched | compare | The comparison operator. Possible compare options are:= != < > <= >= empty notempty | compareValue | String or decimal comparison value. Required for all comparison operators except empty and notempty. Note |
---|
String data values will only be compared with string filter values, and numeric data values will only be compared with numeric filter values. So ensure that numeric values are entered as numbers, i.e. 5.9 not "5.9" . Numeric values are not culture-specific. Use period "." as decimal separator, and do not use thousand separators. |
|
|
| priorities | An array of data filters used to sort content. Similar to data filters, except that where data filters exclude content, priorities change the order of content, prioritizing content whose data match the filter or sorting content by data value. key | The data key that is to be matched | compare | The comparison operator. Possible compare options are:= != < > <= >= asc desc | compareValue | String or decimal comparison value. Required for all comparison operators except asc and desc. Note |
---|
String data values will only be compared with string filter values, and numeric data values will only be compared with numeric filter values. So ensure that numeric values are entered as numbers, i.e. 5.9 not "5.9" . Numeric values are not culture-specific. Use period "." as decimal separator, and do not use thousand separators. |
|
|
| impressions | A string value which states how previous content views or "impressions" affect this search: ignore | Previous views are not taken into consideration. This is the default. | sortByTimesViewed | Content that has been viewed least often is shown first. | showOnceOnly | Content which has previously been displayed for this entity will be excluded from the search. |
|
Code Block |
---|
| {
"tags": [ "tag1", "tag2" ],
"preferPrivate": false,
"fromDate": "2014-01-01T01:00Z",
"limit": 2,
"offset": 10,
"data": [
|
|
//optional-defaulttofalsefromDate2014-01-01T01:00Z//optional-ISOUTCdatelimit2,//optional- default to 1"offset":10, "compareValue": 5.9
},
{
"key": "x",
|
|
//optional-defaultto 0between",isempty"
}
],
"priorities": [
{
|
|
//optional["=","<",">",<=,>=b",
"compare": ">",
"compareValue": 10
},
|
|
// between,empty"notempty"]"compareValue1":5.1, "compare": "desc"
}
],
"impressions": "sortByTimesViewed"
|
|
// required for "compare":
|
Response body: | JSON data with an array of content. The result also contains a paging object detailing the number of content items returned, the offset and whether there are more items than the ones returned. Code Block |
---|
| {
"content": [
{ / |
|
/* public content - no entityID */
|
|
["=","<",">","<=",">=","between"]compareValue25.9 "content": "PGh0bWw+PGJvZHk+TW9yZSBIVE1MIGNvbnRlbnQ8L2JvZHk+PC9odG1sPg==",
|
|
//requiredforcomparebetween
}Response body: | JSON data with information about the content searched.
Code Block |
---|
|
{"content":[ {
"width": "300px",
"height": "50px",
|
|
// public content - no entityIDtags[ "tag1", "tag2" ], "contentType": "text/html"contentbase64 encoded content stringcreated0210T1253Zvalue19.5"2014-03-08T12:00:00Z"
},
{ / |
|
/* private content - has entityID */
"entityID": 12345,
"tags": [ "tag1", "tag2", "tag3" ],
"content": "PGh0bWw+PGJvZHk+SFRNTCBjb250ZW50PC9ib2R5PjwvaHRtbD4=",
"contentType": "text/html",
" |
|
content"base64 encoded content string"{
"a": 5.9
},
"created": "2014-02-08T09:00: |
|
00Z34Z"
}
],
"paging": {
"offset": 10,
"count": 2,
"more": true
}
} |
|
Status codes: |
201Created | User | user could be