{"record":{"id":"aa177690df78440e","repo":"AlexxIT/go2rtc","slug":"email-password-api-key-and-api-id-required","errorCode":null,"errorMessage":"email, password, api_key and api_id required","messagePattern":"email, password, api_key and api_id required","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"internal/wyze/wyze.go","lineNumber":124,"sourceCode":"\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t}\n}\n\nfunc apiAuth(w http.ResponseWriter, r *http.Request) {\n\tif err := r.ParseForm(); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\temail := r.Form.Get(\"email\")\n\tpassword := r.Form.Get(\"password\")\n\tapiKey := r.Form.Get(\"api_key\")\n\tapiID := r.Form.Get(\"api_id\")\n\n\tif email == \"\" || password == \"\" || apiKey == \"\" || apiID == \"\" {\n\t\thttp.Error(w, \"email, password, api_key and api_id required\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Try to login\n\tcloud := wyze.NewCloud(apiKey, apiID)\n\n\tif err := cloud.Login(email, password); err != nil {\n\t\t// Check for MFA error\n\t\tvar authErr *wyze.AuthError\n\t\tif ok := isAuthError(err, &authErr); ok {\n\t\t\tw.Header().Set(\"Content-Type\", api.MimeJSON)\n\t\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\t\t_ = json.NewEncoder(w).Encode(authErr)\n\t\t\treturn\n\t\t}\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/wyze/wyze.go#L106-L142","documentation":"HTTP 400 sentinel from apiAuth: a required form field is empty — one of email, password, api_key, or api_id was not supplied in the request, so Wyze cloud login cannot be attempted.","triggerScenarios":"Thrown at internal/wyze/wyze.go:124 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Submit all four form fields: email, password, api_key, api_id"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}