I have placed code snippets for Tracker and API Request Enrich Json. Can you please suggest why it is not hitting the REST API with input data?
Below is the code tracker snippet to post the data into Scala Collector
Map<String, Object> eventData = new HashMap<String, Object>();
Map<String,String> test = new HashMap<String, String>();
test.put("email","sandeep@gmail.com");
eventData.put("data", test);
eventData.put("schema", "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0");
SelfDescribingJson json = new SelfDescribingJson("iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0", eventData);
List<SelfDescribingJson> contexts = new ArrayList<SelfDescribingJson>();
contexts.add(json);
System.out.println("json: "+json);
tracker.track(Structured.builder()
.category("Repo")
.action("pageBrowse")
.subject(sub)
.customContext(contexts)
.build());
Below is the API Request Enrich Json:
{
"schema": "iglu:com.snowplowanalytics.snowplow.enrichments/api_request_enrichment_config/jsonschema/1-0-0",
"data": {
"name": "api_request_enrichment_config",
"vendor": "com.snowplowanalytics.snowplow.enrichments",
"enabled": true,
"parameters": {
"inputs": [
{
"key": "email",
"json": {
"field": "unstruct_event",
"schemaCriterion": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
"jsonPath": "$.email"
}
}
],
"api": {
"http": {
"method": "GET",
"uri": "http://localhost:8080/enrichapi?email={{\"{{email}}\"}}",
"timeout": 5000,
"authentication": {
"httpBasic": {
"username": "xxx",
"password": "yyy"
}
}
}
},
"outputs": [ {
"schema": "iglu:com.acme/user/jsonschema/1-0-0",
"json": {
"jsonPath": "$.record"
}
} ],
"cache": {
"size": 3000,
"ttl": 60
}
}
}
}