POST https://auth.services.ix.co.za/token
Request Information
Body Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| username |
The User's QE username |
string |
None. |
| password |
The User's QE Password |
string |
None. |
| grant_type |
Must be 'password' |
string |
None. |
| source |
This is your name for your app |
string |
None. |
| client_id |
This will be provided by QE on application |
string |
None. |
Request Formats
application/json, text/json
Sample:
{
"username":"JoeSoap",
"password":"JoesPassword",
"grant_type":"password",
"source":"Internal QE App",
"client_id":"[As Supplied by Quoting Engine]"
}
Response Information
Resource Description
A result of BearerToken
| Name | Description | Type | Additional information |
|---|---|---|---|
| status | string |
None. |
|
| message | string |
None. |
|
| identity | integer |
None. |
|
| result | BearerToken |
None. |
Response Formats
For reasons known only to the inner workings of the base code, the format of the bearer token is different between C# and Flutter.Dart, which is why the examples contain different versions of the class BearerToken
application/json, text/json
Sample: Success from C#
{
"status":"ok",
"message":"",
"identity":0,
"result": {
"access_token":"[Your JWT access token for use with other API calls]",
"token_type":"bearer",
"expires_in":86123,
"created":"2026-01-11T12:33:17"
}
}
Sample: Success from Flutter.Dart
{
"status":"ok",
"message":"",
"identity":0,
"result": {
"accessToken":"[Your JWT access token for use with other API calls]",
"tokenType":"bearer",
"expiresIn":86123,
"created":"2026-01-11T12:33:17"
}
}
Sample: Failure
{
"status":"error",
"message":"Invalid Username or Password",
"identity":0,
"result": null
}
Examples
jQuery [Javascript]
Sample:
$.ajax(
{
url: 'https://auth.services.ix.co.za/token',
headers:
{
"accept": "*/*"
},
method: 'POST',
dataType: "json",
data:
{
'username':'JoeSoap',
'password':'JoesPassword',
'grant_type':'password',
'source':'QE Example',
'client_id':'[As Provided by QE]'
},
crossDomain: true,
xhrFields:{withCredentials: true},
success: function (data)
{
//Handle API Call Success [Note: this does not mean that the action was successful, only that the server communication was successful.]
//IF it is successful (status === "ok")
//Extract data.result.accessToken and store the JWT token for use in future calls.
},
error: function (xhr, error, msg)
{
//Handle AJAX Error
}
});
C#.NET
class BearerToken
{
public string access_token{get;set;}
public string token_type{get;set;}
public int expires_in{get;set;}
public DateTime created{get;set;}
}
RestClient client = new RestClient("https://auth.services.ix.co.za/token");
RestRequest request = new RestRequest();
request.Method = Method.POST;
request.AddHeader("Content-Type","application/json");
string jsonString = $"\{'username':'{username}','password':'{password}','grant_type':'password','source':'QE Demo','client_id':'[As Provided by QE]'\}";
request.AddParameter("application/json",jsonString,ParameterType.RequestBody);
IRestResponse rest = client.Execute(request);
if (rest.StatusCode == HttpStatusCode.OK)
{
//Handle API Call Success [Note: this does not mean that the action was successful, only that the server communication was successful.]
//Data is in rest.Content
//If you have created a matching ResultModel<T> (if the API Call returns it). EG: ResultModel<QuoteSection> And you have included the NewtonsoftJson package in your project, you can do this.
ResultModel<BearerToken> result = JsonConvert.DeserializeObject<ResultModel<BearerToken>>(rest.Content);
//result.accessToken will contain your JWT token
}
else
{
//Handle AJAX Error
}
Flutter.Dart
import 'package:http/http.dart' as http;
class BearerToken{
String? accessToken;
String? tokenType;
int? expiresIn;
DateTime? created;
BearerToken({
required this.accessToken,
required this.tokenType,
required this.expiresIn,
this.created
});
factory BearerToken.fromJson(Map? parsedJson){
if (parsedJson == null || parsedJson.isEmpty){
return BearerToken.empty();
}
int expires = parsedJson['expires_in']?.toInt() ?? 0;
String? createdDate = parsedJson['created'];
return BearerToken(
accessToken: parsedJson['access_token'],
tokenType: parsedJson['tokenType'],
expiresIn :expires,
created:createdDate == null || createdDate.isNotEmpty
? DateTime.now().add(new Duration(seconds:expires))
: DateTime.parse(createdDate)
);
}
}
//Note: You should be using the DART version of the API call if it exists
//Note: This will throw an exeption on transmission error.
final response = await http.post(
Uri.https('https://auth.services.ix.co.za','/token').
headers:{
'contentType': 'application/x-www-form-urlencoded'
},
body:{
'username':'JoeSoap',
'password':'JoesPassword',
'grant_type':'password',
'source':'QE Demo',
'client_id':'[As Provided by Quoting Engine]'
}
);
//The result is in response.body
dynamic jsonData = json.decode(response.body);
BearerToken token = BearerToken.fromJson(jsonData);
//token.accessToken will contain your JWT Access Token