import requests
url = "https://{FUSION HOST}/api/signals/{collection}"
payload = [
{
"params": {
"query": "Televisiones Panasonic 50 pulgadas",
"filterQueries": ["cat00000", "abcat0100000", "abcat0101000", "abcat0101001"],
"docId": "2125233"
},
"type": "click",
"timestamp": "2011-09-01T23:44:52.53Z"
},
{
"params": {
"query": "Sharp",
"filterQueries": ["cat00000", "abcat0100000", "abcat0101000", "abcat0101001"],
"docId": "2009324"
},
"type": "click",
"timestamp": "2011-09-05T12:25:37.42Z"
}
]
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION HOST}/api/signals/{collection}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("[\n {\n \"params\": {\n \"query\": \"Televisiones Panasonic 50 pulgadas\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2125233\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-01T23:44:52.53Z\"\n },\n {\n \"params\": {\n \"query\": \"Sharp\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2009324\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-05T12:25:37.42Z\"\n }\n]")
.asString();const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
params: {
query: 'Televisiones Panasonic 50 pulgadas',
filterQueries: ['cat00000', 'abcat0100000', 'abcat0101000', 'abcat0101001'],
docId: '2125233'
},
type: 'click',
timestamp: '2011-09-01T23:44:52.53Z'
},
{
params: {
query: 'Sharp',
filterQueries: ['cat00000', 'abcat0100000', 'abcat0101000', 'abcat0101001'],
docId: '2009324'
},
type: 'click',
timestamp: '2011-09-05T12:25:37.42Z'
}
])
};
fetch('https://{FUSION HOST}/api/signals/{collection}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/signals/{collection}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"params\": {\n \"query\": \"Televisiones Panasonic 50 pulgadas\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2125233\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-01T23:44:52.53Z\"\n },\n {\n \"params\": {\n \"query\": \"Sharp\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2009324\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-05T12:25:37.42Z\"\n }\n]"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/signals/{collection}"
payload := strings.NewReader("[\n {\n \"params\": {\n \"query\": \"Televisiones Panasonic 50 pulgadas\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2125233\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-01T23:44:52.53Z\"\n },\n {\n \"params\": {\n \"query\": \"Sharp\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2009324\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-05T12:25:37.42Z\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/signals/{collection}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'params' => [
'query' => 'Televisiones Panasonic 50 pulgadas',
'filterQueries' => [
'cat00000',
'abcat0100000',
'abcat0101000',
'abcat0101001'
],
'docId' => '2125233'
],
'type' => 'click',
'timestamp' => '2011-09-01T23:44:52.53Z'
],
[
'params' => [
'query' => 'Sharp',
'filterQueries' => [
'cat00000',
'abcat0100000',
'abcat0101000',
'abcat0101001'
],
'docId' => '2009324'
],
'type' => 'click',
'timestamp' => '2011-09-05T12:25:37.42Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://{FUSION HOST}/api/signals/{collection} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
[
{
"params": {
"query": "Televisiones Panasonic 50 pulgadas",
"filterQueries": [
"cat00000",
"abcat0100000",
"abcat0101000",
"abcat0101001"
],
"docId": "2125233"
},
"type": "click",
"timestamp": "2011-09-01T23:44:52.53Z"
},
{
"params": {
"query": "Sharp",
"filterQueries": [
"cat00000",
"abcat0100000",
"abcat0101000",
"abcat0101001"
],
"docId": "2009324"
},
"type": "click",
"timestamp": "2011-09-05T12:25:37.42Z"
}
]
'{
"responseHeader": {
"status": 0,
"QTime": 1,
"params": {
"indent": "true",
"q": "docId: 2125233",
"wt": "json"
}
},
"response": {
"numFound": 1198,
"start": 0,
"docs": [
{
"id": "7aee7b1f-5cde-4957-b73c-c15881f559ec",
"filters_s": "abcat0100000 $ abcat0101000 $ abcat0101001 $ cat00000",
"query_orig_s": "Televisiones Panasonic 50 pulgadas",
"params.user_s": "000000df17cd56a5df4a94074e133c9d4739fae3",
"docId": "2125233",
"params.query_time__s": "2011-09-01T23:43:59.75Z",
"query_t": "televisiones panasonic 50 pulgadas",
"query_s": "televisiones panasonic 50 pulgadas",
"filters_orig_ss": [
"abcat0100000",
"abcat0101000",
"abcat0101001",
"cat00000"
],
"flag_s": "EVENT",
"type_s": "click",
"attr_params.filterQueries_": [
"cat00000",
"abcat0100000",
"abcat0101000",
"abcat0101001"
],
"timestamp_dt": "2011-09-01T23:44:52.53Z",
"_version_": 1478892846857584600
},
{
"id": "6789a209-f5b5-457e-9df6-8033b8f7f317",
"filters_s": "abcat0100000 $ abcat0101000 $ abcat0101001 $ cat00000",
"query_orig_s": "Sharp",
"params.user_s": "000001928162247ffaf63185cd8b2a244c78e7c6",
"docId": "2009324",
"params.query_time__s": "2011-09-05T12:25:01.18Z",
"query_t": "sharp",
"query_s": "sharp",
"filters_orig_ss": [
"abcat0100000",
"abcat0101000",
"abcat0101001",
"cat00000"
],
"flag_s": "EVENT",
"type_s": "click",
"attr_params.filterQueries_": [
"cat00000",
"abcat0100000",
"abcat0101000",
"abcat0101001"
],
"timestamp_dt": "2011-09-05T12:25:37.42Z",
"_version_": 1478892846859681800
}
]
}
}Index an event signal
Index an event signal into the specified collection. The JSON request body describes the signal’s attributes.
import requests
url = "https://{FUSION HOST}/api/signals/{collection}"
payload = [
{
"params": {
"query": "Televisiones Panasonic 50 pulgadas",
"filterQueries": ["cat00000", "abcat0100000", "abcat0101000", "abcat0101001"],
"docId": "2125233"
},
"type": "click",
"timestamp": "2011-09-01T23:44:52.53Z"
},
{
"params": {
"query": "Sharp",
"filterQueries": ["cat00000", "abcat0100000", "abcat0101000", "abcat0101001"],
"docId": "2009324"
},
"type": "click",
"timestamp": "2011-09-05T12:25:37.42Z"
}
]
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION HOST}/api/signals/{collection}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("[\n {\n \"params\": {\n \"query\": \"Televisiones Panasonic 50 pulgadas\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2125233\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-01T23:44:52.53Z\"\n },\n {\n \"params\": {\n \"query\": \"Sharp\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2009324\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-05T12:25:37.42Z\"\n }\n]")
.asString();const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
params: {
query: 'Televisiones Panasonic 50 pulgadas',
filterQueries: ['cat00000', 'abcat0100000', 'abcat0101000', 'abcat0101001'],
docId: '2125233'
},
type: 'click',
timestamp: '2011-09-01T23:44:52.53Z'
},
{
params: {
query: 'Sharp',
filterQueries: ['cat00000', 'abcat0100000', 'abcat0101000', 'abcat0101001'],
docId: '2009324'
},
type: 'click',
timestamp: '2011-09-05T12:25:37.42Z'
}
])
};
fetch('https://{FUSION HOST}/api/signals/{collection}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/signals/{collection}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"params\": {\n \"query\": \"Televisiones Panasonic 50 pulgadas\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2125233\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-01T23:44:52.53Z\"\n },\n {\n \"params\": {\n \"query\": \"Sharp\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2009324\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-05T12:25:37.42Z\"\n }\n]"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/signals/{collection}"
payload := strings.NewReader("[\n {\n \"params\": {\n \"query\": \"Televisiones Panasonic 50 pulgadas\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2125233\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-01T23:44:52.53Z\"\n },\n {\n \"params\": {\n \"query\": \"Sharp\",\n \"filterQueries\": [\n \"cat00000\",\n \"abcat0100000\",\n \"abcat0101000\",\n \"abcat0101001\"\n ],\n \"docId\": \"2009324\"\n },\n \"type\": \"click\",\n \"timestamp\": \"2011-09-05T12:25:37.42Z\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/signals/{collection}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'params' => [
'query' => 'Televisiones Panasonic 50 pulgadas',
'filterQueries' => [
'cat00000',
'abcat0100000',
'abcat0101000',
'abcat0101001'
],
'docId' => '2125233'
],
'type' => 'click',
'timestamp' => '2011-09-01T23:44:52.53Z'
],
[
'params' => [
'query' => 'Sharp',
'filterQueries' => [
'cat00000',
'abcat0100000',
'abcat0101000',
'abcat0101001'
],
'docId' => '2009324'
],
'type' => 'click',
'timestamp' => '2011-09-05T12:25:37.42Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://{FUSION HOST}/api/signals/{collection} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
[
{
"params": {
"query": "Televisiones Panasonic 50 pulgadas",
"filterQueries": [
"cat00000",
"abcat0100000",
"abcat0101000",
"abcat0101001"
],
"docId": "2125233"
},
"type": "click",
"timestamp": "2011-09-01T23:44:52.53Z"
},
{
"params": {
"query": "Sharp",
"filterQueries": [
"cat00000",
"abcat0100000",
"abcat0101000",
"abcat0101001"
],
"docId": "2009324"
},
"type": "click",
"timestamp": "2011-09-05T12:25:37.42Z"
}
]
'{
"responseHeader": {
"status": 0,
"QTime": 1,
"params": {
"indent": "true",
"q": "docId: 2125233",
"wt": "json"
}
},
"response": {
"numFound": 1198,
"start": 0,
"docs": [
{
"id": "7aee7b1f-5cde-4957-b73c-c15881f559ec",
"filters_s": "abcat0100000 $ abcat0101000 $ abcat0101001 $ cat00000",
"query_orig_s": "Televisiones Panasonic 50 pulgadas",
"params.user_s": "000000df17cd56a5df4a94074e133c9d4739fae3",
"docId": "2125233",
"params.query_time__s": "2011-09-01T23:43:59.75Z",
"query_t": "televisiones panasonic 50 pulgadas",
"query_s": "televisiones panasonic 50 pulgadas",
"filters_orig_ss": [
"abcat0100000",
"abcat0101000",
"abcat0101001",
"cat00000"
],
"flag_s": "EVENT",
"type_s": "click",
"attr_params.filterQueries_": [
"cat00000",
"abcat0100000",
"abcat0101000",
"abcat0101001"
],
"timestamp_dt": "2011-09-01T23:44:52.53Z",
"_version_": 1478892846857584600
},
{
"id": "6789a209-f5b5-457e-9df6-8033b8f7f317",
"filters_s": "abcat0100000 $ abcat0101000 $ abcat0101001 $ cat00000",
"query_orig_s": "Sharp",
"params.user_s": "000001928162247ffaf63185cd8b2a244c78e7c6",
"docId": "2009324",
"params.query_time__s": "2011-09-05T12:25:01.18Z",
"query_t": "sharp",
"query_s": "sharp",
"filters_orig_ss": [
"abcat0100000",
"abcat0101000",
"abcat0101001",
"cat00000"
],
"flag_s": "EVENT",
"type_s": "click",
"attr_params.filterQueries_": [
"cat00000",
"abcat0100000",
"abcat0101000",
"abcat0101001"
],
"timestamp_dt": "2011-09-05T12:25:37.42Z",
"_version_": 1478892846859681800
}
]
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The data collection to which this signal belongs.
Query Parameters
An index pipeline to use for processing signals. Note that the index pipeline must end with a Solr Indexer stage, and in this stage the enforce_schema property must be set to 'true'.
Whether to commit signals to the collection immediately after indexing each one. The setting is not recommended in production and performance testing because it negatively impacts performance. Instead, consider letting the defaults of the Solr collection dictate the commit frequency.
Whether to execute the request asynchronously. If true, an autoCommit is issued and failures are not reported.
Response
OK
The response is of type object.
Was this page helpful?