Error sending mail with attachment using x-pack

I am using x-pack to configure auto reporting of dashboard , for that I have created a watch and while executing the same I am getting below error:

"reason": "Watch[test] reporting[dashboard.pdf] Error response when trying to trigger reporting generation host[10.2.85.1], port[8150] method[POST], path[/api/reporting/generate/dashboard/f24aee00-80f1-11e7-8b6c-07b2c9e1ab5a], status[401]"

My config is as below ;

{
  "trigger": {
    "schedule": {
      "interval": "1m"
    }
  },
  "input": {
    "none": {}
  },
  "condition": {
    "always": {}
  },
  "actions": {
    "send_email": {
      "email": {
        "profile": "standard",
        "attachments": {
          "dashboard.pdf": {
            "reporting": {
              "url": "http://10.2.85.1:8150/api/reporting/generate/dashboard/f24aee00-80f1-11e7-8b6c-07b2c9e1ab5a"
            }
          }
        },
        "from": "test@abc.com",
        "to": [
          "test@gmail.com",
        ],
        "subject": "Error Monitoring Report",
        "body": {
          "text": "Report Generated"
        }
      }
    }
  }
}

will be good if someone can help for same.

the HTTP status 401 indicates you might be missing required authentication data.

Thanks @spinscale , I think I missed

  "auth": {
    "basic": {
      "username": "prashant"
    }
  }

after adding the same it worked.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.