Issue or refresh an anonymous consumer token
1 min
code examples curl request post \\ \ url http //localhost 10101/api/v1/auth/guest \\ \ header 'accept application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'post', headers myheaders, redirect 'follow' }; fetch("http //localhost 10101/api/v1/auth/guest", 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("http //localhost 10101/api/v1/auth/guest") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" response = http request(request) puts response read body import requests import json url = "http //localhost 10101/api/v1/auth/guest" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // guest access token issued the guest session cookie in the response replaces any previously presented cookie — always store the latest value { "accesstoken" "eyjhbgcioijsuzi1niisinr5cci6ikpxvcj9 ", "expiresin" 3600, "tokentype" "bearer" }// missing required x upstart tenant header { "error" "unauthorized", "message" "invalid username or password", "code" "unauthorized" }// rate limit exceeded { "error" "unauthorized", "message" "invalid username or password", "code" "unauthorized" }// internal server error { "error" "unauthorized", "message" "invalid username or password", "code" "unauthorized" }