Tavio Public API
...
Authentication
Authenticates a user within the context of a specific organization.
1 min
code examples curl location globoff 'https //api integrationmarketplace io/v1/{orgdomain}/auth/login' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data raw '{ "username" "john doe\@example com", "password" "john doe password" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "username" "john doe\@example com", "password" "john doe password" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api integrationmarketplace io/v1/{orgdomain}/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 integrationmarketplace io/v1/{orgdomain}/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" request body = json dump({ "username" "john doe\@example com", "password" "john doe password" }) response = https request(request) puts response read body import requests import json url = "https //api integrationmarketplace io/v1/{orgdomain}/auth/login" payload = json dumps({ "username" "john doe\@example com", "password" "john doe password" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // returned when the user successfully authenticated { "token" "000a0000 a00a 00a0 a000 000000000000", "expires in" 3600, "user" { "id" "000a0000 a00a 00a0 a000 000000000001", "username" "username", "email" "user\@example com", "firstname" "first", "lastname" "john", "status" "active", "mfarequired" false, "mfaconfigured" false, "changepassword" false, "invite expired" false, "favorite" \[ "" ] } }// returned when the client request is malformed — the server can't process it due to missing or invalid input { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }// returned when the request is well formed but access is denied due to invalid or expired credentials { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }// returned when the requested resource could not be found this can be due to an incorrect url or a resource that has been deleted { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }// returned when the server encounters an unexpected error that prevents it from fulfilling the request { "status" 400, "error" "bad request", "message" "invalid request parameters", "path" "/v1/{orgdomain}/environments", "timestamp" "2021 01 01t00 00 00z" }