Usage of the Feedback API

1
Dear, When I try to use the AddFeedback call from the FeedbackAPI, I receive the following error: "com.mendix.modules.microflowengine.MicroflowException: Calling a webservice with a null parameter is not allowed (Username = null)". Which value is supposed to be filled in here? I've tried the following Usernames: - Generated an API user in the sprinter; - Retrieve of the logged in user from the app; - I've used the "PlatformAPIUser" key. However, no results... Is someone able to help me out on this one? Thank you in advance.
asked
6 answers
2

I tested this for you and i received the same error. After i migrated the project from 5.9.1 to 5.12.0 (the latest version i have) The error you get is changed to

com.mendix.modules.microflowengine.MicroflowException: Calling a webservice with a null parameter is not allowed (Username_2 = null)

Which is weird because there is no Username_2 at all in my domain model.

I also tested the get_feedback action and this seems to work just fine. The main difference between these two app service operations is that the add operation has an additional username parameter which the other one does not. I guess that the second username parameter is mapped to a wrong parameter server side which causes this error.

Also weird is that when i try to create the same appserver, e.g. one with a Username parameter and with authentication enabled it will always show just 1 Username parameter instead of two. (namely the one used for Authentication).

To truely tackle this issue Mendix should reserve the word username on attributes or it should prohibit the attribute username to be used in a published app service.

So for now the app service seems to be broken, unless i am missing something here.

answered
1

Richard,

I've used the following successfully:

PlatformAPIUser

PlatformAPIPassword

These 2 combined with my Project Key from the app platform and a generated Feedback API Key did the trick for me.

Hope that helps,

Mike

answered
1

Dear Pieter,

Yes, I've tried to debug the microflow. When the debugger hits the AddFeedback call, the variables are as indicated in the screenshot. However, still the error does occur and it gives the following stack....

Thank you in advance for your help.

alt text

answered
0

Dear Mike,

Thank you for your quick response. Unfortunately, your suggestion does not work for me...

I've used the username, password, and created a PlatformAPIUser in the sprinter environment, which got me an API key. I've posted a screenshot of the AddFeedback settings, perhaps could you see what is not right there..?

Thank you in advance!

alt text

alt text

answered
0

Hi Richard,

As Mike says, the username and password fields in your request should have the following values:

username : PlatformAPIUser password : PlatformAPIPassword

The project ID you can find in your Project Settings in the Development Portal, and you can create the API Key required to use the Feedback API there as well. As far as I can see you have created constants for all of these, so as long as these constants are correct, making a call to the Feedback API should work, assuming the remainder of the inputs is valid.

Looking at your particular issue, it appears that you have filled in the constant value you used for username (@TicketingSystem.Project_Username) in this field as well, which is likely incorrect. The Username field expects the name of the user who created the feedback in your system. (So for example 'Richard van Osnabrugge') , whereas you entered the value of the username attribute, which I'd expect to contain 'PlatformAPIUser'. Note this will not break anything, but it would result in your feedback submitter not having the correct name.

Looking at your stacktrace however, it appears as if your exception already occurs during the client side validation before the FeedbackAPI call, the exception being caused by Username being null. Assuming that the top screenshot shows the state of the inputs at the time of calling the API, this would mean that @TicketingSystem.Project_Username is empty. (As far as I an tell, you are running the app locally, which would mean you need to fill in the proper default value for this constant)

answered
0

Thank you for your answer. The constants are flled in properly.

As I stated in the initial post, I've tried the following Usernames:

  • Generated an API user in the sprinter
  • Retrieve of the logged in user from the app
  • I've used the "PlatformAPIUser" key..
  • Even a string, as you've suggested.

Unfortunately, all results in the error message which states that the "Username" cannot be null.....

Any other suggestions?

alt text

answered