Request authorisation token via curl


I followed your API doc, which I found quite informative. I was wondering
if there is a way to get the authorisation token (and then subsequently the
access and refresh token) using curl on the command line? Is there an
example somewhere? Also, I’d like to understand how to get later on a new
access token using the refresh token via curl.