Help with Reading Cloudflare API Responses in Home Assistant using rest_command

I’ve written a Python script that updates the DNS A records with the public IP address for multiple domains in Cloudflare. Now, I want to integrate this functionality into Home Assistant via automation.

I’m planning to use a Home Assistant script with the rest_command integration to call Cloudflare’s API. However, I’m stuck on how to capture and process the response returned by the Cloudflare API when it’s triggered through rest_command.

Is there a way to read or consume the response from Cloudflare’s API in Home Assistant? Are there any alternative approaches or suggestions you would recommend?

Thanks in advance for your help!