Generate the API Access Token
The following steps illustrate how to use Postman to generate an access token for a specified user and company.
1. Creating the Request
Create a new request in Postman as follows:
-
Change the
HTTP verb
from GET to POST. -
Specify the
URL
to theToken/authenticateByApiKey
API endpoint i.e., https://fslpresales.fslcgix-uat.co.uk/FSLPresales_WebAPI/api/Token/authenticateByApiKey. -
Add a request header with key
ApiKey
. The value should be set to the API key configured earlier in IIS (ServiceApiKey
environment variable). For example, “95e37e3b-166f-4b3b-93aa-e2d2f09077a2”. -
Add a request header with key
UserName
. The value is the CGiX user to generate the reports for e.g. “CgixReportingUser”. -
Add a request header with key
CompanyId
. The value is the CGiX company ID associated to the provided CGiX user. For example, if user “CgixReportingUser” belongs to company with ID “FSL”, then set theCompanyId
to “FSL”.
2. Sending the Request
Click the Send button to send the prepared request.
3. The Response Body
The response returns an access token, its expiry date, expiry in minutes and the user name for which the token was created.
The token can now be used in the subsequent calls to the API to generate and access reports.
Token Expiry
By default, the token is valid for 7 days or 10,080 minutes.
The token expiry duration in days can be changed in the CGiX Web API configuration file (appsettings.json).
"ApiKeyConfiguration": { "ExpiryInDays": 7 },
Updated about 1 year ago