Auto attendance with API

Hello, I have set up a ZKTeco k40 pro device for attendance. I need to integrate it with erpnext server (self hosted cloud) with API. Through forum and docs, I learnt there is an option to use API call to send checkin data to server. But I have no idea where to start.
Can some one please guide me through steps to achieve this ?
I had posted this question some time ago this in this link. I got a reply but it was too general.

I need help with the script.