java.util.concurrent.ExecutionException: org.zaproxy.clientapi.core.ClientApiException: Missing Parameter

15 views
Skip to first unread message

SimsHere

unread,
Jun 30, 2022, 12:46:30 AMJun 30
to OWASP ZAP User Group
Hi All,

I am creating a context and trying to run spider and scanner for that context, but I am getting the following error:

java.util.concurrent.ExecutionException: org.zaproxy.clientapi.core.ClientApiException: Missing Parameter

Here is the code:

           zapapi.context.newContext("testContext");
           zapapi.context.includeInContext("testContext", "https://xxxxx.*");
           ApiResponseSet ctxt = (ApiResponseSet) zapapi.context.context("testContext");
           String contextId = ctxt.getValue("id").toString();
           this.zapCtxId=contextId;          
                 
               ApiResponse resp;
               this.zapCtxId=contextId;
               resp = zapapi.spider.scanAsUser(contextId, this.zapUserId, targetURL, null, null, null);             
             
               this.scanId = ((ApiResponseElement) resp).getValue();  
               return new ZapApiResult(this.scanId);

Can you please help resolve it.

Thanks,
Kamalpreet

thc...@gmail.com

unread,
Jun 30, 2022, 2:22:11 AMJun 30
to zaprox...@googlegroups.com
Hi.

In which line are the error happening?

Enable "Report error details via API" and it should tell you which
parameter is missing.
https://www.zaproxy.org/docs/api/#troubleshooting

Best regards.

SimsHere

unread,
Jun 30, 2022, 3:06:10 AMJun 30
to OWASP ZAP User Group
Thanks, enabled it and found that the missing parameter is userId.

Can you explain what will be userId. For a particular context and targetUrl, what userId is expected?

Thanks,
Kamalpreet

Simon Bennetts

unread,
Jun 30, 2022, 3:18:29 AMJun 30
to OWASP ZAP User Group
Hiya Kamalpreet,

Its because you are using the "scanAsUser" endpoint.
If you dont want to specify a user then use the "scan" endpoint.

Cheers,

Simon

SimsHere

unread,
Jul 1, 2022, 12:45:18 AMJul 1
to OWASP ZAP User Group
Thanks Simon, was able to run it.

Kamalpreet

Reply all
Reply to author
Forward
0 new messages