One of the benefits of setting up “paired account” is that Partner’s user can click on a single link or button from partner system, and login to Teapplix web application without entering username + password. This is achieved using the PSObtainToken API call and upon success, going to a specific “LaunchURL” afterwards.
PSObtainToken
From partner system, you will call this API to obtain the parameters needed to open a Teapplix application without login. This application should normally be opened in a separate browser tab:
Open browser tab to Launch URL, Launch URL is like this: https://app.teapplix.com/h/[ClientVHOST]/te/lo.cgi?Action=Launch&pt=[AccessToken]&ts=[unixtimestamp]&signature=[signedstringvalue]
ClientVHOST - is returned in PSObtainToken response
Check next section for samples how to calculate signature=signedstringvalue
Note, that issued temporary access token will expire in 30 minutes, if not used
Please, not that this method is protected and you need to specify APIToken HTTP-header in request, as well as for any other protected API method.
ClientID known to partner systems. Must uniquely identify a partner account and not duplicate in the partner customer base
GET Response - 200
Obtain access token result
Property
Type
Description
Constraints
AccessToken
string
Access Token needed to launch UI for a specific paired client account
Required
ClientVHOST
string
This is the Teapplix Account Name for the paired account
Required
ExpireTimeStamp
string
Specifies date time in ISO8601 format, after which access token will expire
Required
GET Response - 400
Message
Property
Type
Description
Constraints
Success
boolean
Always false on this envelope. Message is the error envelope (4xx/5xx); Success is kept on the wire so legacy clients can branch on it without parsing the HTTP status.
Required
Code
integer
Indicate error code. Codes list and description are located on help page https://www.teapplix.com/help/?page_id=7115
Message
string
Message typically associated with errors
Description
string[]
Detailed description
GET Response - 401
Message
Property
Type
Description
Constraints
Success
boolean
Always false on this envelope. Message is the error envelope (4xx/5xx); Success is kept on the wire so legacy clients can branch on it without parsing the HTTP status.
Required
Code
integer
Indicate error code. Codes list and description are located on help page https://www.teapplix.com/help/?page_id=7115
Message
string
Message typically associated with errors
Description
string[]
Detailed description
GET Response - 500
Message
Property
Type
Description
Constraints
Success
boolean
Always false on this envelope. Message is the error envelope (4xx/5xx); Success is kept on the wire so legacy clients can branch on it without parsing the HTTP status.
Required
Code
integer
Indicate error code. Codes list and description are located on help page https://www.teapplix.com/help/?page_id=7115
Message
string
Message typically associated with errors
Description
string[]
Detailed description
Launch URL
Launch URL is used as start point for UI for Partner’s customer to go to Teapplix web applicatin.
This URL makes authentication, so that there is not need to enter login/password values and user can “jump” directly to his UI.
This value is returned from PSObtainToken, it indicate the matching Teapplix Account Name.
pt=AccessToken
Result of ObtainAccessToken API method call
ts=unixtimestamp
unixtimestamp is integer value of UNIX epoch, for example: 1483257600
signature=signedstringvalue
Signature Key
Signature key is based on Partner. Typically, we use the “Token” from Partner’s system, entered to a specific Teapplix account to allow Teapplix account to access Partner system, as the Signature Key. Signature Key is not passed as a parameter to the Teapplix API call, nor is it passed as part of the LaunchURL. However, it is internally used to compute and validate the LaunchURL.
Signature
Signature is parameter which is sent in “launch URL”. It should be calculated based on next scheme:
hmac(sha256(uri), Signature Key).asHexValue().
“URI” is full uri with options (for example: /h/demo2/te/lo.cgi?Action=Launch&pt=AccessToken&ts=unixtimestamp)
After signature was calculated, result value should be added to uri and result URI is address which user’s browser should be redirected to.