API unable to get a token
Answered
- curl "https://my.zipato.com:443/zipato-web/rest/user/init"
- {
- "success" : true,
- "jsessionid" : "46F57E7964ECFBBCBEEE64A81B50EB52",
- "nonce" : "jLcGDNLiFqELaDTv"
- }
- export nonce=jLcGDNLiFqELaDTv
- export password=my_password
- sha=`echo -n "$password" | sha1sum | awk '{print $1}'`
- token=`echo -n "$nonce$sha" | sha1sum | awk '{print $1}'`
- echo $token
- 74cec65b53aeaca2ea5b44fbf8345cbff0fb0adc
- curl "https://my.zipato.com:443/zipato-web/rest/user/login?username=my_name%40my_domain.com&token=74cec65b53aeaca2ea5b44fbf8345cbff0fb0adc"
- {"success":false,"error":"User \"my_name@my_domain.com\" not found or wrong password.","jsessionid":"571A0B2D6A133A3B1F32ECE935C5F452","nonce":"clJdRkCzigFOcLTv"}
Of course my_name%40my_domain.com and my_password are replaced to my real credentials.
No connection
Real-time notifications may not work
'/user/login' also needs JSESSIONID.
It's not problem when calling from browser because it is automatically sent in cookies.
You would need to set some curl options to send cookies with JSESSIONID.
All other request will also need valid (authenticated) JSESSIONID.
'/user/login' also needs JSESSIONID.
It's not problem when calling from browser because it is automatically sent in cookies.
You would need to set some curl options to send cookies with JSESSIONID.
All other request will also need valid (authenticated) JSESSIONID.
'/user/login' also needs JSESSIONID.
It's not problem when calling from browser because it is automatically sent in cookies.
You would need to set some curl options to send cookies with JSESSIONID.
All other request will also need valid (authenticated) JSESSIONID.
'/user/login' also needs JSESSIONID.
It's not problem when calling from browser because it is automatically sent in cookies.
You would need to set some curl options to send cookies with JSESSIONID.
All other request will also need valid (authenticated) JSESSIONID.
Great! It works!
Maybe you should talk about this JSESSIONID cookie in API documentation.
Great! It works!
Maybe you should talk about this JSESSIONID cookie in API documentation.
Thanks for your response and thanks for your work on this API.
Thanks for your response and thanks for your work on this API.
Hi! Someone could explain to me how to proceed with JSESSIONID, with cURL? Thanks.
Hi! Someone could explain to me how to proceed with JSESSIONID, with cURL? Thanks.
First JSESSIONID you will get from /user/init and then send it as cookie in every other request.
First JSESSIONID you will get from /user/init and then send it as cookie in every other request.
Replies have been locked on this page!