Open any LAB by API
Posted: Tue Sep 15, 2020 9:44 am
Hi,
Could you please explain, how does it work?
curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/Lab%201.unl
I have these outputs:
root@eveng:~# curl -s -b /tmp/cookie -c /tmp/cookie -X POST -d '{"username":"User1","password":"testpassword1"}' http://127.0.0.1/api/auth/login
{"code":200,"status":"success","message":"User logged in (90013)."}
root@eveng:~#
root@eveng:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/auth
{"code":200,"status":"success","message":"User has been loaded (90002).","data":{"email":"v@hotmail.com","folder":"\/Shared","lab":null,"lang":"en","name":"","role":"admin","tenant":"1","html5":"1","username":"User1"}}
root@eveng-isr:~#
I have my test here:
Current position / root / Shared / test.unl
When I try to load my test I receive this message
root@eveng:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/test.unl
{"code":404,"status":"fail","message":"Lab does not exist (60000)."}root@eveng:~#
What is my mistake?
Could you please explain, how does it work?
curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/Lab%201.unl
I have these outputs:
root@eveng:~# curl -s -b /tmp/cookie -c /tmp/cookie -X POST -d '{"username":"User1","password":"testpassword1"}' http://127.0.0.1/api/auth/login
{"code":200,"status":"success","message":"User logged in (90013)."}
root@eveng:~#
root@eveng:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/auth
{"code":200,"status":"success","message":"User has been loaded (90002).","data":{"email":"v@hotmail.com","folder":"\/Shared","lab":null,"lang":"en","name":"","role":"admin","tenant":"1","html5":"1","username":"User1"}}
root@eveng-isr:~#
I have my test here:
Current position / root / Shared / test.unl
When I try to load my test I receive this message
root@eveng:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/test.unl
{"code":404,"status":"fail","message":"Lab does not exist (60000)."}root@eveng:~#
What is my mistake?