New to Peplink Router

Hi all

I just bought a Pepwave Max HD2 router and was experimenting some of the Peplink Router API. When I tried to call the login API, I was thrown with the unauthorized error.

This is the command I ran
curl -k -c cookies.txt -H “Content-Type: application/json” -X POST -d ‘{“username”:“user”,“password”:“XXXXX”}’

I am able to log in the Web UI via the user credentials, and saw on the logs that there’s a login failure when I call the login API, can anyone advice on how to resolve this?

There is a great post here you should look at with sample code: