API call via Postman.
Hello everyone,
Since the forum is still down, I have a question I'd like to ask about the different API methods available. I managed to make 2 get method calls via Postman, but I can't make any Post method. I tried to follow the swagger documentation in order to send the right JSON body.
I tried two ways for the Post auditPage :
Input JSON body :
{
"urls": "https://www.wikipedia.org/",
"referential": "RGAA_4_0",
"level": "AAA",
"contractId": 10,
"tags":[
"abcd"
]
}
Console log :
"status": 400,
"error": "Bad Request",
"message": "JSON parse error: Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>` out of VALUE_STRING token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>` out of VALUE_STRING token\n at [Source: (PushbackInputStream); line: 2, column: 12] (through reference chain: org.asqatasun.web.audit.PageAuditRequest[\"urls\"])",
"path": "/api/v1/audit/run"
Input JSON body
{
"urls": ["https://www.wikipedia.org/"],
"referential": "RGAA_4_0",
"level": "AAA",
"contractId": 10,
"tags":[
"abcd"
]
}
Console log :
"status": 500,
"error": "Internal Server Error",
"message": "Invocation failure\nController [org.asqatasun.web.audit.AuditController]\nMethod [public final long org.asqatasun.web.audit.AuditController.auditPage(org.asqatasun.web.audit.PageAuditRequest,javax.servlet.http.HttpServletRequest)] with argument values:\n [0] [type=org.asqatasun.web.audit.PageAuditRequest] [value=PageAuditRequest(urls=[https://www.wikipedia.org/], referential=RGAA_4_0, level=AAA, contractId=10, tags=[abcd])],\n[1] [type=org.springframework.security.web.servletapi.HttpServlet3RequestFactory$Servlet3SecurityContextHolderAwareRequestWrapper] [value=SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.header.HeaderWriterFilter$HeaderWriterRequest@48a2825b]] ",
"path": "/api/v1/audit/run"
Thank you
Edited by Fabrice Gangler