Hi,
I’m trying to develop a tool that will create generic event in Milestone by using Milestone RESTful API Gateway. Before doing it, I’m testing the commands GET and POST for the Milestone Online Documentation using POSTMAN.
I can get easily the Milestone server infos, id, token, get all generic events array and even alarm definitions array. But when I’m trying to POST for create a new Generic Event object using the following url and POSTMAN it give me an error message as described below.
http://serverip/API/rest/v1/genericEvents
{
“error”: {
"httpCode": 400,
"details": \[
{
"errorText": "JSON syntax error"
}
\]
}
}
What is the reason of issue? I’ve tried a couple of things, checking the syntax and it doesn’t work.
I need a help to solve that issue.
Thanks,
Best regards,
Ramzi
You mention the online documentation. So what you have tried is similar to: https://doc.developer.milestonesys.com/mipvmsapi/#tag/Events/operation/postgenericEventsById
?
Testing I noticed a mistake in the documentation
“expression”: “\“abc\””, (works for me)
Expression need to be in quotes and the documentation does not show.
Hi,
Thanks for your feedback. I’ve already tried with the double quote and here is what I’ve got as JSON answer into POSTMAN when I sent the POST AddGenericEvent from Milestone API.
Please refer to the screenshot for more details.
In Milestone Management server, I’ve already the correct user as Administrator roles.
I don’t know what is the issue?
I’ve tried another POST command from POSTMAN such as Add Analytic Event and it works well.
Best regards,
Ramzi
Hi,
I’ve solved my issue. It was a bug in the previlege and token assignment.
Now I’m able to create a new GenericEvent and get JSON answer as expected.
Thanks for the support.
NOTE: I’ve attached a POSTMAN screenshot as a result of the resquest.
Best regards,
Ramzi
I love to see issues solved like this when the troubleshooting pays off eventually. Thanks for sharing.