We want to capture real time data when scan will start and after completed the scan

We have two API
1- Send data to event hub when scan is started.
2- Send data to event hub when scan is completed.

We need to pass json data to those API
Scan Started API
{ “tool”: “sonar”, “url”: “http://localhost:900”,“timestamp”: “2022-07-27T00:51:57Z”,“mots_id”:“12345”,“status”: “started”,“ci_server”: {“conversation_id” : “123456789”}}

Scan Completed API
{“tool”: “sonar”, “url”: “http://localhost:900”,“timestamp”: “2022-07-27T00:51:57Z”,“mots_id”:“12345”,“status”: “completed”,“ci_server”: { “conversation_id” : “123456789”,},“metrics”:{“reliability_rating”:“A”,“security_rating”:“B”,“sqale_rating”:“A”,“security_hotspots”:“5”, “coverage”:“96.8%”, “tests”:“655”,“ncloc”:“7856”,“bug”:“17567”,“vulnerability”: “87”,“code_smell”: “34”,“blocker”: “3”,“critical”: “678”,“major”: “3456”,“minor”: “456”,“info”: “21”}}

How we can invoke my API and get real time data?

Hey there.

I’m not sure what value you get out of knowing when a scan started, but as for sending data to another service when the scan is finished I can recommend you use Webhooks.