Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Use /entity routing instead of /user

...

Excerpt

Search for content available to a specific userentity. The result may also include public content.

 



Endpoint ID:

9004

Method:

Image Modified

URL:

POST: /user/dp-key/{dp-key}/content/search
POST: /user

/content/tagged/entity/id/{entity-id}/search
/content/tagged/entity/ext-key/{ext-key}/{ext-type}/

content/dp

search

 

entity-
keydialogportal™ master key
idRubiq entity ID that uniquely identifies
the account to find content for. 
an entity

ext-keyExternal key that uniquely identifies
the account to find content for. 
an entity

ext-typeType of external key

Request body:

A JSON object describing the search parameters.

Required fields:
 

tagsAn array of tags
Optional fields:
 

limitThe maximum number of content items to return. If omitted,
"
limit
"
is set to 1.
 

offset
The offset in search results from where to return data
A search offset, used together with limit to implement a paging system. If omitted,
"
offset
"
is set to 0.
 

fromDateUTC date used to filter search results by the content
"
activeFrom
"
date if it exists, or otherwise the
"
created
"
date.
 compareUsed

toDateUTC date used to filter
the
search results by the content activeTo date. Content with no activeTo date will always be included.

preferPrivateWhen true, private content will be returned before public content
"value". Possible "compare"
. 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"

keyThe data key that is to be matched
compareThe comparison operator. Possible compare options are:
= != < > <= >= 
between
empty notempty
 compareValue1Decimal
compareValue

String or decimal comparison value. Required

if "compare" is one of

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.

keyThe data key that is to be matched
compareThe comparison operator. Possible compare options are:
= != < > <= >= 
between
asc desc
 compareValue2Decimal
compareValue

String or decimal comparison value. Required

if "compare" has value "between". preferPrivateWhen true, private content will be returned before public content. If omitted, "preferPrivate" is set to "false".

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:

ignorePrevious views are not taken into consideration. This is the default.
sortByTimesViewedContent that has been viewed least often is shown first.
showOnceOnlyContent which has previously been displayed for this entity will be excluded from the search.



Code Block
titleExample
{
   "tags": [ "tag1", "tag2" ],
   "preferPrivate": false,
   "fromDate": "2014-01-01T01:00Z",
   "limit": 2,
   "offset": 10,
   "data": [
      {
         "key": "a",
         "compare": "
between
>=",
         "
compareValue1
compareValue": 5.1
      },
      {
         "key": "a",
         "compare": "<=",
         "
compareValue2
compareValue": 5.9
      },
      {
         "key": "x",
         "compare": "isempty"
      }
   ],
   "priorities": [
      {
         "key": "b",
         "compare": ">",
         "compareValue": 10
      },
      {
         "key": "a",
         "compare": "desc"
      }
   ],
   "impressions": "sortByTimesViewed"
}


Response body:

JSON data with an array of content. The result

will

also

contain a "

contains a paging

"

object detailing the number of content items returned,

the offset

the offset and whether there are more items than the ones returned.

Code Block
titleExample
{
   "content": [
      {                                        /* public content - no 
dpKey
entityID   */
         "tags": [ "tag1", "tag2" ],
         "content": "PGh0bWw+PGJvZHk+TW9yZSBIVE1MIGNvbnRlbnQ8L2JvZHk+PC9odG1sPg==",
         "contentType": "text/html",
         "data": {
            "
content
width": "
PGh0bWw+PGJvZHk+TW9yZSBIVE1MIGNvbnRlbnQ8L2JvZHk+PC9odG1sPg==
300px",
            "
created
height": "
2014-02-10T12:53:42Z
50px",
            "
value
a": 5.5,
            "b": 15
         },
         "created": "2014-02-10T12:53:42Z",
         "activeFrom": "2014-03-01T12:00:00Z",
         "activeTo": "2014-03-08T12:00:00Z"
      },
      {                                        /* private content - has 
dpKey
entityID */
         "
dpKey
entityID": 12345,
         "tags": [ "tag1", "tag2", "tag3" ],
         "
contentType
content": "
text/html
PGh0bWw+PGJvZHk+SFRNTCBjb250ZW50PC9ib2R5PjwvaHRtbD4=",
         "
content
contentType": "
PGh0bWw+PGJvZHk+SFRNTCBjb250ZW50PC9ib2R5PjwvaHRtbD4=
text/html",
         "
created
data": {
       
"2014-02-08T09:00:34Z"
     "a": 5.9
         },
         "
value
created": 
5.9
"2014-02-08T09:00:34Z"
      }
   ],
   "paging": {
      "offset": 10,
      "count": 2,
      "more": true
   }
}


Status codes:

200

OK

 

404.1
User
Entity not found
 

404.2External
user could
entity not
be
found
 

404.4
No

Content not found