We support 3 grant types. 1. Authorization code (default), 2. Client credentials and 3. Password.
The second grant type is very limited used and is only after collaboration with Profix Support Desk and is ment for applications without an user interface.
Password will only be provided if this is absolutely necessary. A code review can be required. We discourage the use of this type.
A Client ID / Client Secret are only allowed one method, which will be predefined.
In this manual we will explain how to get connected using oauth2
GET .../Authorization with the following parameters:
client_id: b81cc4de-d192-400e-bcb4-09254394c52a
redirect_uri: https://www.mycompany.com/myapplication
Actual request:
GET https://api.profix-it.nl/Authorization?client_id=b81cc4de-d192-400e-bcb4-09254394c52a&redirect_uri=https%3A%2F%2Fwww.mycompany.com%2Fmyapplication
Actual response:https://www.mycompany.com/myapplication?code=XTzM!IAAAACbPTzQJXwFhM...
The following authorization errors can occur:
The access token is used to authenticate your API requests.
POST ../token with post data:
(Post data should be x-www-form-urlencoded)
{
code: “XTzM!IAAAACbPTzQJXwFhM”,
grant_type: “authorization_code”,
client_id: “b81cc4de-d192-400e-bcb4-09254394c52a”,
client_secret: “n3G7KAhcv8OH”
}
{
access_token: “AAEAAGxWulSxg7ZT-MPQMWOqQmssMzGa…”,
token_type: “Bearer”,
expires_in: 600,
refresh_token: “Gcp7!IAAAABh4eI8DgkxRyGGyHPLLOz3y9Ss…”
}
Add the access token to the authorization header:
Key: authorization
Value: Bearer AAEAAGxWulSxg7ZT-MPQMWOqQmssMzGa…
When your access token expires after 10 minutes, you must use the refresh token to request a new access token. When you request an access token, you can see in the response that the access token is valid for 600 seconds. There are a two things you must note so you can manage these limitations efficiently:
When your access token expires, use the refresh token to obtain a new access token.
POST ../token with post data: (Post data should be x-www-form-urlencoded)
{
refresh_token: “Gcp7!IAAAABh4eI8DgkxRyGGyHPLLOz3y9Ss …”,
grant_type: “refresh_token”,
client_id: “b81cc4de-d192-400e-bcb4-09254394c52a”,
client_secret: “n3G7KAhcv8OH”,
}
{
access_token: “AAEAABIKSw2E5nHI8lhwdM4iEV4RPdxLgThZj…”,
token_type: “Bearer”,
expires_in: 600
refresh_token: “__1P!IAAAACpjBagWscm76YIGMY3526T3dIK…”
}
You now have a new access token that is valid for 10 minutes, and a new refresh token. You can use your new refresh token to receive a new access token. Your old refresh token is no longer valid.
Any accesstoken is valid on all API Url's (so, the tokens can be shared between api.profix-it.nl and api.profix-it.be
The access token is used to authenticate your API requests.
POST ../token with post data:
(Post data should be x-www-form-urlencoded)
{
grant_type: “client_credentials”,
client_id: “b81cc4de-d192-400e-bcb4-09254394c52a”,
client_secret: “n3G7KAhcv8OH”
}
{
access_token: “AAEAAGxWulSxg7ZT-MPQMWOqQmssMzGa…”,
token_type: “Bearer”,
expires_in: 600,
}
The access token is used to authenticate your API requests.
POST ../token with post data:
(Post data should be x-www-form-urlencoded)
{
grant_type: “password”,
client_id: “b81cc4de-d192-400e-bcb4-09254394c52a”,
client_secret: “n3G7KAhcv8OH”
username: “support@profix-it.nl”
password: “my-password”
}
{
access_token: “AAEAAGxWulSxg7ZT-MPQMWOqQmssMzGa…”,
token_type: “Bearer”,
expires_in: 600,
refresh_token: “Gcp7!IAAAABh4eI8DgkxRyGGyHPLLOz3y9Ss…”
}
{
userid: “123”,
RequireChangePassword: true,
}
POST ../token/ChangePassword with post data:
(Post data should be x-www-form-urlencoded)
{
client_id: “b81cc4de-d192-400e-bcb4-09254394c52a”,
client_secret: “n3G7KAhcv8OH”
userid: “123”
password: “old-password”
newpassword: “new-password”
}
{
success: true,
message: “You can now login”
}
{
success: false,
message: “User friendly notification what went wrong”
}
When your access token expires, use the refresh token to obtain a new access token.
POST ../token with post data: (Post data should be x-www-form-urlencoded)
{
refresh_token: “Gcp7!IAAAABh4eI8DgkxRyGGyHPLLOz3y9Ss …”,
grant_type: “refresh_token”,
client_id: “b81cc4de-d192-400e-bcb4-09254394c52a”,
client_secret: “n3G7KAhcv8OH”,
}
{
access_token: “AAEAABIKSw2E5nHI8lhwdM4iEV4RPdxLgThZj…”,
token_type: “Bearer”,
expires_in: 600
refresh_token: “__1P!IAAAACpjBagWscm76YIGMY3526T3dIK…”
}
You now have a new access token that is valid for 10 minutes, and a new refresh token. You can use your new refresh token to receive a new access token. Your old refresh token is no longer valid.
When your access token expires after 10 minutes, you must use the refresh token to request a new access token. When you request an access token, you can see in the response that the access token is valid for 600 seconds. There are a two things you must note so you can manage these limitations efficiently: