up Version >= 1

Deauthorisation

Deauthorisation is the process whereby the client asks the TWeb Public API to immediately expire the Access Token. This process is optional, since the Access Token will expire 30 minutes after it is issued anyway. However for the sake of security it is still recommended that the client deauthorise.

Request

The deauthorisation endpoint depends on the server used by your company to login to TWeb:

T-WEB Server T-WEB Login URL API Endpoint
www https://www.tweb.com.au/v2/ https://publicapi.tweb.com.au/v1/Deauthorise
www2 https://www2.tweb.com.au/v2/ https://publicapi2.tweb.com.au/v1/Deauthorise
gt https://gt.tweb.ttfuel.com/v2/ https://publicapi.gt.tweb.ttfuel.com/v1/Deauthorise
uae https://uae.tweb.ttfuel.com/v2/ https://publicapi.uae.tweb.ttfuel.com/v1/Deauthorise

The endpoint only accepts HTTP POST requests. The following parameter must be submitted with the request:

accessToken

Note that the Access Token may be submitted as a POST parameter or as a HTTP Cookie.

The following POST parameter may optionally be submitted with the request:

targetID

For details regarding the Target ID, please refer to the following article: https://help.tweb.com.au/TWebPublicAPI/en/Authorisation/Execute#heading_request

Request Example

A request that includes the Access Token from the file where it was stored during authorisation:

curl -b cookiejar.txt -skX POST -d "" https://publicapi.tweb.com.au/v1/Deauthorise

A request that includes the Access Token as a POST parameter in the response body:

curl -skX POST -d "accessToken=0123456789ABCDEF0123456789ABCDEF01234567" https://publicapi.tweb.com.au/v1/Deauthorise

Response

The response from the deauthorisation endpoint has the following JSON format:

{
"Data": {
"Items": [],
"Meta": {
"Endpoint": "/v1/Deauthorise",
"Title": "Public API: Deauthorisation"
}
},
"Error": {
"Code": 0,
"Status": "OK"
}
}

The possible Error responses during deauthorisation are:

Error Code Error Name Explanation
0 OK The Deauthorisation was successful.
1 Server Error This issue either does not fit any of the other codes or is due to a bug in the Public API code.
4000 Rate Limit Exceeded This is the second request within a 1 second period.
4002 Account Inactive Account Inactive.
4003 Session Expired Session Expired.
4008 Invalid Access Token The Access Token was not recognised.
4104 Invalid Target ID The Target ID did not conform to the specifications.
4010 Failed To Deauthorise Unable to deauthorise the session.