Items
Search items from a Squirro project.Items are added to projects through subscriptions.
Methods
Query items
GET/POSTÂ https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/items/query
Returns a selection of items from the project. The items be filtered with a query and other parameters.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. Valid object keys:
{ "query": "Hitachi", "start": 0, "highlight": { "query": true } }Â |
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | Results including some pagination information. Response fields:
{    "count": 1,    "now": "2014-12-17T14:27:47",    "next_params": {        "start": 1,        "expected_num_results": 92    },    "eof": false,    "items": [        {            "body": "<html><body> <p class=\"tweet\">ABB and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system…",            "language": "en",            "title": "Supreme & Co.",            "read": false,            "created_at": "2014-12-17T13:10:45",            "modified_at": "2014-12-17T13:11:16",            "related_items": [],            "id": "Fd2yF5BvQX2LlCdYPZ-Zow",            "sources": [                {                    "link": "https://twitter.com/search?q=abb -is:retweet&f=realtime",                    "title": "Twitter search for: \"abb\"",                    "object_ids": [                        "w--MRsdxR26LlymevPTpMA"                    ],                    "id": "nN3pr5BwQJevxbSzMB9Www",                    "provider": "twitter"                }            ],            "score": null,            "link": "https://www.facebook.com/pages/Supreme-Co/356890661079035?ref=hl",            "objects": [                {                    "source_ids": [                        "nN3pr5BwQJevxbSzMB9Www"                    ],                    "project_id": "D9omq-WVQ0O2hxYp9fKUlA",                    "type": "default",                    "id": "w--MRsdxR26LlymevPTpMA",                    "title": "default"                }            ],            "keywords": {                "from": [                    "supremeco"                ],                "Sentiment": [                    "Neutral"                ],                "Geo_State": [                    "Japan"                ],                "verb": [                    "post"                ],                "Organization": [                    "ABB Group",                    "Hitachi"                ]            },            "starred": false,            "external_id": "545204453427531777",            "abstract": [                "ABB and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system solutions in Japan.\ntinyurl.com/nzhqzrfABB",                " and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system solutions in Japan.\nBusiness Standard reported that ABB",                " and <squirro:highlight>Hitachi</squirro:highlight> entered into a JV for providing high voltage direct current system solutions in Japan",                "-sales services related to the DC system of HVDC projects. <squirro:highlight>Hitachi</squirro:highlight> and ABB will take equity..."            ]        }    ],    "aggregations": {},    "total": 92,    "fingerprint_matches": {} } |
Encrypted Query
GET/POSTÂ https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/items/query_encryption
Returns the encrypted and signed version of the query and other query parameters. This encrypted query can then be used with the `Query Items` endpoint using `encrypted_query` parameter to get items matching the encrypted query.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. Valid object keys:
Example request body: { "query": "Hitachi" }Â |
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | Response fields:
{ 'encrypted_query': 'YR4h147YAldsARmTmIrOcJqpuntiJULXPV3ZrXblVWvbCavvESTw4Jis6sTgGC9a1LhrLd9Nq-77CNX2eeieMEDnPFPRqlPGO8V' } |
List Items (deprecated)
GET https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/items
Returns a selection of items from the project. The items be filtered with a query and other parameters.
Parameters: |
|
---|---|
Query Parameters: |
|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | Results including some pagination information. Response fields:
{    "count": 1,    "now": "2014-12-17T14:27:47",    "next_params": {        "start": 1,        "expected_num_results": 92    },    "eof": false,    "items": [        {            "body": "<html><body> <p class=\"tweet\">ABB and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system…",            "language": "en",            "title": "Supreme & Co.",            "read": false,            "created_at": "2014-12-17T13:10:45",            "modified_at": "2014-12-17T13:11:16",            "related_items": [],            "id": "Fd2yF5BvQX2LlCdYPZ-Zow",            "sources": [                {                    "link": "https://twitter.com/search?q=abb -is:retweet&f=realtime",                    "title": "Twitter search for: \"abb\"",                    "object_ids": [                        "w--MRsdxR26LlymevPTpMA"                    ],                    "id": "nN3pr5BwQJevxbSzMB9Www",                    "provider": "twitter"                }            ],            "score": null,            "link": "https://www.facebook.com/pages/Supreme-Co/356890661079035?ref=hl",            "objects": [                {                    "source_ids": [                        "nN3pr5BwQJevxbSzMB9Www"                    ],                    "project_id": "D9omq-WVQ0O2hxYp9fKUlA",                    "type": "default",                    "id": "w--MRsdxR26LlymevPTpMA",                    "title": "default"                }            ],            "keywords": {                "from": [                    "supremeco"                ],                "Sentiment": [                    "Neutral"                ],                "Geo_State": [                    "Japan"                ],                "verb": [                    "post"                ],                "Organization": [                    "ABB Group",                    "Hitachi"                ]            },            "starred": false,            "external_id": "545204453427531777",            "abstract": [                "ABB and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system solutions in Japan.\ntinyurl.com/nzhqzrfABB",                " and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system solutions in Japan.\nBusiness Standard reported that ABB",                " and <squirro:highlight>Hitachi</squirro:highlight> entered into a JV for providing high voltage direct current system solutions in Japan",                "-sales services related to the DC system of HVDC projects. <squirro:highlight>Hitachi</squirro:highlight> and ABB will take equity..."            ]        }    ],    "facets": {},    "field_histograms": {},    "total": 92,    "fingerprint_matches": {} } |
Get Item
GET https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/items/(id: item_id)
Returns a single item from the project.
Parameters: |
|
---|---|
Query Parameters: |
|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | The item in the item response field. {    "item": {        "body": "<html><body><p class=\"tweet\">ABB and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system…",        "language": "en",        "title": "Supreme & Co.",        "read": false,        "created_at": "2014-12-17T13:10:45",        "modified_at": "2014-12-17T13:11:16",        "related_items": [],        "id": "Fd2yF5BvQX2LlCdYPZ-Zow",        "sources": [            {                "link": "https://twitter.com/search?q=abb -is:retweet&f=realtime",                "title": "Twitter search for: \"abb\"",                "object_ids": ["w--MRsdxR26LlymevPTpMA"],                "id": "nN3pr5BwQJevxbSzMB9Www",                "provider": "twitter"            }        ],        "score": null,        "link": "https://www.facebook.com/pages/Supreme-Co/356890661079035?ref=hl",        "objects": [            {                "source_ids": ["nN3pr5BwQJevxbSzMB9Www"],                "project_id": "D9omq-WVQ0O2hxYp9fKUlA",                "type": "default",                "id": "w--MRsdxR26LlymevPTpMA",                "title": "default"            }        ],        "keywords": {            "from": ["supremeco"],            "Sentiment": ["Neutral"],            "Geo_State": ["Japan"],            "verb": ["post"],            "Organization": ["ABB Group", "Hitachi"]        },        "starred": false,        "external_id": "545204453427531777",        "abstract": [            "ABB and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system solutions in Japan.\ntinyurl.com/nzhqzrfABB",            " and <squirro:highlight>Hitachi</squirro:highlight> forms a JV to provide HVDC system solutions in Japan.\nBusiness Standard reported that ABB",            " and <squirro:highlight>Hitachi</squirro:highlight> entered into a JV for providing high voltage direct current system solutions in Japan",            "-sales services related to the DC system of HVDC projects. <squirro:highlight>Hitachi</squirro:highlight> and ABB will take equity..."        ]    } } |
Update Item
PUT https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/items/(id: item_id)
Updates an item in the project. This can only be used to modify the keywords and states.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. Valid object keys:
Example request body: { "state": { "read": true, "starred": false }, "keywords": { "Author": ["John Doe"] } } |
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Delete Item
DELETE https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/items/(id: item_id)
This resource can only be used on projects which have their own project index
This resource
Parameters: |
|
---|---|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Recommend similar items
GET/POSTÂ https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/items/recommend
Returns a recommendation of similar items from the project given an item id or text.
Parameters: |
| |
---|---|---|
JSON Data: | Data is passed in as a JSON object. Valid object keys:
| |
Headers: | See Common Headers. | |
Status Codes: |
See also Common Status Codes. | |
Returns: | Results. Response fields:
|
Recommendation methods
GETÂ https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/items/recommend/methods
Returns the supported recommendation methods for items from the project.
Parameters: |
| |
---|---|---|
Headers: | See Common Headers. | |
Status Codes: |
See also Common Status Codes. | |
Returns: | Method names. Response fields:
|