{"_id":"55e49f04de0d360d0027bc68","editedParams2":true,"project":"55dcd6a68a3dcd2300cc5f76","category":{"_id":"55e49e35830ec32300e1a391","pages":["55e49f04de0d360d0027bc68","55e5f0bc9416190d00dc3a47","5609d60f9f85a70d00908572","5609d65c96ff420d004c8771","564f5cdaea8cef1900ae505e","56720127c17bf90d00b95845","5676d160511d400d0070f2fc"],"project":"55dcd6a68a3dcd2300cc5f76","version":"55dcd6a78a3dcd2300cc5f79","__v":7,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-31T18:34:29.204Z","from_sync":false,"order":1,"slug":"web-api-calls","title":"Web API Calls"},"editedParams":true,"__v":2,"version":{"_id":"55dcd6a78a3dcd2300cc5f79","project":"55dcd6a68a3dcd2300cc5f76","__v":3,"createdAt":"2015-08-25T20:57:11.187Z","releaseDate":"2015-08-25T20:57:11.187Z","categories":["55dcd6a78a3dcd2300cc5f7a","55dce1048a3dcd2300cc5f96","55e49e35830ec32300e1a391"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"22.0.0","version":"22"},"user":"55dcd49b0efd5821000d5358","updates":["57026e0fadbd340e00928b5e"],"next":{"pages":[],"description":""},"createdAt":"2015-08-31T18:37:56.771Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"curl -s -S -X GET -H \"content-type:application/json\" -H \"apikey:WeavedDemoKey\\$2015\" https://api.weaved.com/v22/api/user/login/youraccount:::at:::email.com/your_weaved_password","language":"curl"},{"code":"import httplib2\nimport json\nimport datetime\nimport base64\nimport sys\nimport os\nimport getpass\nimport errno\n\nfrom urllib2 import urlopen\nfrom json import dumps\n\nfrom socket import error as socket_error\nimport socket\n\napiMethod=\"https://\"\napiVersion=\"/v22\"\napiServer=\"api.weaved.com\"\napiKey=\"WeavedDemoKey$2015\"\n\n#===============================================\nif __name__ == '__main__':\n\n    httplib2.debuglevel     = 0\n    http                    = httplib2.Http()\n    content_type_header     = \"application/json\"\n\n    userName = raw_input(\"User name:\") \n    password = raw_input(\"Password:\")\n        \n    loginURL = apiMethod + apiServer + apiVersion + \"/api/user/login\"\n\n    loginHeaders = {\n                'Content-Type': content_type_header,\n                'apikey': apiKey\n            }\n    try:        \n        response, content = http.request( loginURL + \"/\" + userName + \"/\" + password,\n                                          'GET',\n                                          headers=loginHeaders)\n    except:\n        print \"Server not found.  Possible connection problem!\"\n        exit()                                          \n#    print (response)\n    print \"============================================================\"\n    print (content)\n    print\n\n    try: \n        data = json.loads(content)\n        if(data[\"status\"] != \"true\"):\n            print \"Can't connect to Weaved server!\"\n            print data[\"reason\"]\n            exit()\n\n        token = data[\"token\"]\n    except KeyError:\n        print \"Comnnection failed!\"\n        exit()\n        \n    print \"Token = \" +  token\n","language":"python"}]},"method":"get","results":{"codes":[{"status":200,"language":"json","code":"\n\n    {\n        \"status\": \"true\",\n        \"token\": \"58c25787c5514d43ae1d53a571daafe1\",\n        \"email\": \"example@example.com\",\n        \"guid\": \"6BE2CB95-A2B9-4F22-A1D5-9148F932D613\",\n        \"service_token\": \"EBE7EBE7E4AD9F9CB4A68E8CBFE489BBBFA8BBBA9ABBB3B195BBA7FAECEEEFEBE4E8EDEBE9E8E8ECE7ECE8E7E4EBEAF0EFE7EDF0EFEFEAF0EFE6ECE4B8BFAB123457B0BBEFE7E6E79EA7BFB6B1B1F0BDB1B3E48E8C91E4ECEBE4EFE6EEEEE4EFEEEEE4ECE4EEE4EFE4B39D94BABF9A96A4\",\n        \"service_level\": \"PRO\",\n        \"storage_plan\": \"FREE_N\",\n        \"secondary_auth\": \"usfKaasdfAype6RNZV6Y9qrahmc=\",\n        \"apikey\": \"WeavedDemoKey$2015\",\n        \"auth_token\": \"58c25787c55143df67ac53a571daafe1\",\n        \"auth_expiration\": 1441651690,\n        \"service_authhash\": \"74AB5706338889D691232B88D4665BFA0BC6D32\",\n        \"developer_plan\": \"DEVELOPER\",\n        \"portal_plan\": \"free_plan\",\n        \"portal_plan_expires\": \"2038-01-01 00:00:00\",\n        \"service_features\": \"YWRzPTAsc2hhcmU9Mixjb25jdXJyZW50PTEscDJwZHVyYXRpb249MTgwMCxwMnBkYWlseT0xMDAwLGd1ZXN0PTA=\"\n    }\n\n","name":""},{"status":400,"language":"json","code":"    {\n        \"status\": \"false\",\n        \"reason\": \"[0102] The username or password are invalid\"\n    }","name":""}]},"settings":"","auth":"never","params":[{"_id":"55e4a018830ec32300e1a399","ref":"","in":"path","required":false,"desc":"User's Weaved account name","default":"","type":"string","name":"username"},{"_id":"55e4a018830ec32300e1a398","ref":"","in":"path","required":false,"desc":"User's Weaved account password","default":"","type":"string","name":"password"}],"url":"/user/login/:username/:password"},"isReference":false,"order":0,"body":"Before doing anything useful with the Weaved API, you need to be logged into your account.  This call will return a token that you need to use in other calls.\n\nThe keys returned from this call are defined as follows:\n\n**status **- true if called succeeded, false if it failed\n**token **- login token for this session\n**email **- your e-mail account\n**guid **- ???\n**service_token **- ???\n**service_level **- depends on subscription level you have selected\n**storage_plan **- indicates a storage plan, if any, associated with your account\n**secondary_auth **- ???\n**apikey **- apikey used for this call\n**auth_token **- ???\n**auth_expiration** - ???\n**service_authhash** - ???\n**developer_plan** - ???\n**portal_plan** - ???\n**portal_plan_expires** - expiration date for current Portal Plan\n**service_features** - ???","excerpt":"Sign in to Weaved account","slug":"userlogin","type":"endpoint","title":"/user/login"}

get/user/login

Sign in to Weaved account

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

username:
string
User's Weaved account name
password:
string
User's Weaved account password

Examples


Result Format


Documentation

Before doing anything useful with the Weaved API, you need to be logged into your account. This call will return a token that you need to use in other calls. The keys returned from this call are defined as follows: **status **- true if called succeeded, false if it failed **token **- login token for this session **email **- your e-mail account **guid **- ??? **service_token **- ??? **service_level **- depends on subscription level you have selected **storage_plan **- indicates a storage plan, if any, associated with your account **secondary_auth **- ??? **apikey **- apikey used for this call **auth_token **- ??? **auth_expiration** - ??? **service_authhash** - ??? **developer_plan** - ??? **portal_plan** - ??? **portal_plan_expires** - expiration date for current Portal Plan **service_features** - ???

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}