{"id":13437,"date":"2016-06-22T11:32:07","date_gmt":"2016-06-22T16:32:07","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=13437"},"modified":"2018-08-10T12:38:57","modified_gmt":"2018-08-10T17:38:57","slug":"log-in","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/mtr-software\/mtr-api-reference\/rcell_api_appendix\/log-in\/","title":{"rendered":"Using Curl to Log In"},"content":{"rendered":"<p><strong>Example<\/strong>: Using Curl to log in<\/p>\n<pre class=\"brush:xml\">curl -k \"https:\/\/192.168.2.1\/api\/login?username=admin&amp;password=admin\"<\/pre>\n<p><strong>Example<\/strong>: Curl result:<\/p>\n<pre class=\"brush:xml\">{\r\n    \"code\" : 200,\r\n    \"result\" : {\r\n        \"adress\" : \"192.168.2.103\",\r\n        \"permission\" : \"admin\", \r\n        \"port\" : \"52222\",\r\n        \"timestamp\" : \"14:30:5:957\", \t\r\n        \"token\" : \"2442 CB0CB60B2EE9F5A35DF5ED8C33\", \r\n        \"user\" : \"admin\"\r\n    },\r\n    \"status\" : \"success\"\r\n}<\/pre>\n<p><strong>Example<\/strong>: Verbose Curl result:<\/p>\n<pre class=\"brush:xml\">* About to connect () to 192.168.2.1 port 443 (#0)\r\n*   Trying 192.168.2.1... connected\r\n* successfully set certificate verify locations :\r\n*   CAfile : none\r\n  CApath : \/ etc \/ ssl \/ certs\r\n* SSLv3 , TLS handshake , Client hello (1):\r\n* SSLv3 , TLS handshake , Server hello (2):\r\n* SSLv3 , TLS handshake , CERT (11) :\r\n* SSLv3 , TLS handshake , Server finished (14) :\r\n* SSLv3 , TLS handshake , Client key exchange (16) :\r\n* SSLv3 , TLS change cipher , Client hello (1) :\r\n* SSLv3 , TLS handshake , Finished (20) :\r\n* SSLv3 , TLS change cipher , Client hello (1) :\r\n* SSLv3 , TLS handshake , Finished (20) :\r\n* SSL connection using ECDHE -RSA - AES256 -SHA\r\n* Server certificate :\r\n*    subject : C=US; ST= Minnesota ; L= Minneapolis ; CN= rcell . example . com\r\n*    start date : 2013 -05 -01 16:31:06 GMT\r\n*    expire date : 2014 -05 -01 16:31:06 GMT\r\n*    issuer : C=US; ST= Minnesota ; L= Minneapolis ; CN= rcell . example . com\r\n*    SSL certificate verify result : self signed certificate (18) , continuing anyway .\r\n&gt; GET \/ api \/ login ? username = admin &amp; password = admin HTTP \/1.1\r\n&gt; User - Agent : curl \/7.22.0 (x86_64 -pc -linux - gnu ) libcurl \/7.22.0 OpenSSL \/1.0.1 zlib \/1.2.3.4 libidn \/1.23 librtmp \/2.3\r\n&gt; Host : 192.168.2.1\r\n&gt; Accept : *\/*\r\n&gt;\r\n&lt; HTTP \/1.1 200 OK\r\n&lt; Set - Cookie : token =5810 A57DF87328951FF1901027A09A74 ; Max - Age =300; Path =\/; Secure\r\n&lt; Cache - Control : no - cache\r\n&lt; Content - type : application \/ json\r\n&lt; Transfer - Encoding : chunked\r\n&lt; Date : Wed , 15 Jan 2014 14:56:09 GMT\r\n&lt; Server : rcell\r\n&lt;\r\n{\r\n    \"code\" : 200, \r\n    \"result\" : {\r\n        \"adress\" : \"192.168.2.103\",\r\n        \"permission\" : \"admin\", \r\n        \"port\" : \"52222\",\r\n        \"timestamp\" : \"14:30:5:957\", \t\r\n        \"token\" : \"2442 CB0CB60B2EE9F5A35DF5ED8C33\",\r\n        \"user\" : \"admin\"\r\n    },\r\n    \"status\" : \"success\"\r\n}\r\n* Connection #0 to host 192.168.2.1 left intact\r\n* Closing connection #0\r\n* SSLv3 , TLS alert , Client hello (1) :<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Example: Using Curl to log in curl -k &#8220;https:\/\/192.168.2.1\/api\/login?username=admin&amp;password=admin&#8221; Example: Curl result: { &#8220;code&#8221; : 200, &#8220;result&#8221; : { &#8220;adress&#8221; : &#8220;192.168.2.103&#8221;, &#8220;permission&#8221; : &#8220;admin&#8221;, &#8220;port&#8221; : &#8220;52222&#8221;, &#8220;timestamp&#8221; : &#8220;14:30:5:957&#8221;, &#8220;token&#8221; : &#8220;2442 CB0CB60B2EE9F5A35DF5ED8C33&#8221;, &#8220;user&#8221; : &#8220;admin&#8221; }, &#8220;status&#8221; : &#8220;success&#8221; } Example: Verbose Curl result: * About to connect () to 192.168.2.1 port [&hellip;]<\/p>\n","protected":false},"author":1872,"featured_media":0,"parent":13423,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-13437","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/13437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/1872"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=13437"}],"version-history":[{"count":11,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/13437\/revisions"}],"predecessor-version":[{"id":13830,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/13437\/revisions\/13830"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/13423"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=13437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}