{"record":{"id":"47c3a62aab033f76","repo":"pinpoint-apm/pinpoint","slug":"missing-argument-applicationid-servicename-ru","errorCode":null,"errorMessage":"Missing argument: applicationId / serviceName / ruleId","messagePattern":"Missing argument: applicationId / serviceName / ruleId","errorType":"validation","errorClass":"ResponseStatusException","httpStatus":400,"severity":"warning","filePath":"webhook/src/main/java/com/navercorp/pinpoint/web/webhook/controller/WebhookController.java","lineNumber":81,"sourceCode":"    @DeleteMapping()\n    public Response deleteWebhook(@RequestBody Webhook webhook) {\n\n        if (!StringUtils.hasText(webhook.getWebhookId())) {\n            logger.info(\"Missing argument: webhookId\");\n            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Missing argument: webhook.id\");\n        }\n        webhookService.deleteWebhook(webhook);\n        return SimpleResponse.ok();\n    }\n\n    @GetMapping()\n    public List<Webhook> getWebhook(@RequestParam(value=APPLICATION_ID, required=false) String applicationName,\n                                    @RequestParam(value=SERVICE_NAME, required=false) String serviceName,\n                                    @RequestParam(value=ALARM_RULE_ID, required=false) String ruleId) {\n\n        if (!StringUtils.hasText(applicationName) && !StringUtils.hasText(serviceName) && !StringUtils.hasText(ruleId)) {\n            logger.info(\"Missing argument: applicationId/serviceName/ruleId\");\n            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Missing argument: applicationId / serviceName / ruleId\");\n        }\n\n        if (StringUtils.hasText(ruleId)) {\n            return webhookService.selectWebhookByRuleId(ruleId);\n        }\n\n        if (StringUtils.hasText(applicationName)) {\n            return webhookService.selectWebhookByApplicationName(applicationName);\n        }\n\n        return webhookService.selectWebhookByServiceName(serviceName);\n    }\n\n    @PutMapping()\n    public Response updateWebhook(@RequestBody Webhook webhook) {\n\n        if (!StringUtils.hasText(webhook.getWebhookId()) || !StringUtils.hasText(webhook.getUrl()) ||\n                !(StringUtils.hasText(webhook.getApplicationName()) || StringUtils.hasText(webhook.getServiceName()))) {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/webhook/src/main/java/com/navercorp/pinpoint/web/webhook/controller/WebhookController.java#L63-L99","documentation":"WebhookController.getWebhook requires at least one of three query parameters — applicationId (bound to applicationName), serviceName, or ruleId — to scope the lookup. When all three are absent or empty, the controller rejects the request with HTTP 400 to avoid returning the entire webhook table.","triggerScenarios":"GET /webhook with no query string; GET /webhook?applicationId= (empty value); passing only unknown parameter names so every @RequestParam resolves to null.","commonSituations":"Client code forgetting that applicationId maps to the parameter APPLICATION_ID value; users browsing the API in a browser without adding filters; frontends that omit empty-string filters instead of the whole parameter set, plus a logic bug where all filters end up blank.","solutions":["Add at least one filter parameter: ?ruleId=<alarmRuleId>, ?applicationId=<appId>, or ?serviceName=<name>","Use ruleId when you want webhooks attached to a specific alarm rule","Use applicationId+serviceName together when listing all webhooks for an application","Check your HTTP client is not stripping empty-looking but meaningful query parameters"],"exampleFix":"// before\nGET /webhook\n// after\nGET /webhook?applicationId=myApp&serviceName=myService","handlingStrategy":"validation","validationCode":"boolean hasFilter = hasText(applicationId) || hasText(serviceName) || hasText(ruleId); if (!hasFilter) throw new IllegalArgumentException(\"Provide at least one of applicationId, serviceName, ruleId\");","typeGuard":"function canQueryWebhooks(p) { return Boolean(p.applicationId?.trim() || p.serviceName?.trim() || p.ruleId?.trim()); }","tryCatchPattern":"try { return api.getWebhooks(params); } catch (HttpClientErrorException.BadRequest e) { if (e.getResponseBodyAsString().contains(\"Missing argument: applicationId\")) { /* add a required filter param */ } throw e; }","preventionTips":["Always pass ruleId when filtering by alarm rule; otherwise pass applicationId+serviceName together","Never rely on default/empty query parameters — build the query string conditionally","Document required filter combos in your API wrapper","Test the no-filter call in staging to fail fast"],"tags":["http-400","rest-api","query-parameters","webhook"],"backgroundTag":"missing-required-argument","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}