mer30boy

Registered
Feb 16, 2020
3
0
1
iran
cPanel Access Level
Website Owner
Hi @rccaj,

I get the session key this way and use all the way for other API calls:

You need to use a POST method to send a request to "cPanelUrl:2083/login/?login_only=1" and for the parameters you need to pass credentials like "user=cpanelUsername&pass=#cpanelPassword".

The response would be like:

Code:
{"status":1,"notices":[],"redirect":"/cpsess9394767568/frontend/paper_lantern/index.html?login=1&post_login=15475794144014","security_token":"/cpsess9394767568"}
After getting this you can get the token (session key) using a JSON parser, regex or whatever you use.

TIP: Use getpostman.com or servistate.com to make sure it works.

Hope that helps.
hi Marani
can you write a example code ?