Testing a basic plugin is rather simple, as all it requires is for the /dataset and /query endpoints to be implemented. If you are using a form of authentication and would like more information on how that should be implemented, please refer to this article.
To test the /datasets endpoint, you can use Postman, and send a GET request to your plugin running locally. If you implemented the plugin secret, make sure to set the 'X-Secret' header with the correct value. Also set any other headers necessary for connecting to your data source, such as 'X-Key', 'X-Token' or 'X-Host'. Check that the body returned is in JSON format and consists of an array of objects of the following form:
[
{
"id" : "<your_dataset_id>",
"name" : { "en" : "<your_dataset_name>" },
"description" : { "en" : "<your_dataset_description>" },
"columns" : [
{
"id" : "<your_column_id>" ,
"name" : { "en" : "<your_column_name>" } ,
"type" : "<hierarchy | numeric | datetime>"
},
...
]
},
...
]
Alternatively, you can use ngrok to quickly make a test connection to the Luzmo platform. First run your plugin locally, then expose your local web server using ngrok:
ngrok http <your_server_port>
Next, create a plugin in Luzmo and use the https address ngrok gives you as the base URL. Now try to add a new dataset using your plugin. Luzmo will send a request to the /datasets endpoint and display the results in the UI. If you see an error message instead of datasets, then something is probably wrong in the format you're returning.
In a basic plugin, the POST /query should return all the columns in the dataset as described in the /datasets call. The easiest way to test this is to add your plugin to the Luzmo platform using ngrok (you probably already did this when testing the /datasets endpoint). Next, add a dataset from your plugin and click on it to show the values in the dataset. If everything works correctly, you should see your data appear in the Luzmo UI. If you see the following error then something is wrong with the data returned.
Often this is due to dates not being transformed correctly. Verify that all dates are sent in the following format: YYYY-MM-DDThh:mm:ssZ. If this isn't the issue, confirm that all columns are being sent in the correct order.
Implementing filters in your plugin is completely optional for a basic plugin.