REST API for retrieving authentication token

You use the POST operation on the api/get_token element to request your unique token that is required to authenticate the REST API requests.

To request your unique token, use the following URL:
https://hostname:port/api/get_token
Important: This REST API call does not work when single sign-on authentication is enabled. To view the token, log in to BigFix Inventory, hover over the User icon User icon, and click Profile. Then, click Show token.
Table 1. Operation descriptions
Operation details Description
Operation POST /api/get_token
Purpose Returns the authentication token
HTTP method POST
Resource URI https://server_host_name:port_number/api/get_token
URL link relation n/a
URI query parameters n/a
Request headers
Header
Accept-Language (optional)
Values
en-US (only English is supported)

Used to negotiate the language of the response. If this header is not specified, the content is returned in the server language.

Request payload
{
	"user" : "username",
	"password" : "password"
}
Request Content-Type
  • application/json
Response headers
Header
Content-Type
Values
application/json

Specifies the content type of the response.

Header
Content-Language
Values
en-US, …

Specifies the language of the response content. If this header is not specified, the content is returned in the server language.

Response payload Token element
Response Content-Type
  • application/json
Normal HTTP response codes
  • 200 – OK
Error HTTP response codes
  • 401 – “Unauthorized”

There is no match for the provided user name and password. If you are using Active Directory, ensure the user name is followed by a domain name, for example username@domain.com.

Example HTTP conversation

Request
POST api/get_token
Host: localhost:9081
Accept: application/json
Accept-Language: en-US
Request header
Content-Type: application/json
Request payload
{
	"user" : "admin",
	"password" : "password"
}
Response header
HTTP/1.1 200 OK
Content-Type: application/json
Content-Language: en-US
Response body (JSON)
{
"token":"44072fb20fbe38322b5e67a7e780978e20abbc80"
}