Introduction
The PowerChoice API documentation can be found below. If you need additional support, please contact PSG Technical Support.
Token Based Authorization
The API requires a provided username and password. Please contact PSG for your credentials. Each request to the
API must include an authorization token. Each token is valid for a period of 24 hours, and then must be renewed (after 24hrs) prior to future API requests. Please
use the following instructions to acquire an authorization token.
| VERB / API Endpoint | Description |
| POST api/token (Retrieve a token) |
Requires three (3) x-www-form-urlencoded key/value pairs. These must be submitted in the body of the request.
- username / [your Genie provided username]
- password / [your Genie provided password]
- grant_type / password (always use the static value of "password")
Response Example:
{
"access_token": "[token value]",
"token_type": "bearer",
"expires_in": 86399
}
|
| Usage Example |
You must include your authorization token with all API requests. The token must be provided in a header key/value pair as shown below.
The key is always authorization and the value is always begins with bearer, a space, and then your token value.
- authorization / bearer [token value]
cURL Example:
curl -X GET \
/api/SomeResource \
-H 'authorization: bearer RTZ5WUsQpcMOzgLmoGYubS[truncated]gS9hmyLf9yzYu_M'
C# Example:
var client = new RestClient("/api/SomeResource");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "bearer RTZ5WUsQpcMOzgLmoGYubS[truncated]gS9hmyLf9yzYu_M");
IRestResponse response = client.Execute(request);
|