I am happy to help with questions like how to get your Client ID and provide pseudo code, but, I can’t commit to writing out JS/PHP code - I already have a full time development job and help develop a bot on the side 
Sadly, with Curl, I don’t really use it, in PHP I use HttpGuzzle (which I think can use Curl as the transport mechanism, but that is hidden by the class). If you have general questions, I can try to help out though.