API request enrichment never reaches endpoint

Hello everyone,

I am trying to perform an API request enrichment to an event generated from a tracker, and then sent to a kafka collector. The generated event is the default page_view event (tried both JS and python trackers).

This is my custom enrichment JSON:

{
"schema": "iglu:com.snowplowanalytics.snowplow.enrichments/api_request_enrichment_config/jsonschema/1-0-0",

"data": {

	"vendor": "com.snowplowanalytics.snowplow.enrichments",
	"name": "api_request_enrichment_config",
	"enabled": true,
	"parameters": {
		"inputs": [
			{
				"key": "aid",
				"json": {
					"field": "contexts",
					"schemaCriterion": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
					"jsonPath": "$.aid"
				}
			}
		],
		"api": {
			"http": {
				"method": "GET",
				"uri": "http://10.10.10.114:9890/enrich",
				"timeout": 2000,
				"authentication": {}
			}
		},
		"outputs": [
			{
				"schema": "iglu:com.snowplowanalytics.iglu/anything-a/jsonschema/1-0-0",
				"json": {
					"jsonPath": "$.response"
				}
			}
		],
		"cache": {
			"size": 200,
			"ttl": 600
		}
	}
}

When the event is generated it is shown in the enriched good kafka topic but without any derived context from the api request. I can not even see the request to my API. Did i miss something?

Thank you in advance!

Your configuration looks okay. It looks like you’re using a private IP address to return enrichment data - is your enrichment process able to access this IP over the network?

Yes everything is running localy. After some tests i changed the inputs value of the above configuration to this:

"inputs": [
			{
				"key": "id",
				"json": {
					"field": "unstruct_event",
					"schemaCriterion": "iglu:com.snowplowanalytics.snowplow/screen_view/jsonschema/1-0-0",
					"jsonPath": "$.id"
				}
			}
		]

and i sent a screen_view event instead of a page_view. And it run perfectly! I saw the connection in the endpoint correctly and i saw the right enriched event on the enriched_good kafka topic. But i cant figure out the problem in my first configuration.

Are you wanting to send app_id in as an input? If so this is considered a POJO field rather than within a context e.g., you would want

{
    "key": "aid",
    "pojo": {
        "field": "app_id"
    }
}