{"record":{"id":"5af7bf7c863ec533","repo":"chenhg5/cc-connect","slug":"webex-createdevice-status-d","errorCode":null,"errorMessage":"webex: createDevice status %d","messagePattern":"webex: createDevice status (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/webex/client.go","lineNumber":143,"sourceCode":"\t}\n\tvar p person\n\tif err := json.NewDecoder(resp.Body).Decode(&p); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &p, nil\n}\n\nfunc (c *httpClient) CreateDevice(ctx context.Context) (*device, error) {\n\t// The WDM device endpoint requires name + model + localizedModel; omitting\n\t// model returns HTTP 400 \"Missing Model\". Verified against the live API.\n\tpayload := []byte(`{\"deviceName\":\"cc-connect\",\"name\":\"cc-connect\",\"model\":\"cc-connect\",\"localizedModel\":\"cc-connect\",\"systemName\":\"cc-connect\",\"systemVersion\":\"1.0\",\"deviceType\":\"DESKTOP\"}`)\n\tresp, err := c.doWithRetry(ctx, http.MethodPost, \"https://wdm-a.wbx2.com/wdm/api/v1/devices\", payload, \"application/json\", \"webex: createDevice\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\tif resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {\n\t\treturn nil, fmt.Errorf(\"webex: createDevice status %d\", resp.StatusCode)\n\t}\n\tvar d device\n\tif err := json.NewDecoder(resp.Body).Decode(&d); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &d, nil\n}\n\nfunc (c *httpClient) DeleteDevice(ctx context.Context, deviceURL string) error {\n\tif deviceURL == \"\" {\n\t\treturn nil\n\t}\n\tresp, err := c.doWithRetry(ctx, http.MethodDelete, deviceURL, nil, \"\", \"webex: deleteDevice\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\tif resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusAccepted {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/webex/client.go#L125-L161","documentation":"The WDM (Webex Device Management) device registration POST returned an unexpected HTTP status. This guard fires after the request completed; a known cause of 400 is omitting required fields (name/model/localizedModel are mandatory, as noted in the comment), while 401 indicates a bad token.","triggerScenarios":"Thrown at platform/webex/client.go:143 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["For 400, ensure the payload includes deviceName, name, model, localizedModel, systemName, systemVersion and deviceType as the code does","For 401/403, check the bot token and WDM access rights","Log the response body to surface the WDM error detail","Retry on 5xx with backoff at the caller level"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}