REST API callback() missing required positional argument

I am trying to set up the REST API, however, the example from the docs throws an error:
TypeError: my_callback() missing 1 required positional argument: 'data'

This is the code:

import appdaemon.plugins.hass.hassapi as hass

class API(hass.Hass):

    def initialize(self):
        self.register_endpoint(my_callback, "test_endpoint")

    def my_callback(self, data):

        self.log(data)

        response = {"message": "Hello World"}

        return response, 200

I use the Hassio AppDaemon addon.

You need to use self.my_callback:

self.register_endpoint(self.my_callback, "test_endpoint")

And the example should be corrected in the docs.

That was it! Thank you :smile: