PentaConnect Authorization

PentaConnect uses an Oauth2 framework for authorization. All requests to PentaConnect APIs require an access token obtained from Penta’s Oauth2 server to be supplied as a request header of the form Authorization: Bearer <accessToken>.

Acquiring a Token

PentaConnect requires an OAuth2 bearer token in the request header to authenticate.

This token can be acquired by sending a request to the following endpoint:

https://auth.penta.com/Token

The body of the request should include the following JSON:

{ "ClientName": "{client_name}", "ClientSecret": "{client_secret}" }

The client name and client secret are supplied to the user/client by Penta. This information helps determine the client’s access to Penta’s APIs.

Tokens are valid for 60 minutes.

Making a Request

When making a request to PentaConnect, the token that was acquired must be specified in the request’s Authentication header as a bearer token.

In addition, a Penta User ID must be included in the request header. The header key for this is “PentaUserId”.

Two examples are as follows:

cURL:

curl --location --request GET 'https://api.penta.com/PentaConnectap/22.10/PurchaseOrders' \ --header 'PentaUserId: ASB' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImFkbWluIiwiUGVudGFDb25uZWN0QVBWZXJzaW9uIjoiMjIuMTEiLCJQZW50YUNvbm5lY3RSZWRpcmVjdFVyaSI6Imh0dHBzOi8vd2ViYXBwcy5wZW50YS5jb20vcGVudGFjb25uZWN0LW5kbWMyNTEvcGVudGFjb25uZWN0IiwiUm9sZSI6ImFkbWluIiwiUGVudGFDb25uZWN0VGhyb3R0bGVJZCI6IkMiLCJuYmYiOjE2Njc5MTczNjEsImV4cCI6MTY2NzkyMDk2MSwiaWF0IjoxNjY3OTE3MzYxfQ.gRBKR2WnK_OwZLUTSpnM7yhzkHWAg1sLZYLQIpAWF8Y'

 

HTTP:

GET /PentaConnectap/22.10/PurchaseOrders Host: https://api.penta.com PentaUserId: ASB Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImFkbWluIiwiUGVudGFDb25uZWN0QVBWZXJzaW9uIjoiMjIuMTEiLCJQZW50YUNvbm5lY3RSZWRpcmVjdFVyaSI6Imh0dHBzOi8vd2ViYXBwcy5wZW50YS5jb20vcGVudGFjb25uZWN0LW5kbWMyNTEvcGVudGFjb25uZWN0IiwiUm9sZSI6ImFkbWluIiwiUGVudGFDb25uZWN0VGhyb3R0bGVJZCI6IkMiLCJuYmYiOjE2Njc5MTczNjEsImV4cCI6MTY2NzkyMDk2MSwiaWF0IjoxNjY3OTE3MzYxfQ.gRBKR2WnK_OwZLUTSpnM7yhzkHWAg1sLZYLQIpAWF8Y