Unable to download cloud storage recording via curl api

Hi,

I m using API (https://api.zoom.us/v2/meetings/{metting_id}/recordings) to get meeting details via JWT Token. its work fine for me. In this response i m getting Download & Play URL without any extensions.

eg:
/us02web.zoom.us/rec/play/xxxx…
/us02web.zoom.us/rec/download/xxxx…

If i paste download url in the browser then recording successfully downloading. but i want to download video recording via script. Currently i m using PHP script to download and save recording on my server. but i m unable to save recording in mp4 format on my server its save as a text file.

So please help me to how to download recorded video from cloud storage from zoom to my server.