Apps And Solutions
Authentication
Get access token based on username and password
1min
code examples curl location '/developer/auth/user/token' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "username" "", "password" "" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "username" "", "password" "" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("/developer/auth/user/token", 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("/developer/auth/user/token") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "username" "", "password" "" }) response = http request(request) puts response read body import requests import json url = "/developer/auth/user/token" payload = json dumps({ "username" "", "password" "" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // access token { "accesstoken" "", "expiresin" 0 }