Login with credentials
1 min
code examples curl request post \\ \ url https //api archbee com/v2/auth/login \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ form 'email="string\<email>"' \\ \ form 'password="string\<password>"'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var formdata = new formdata(); formdata append("email", "string\<email>"); formdata append("password", "string\<password>"); var requestoptions = { method 'post', headers myheaders, body formdata, redirect 'follow' }; fetch("https //api archbee com/v2/auth/login", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api archbee com/v2/auth/login") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" form data = \[\['email', file open('undefined')],\['password', file open('undefined')]] request set form form data, 'multipart/form data' response = https request(request) puts response read body import requests import json url = "https //api archbee com/v2/auth/login" payload = {} files=\[ ] headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload, files=files) print(response text) responses // authentication successful { "accesstoken" "eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9 ", "refreshtoken" "dghpcybpcybhihjlznjlc2ggdg9rzw4 ", "tokentype" "bearer", "expiresin" 3600 }// invalid credentials { "code" "validation error", "message" "the request body contains invalid fields", "details" \[ { "field" "email", "message" "must be a valid email address", "code" "invalid format" } ], "requestid" "" }