I have created a simple Hello World API that is called in a dashlet. The problem is it is not returning and not running success or error.
The dashlet should call the api and then console.log what is being return, which is hello world.
I have created a simple Hello World API that is called in a dashlet. The problem is it is not returning and not running success or error.
The dashlet should call the api and then console.log what is being return, which is hello world.
Are you receiving a 200 status when calling the endpoint?
I have installed your MLP into a local instance of Sugar. I made a basic GET call in Postman to {{url}}{{api_version}}/Hello/World/7 and my return result was "Hello World"
So i dont think there's anything wrong with your endpoint itself. I'm betting it has something to do with how you are calling it. I assume you are authenticating first and using the access_token. Otherwise, i'd think you would see at least some error message. Can you share with us your JS that is calling the endpoint?
I am calling the endpoint within the dashlet.(See custom/clients/base/views/hello-world-api/hello-world-api.js) I assumed since I was calling it from with in the dashlet, I would not need to auth.
I am calling the endpoint within the dashlet.(See custom/clients/base/views/hello-world-api/hello-world-api.js) I assumed since I was calling it from with in the dashlet, I would not need to auth.
I see. sorry about that. i didnt look at the other files!
I believe the issue is that nothing is calling your loadData function.
Try adding this.loadData() to your initialize function.