What is OAuth?
OAuth 2.0 is an industry-standard authorization protocol that allows applications to securely access protected resources without exposing user credentials. In the Hostex API, OAuth credentials are available only to software partners approved by Hostex, enabling their applications to perform API operations on behalf of hosts. This section is the technical reference for those partners.
Who Should Use OAuth?
Hostex API supports two authentication methods:
- Access Token: The standard way to use the Hostex API. Create a Simple Access Token on the Hostex website and send it with every request.
- OAuth 2.0: Only for approved software partners that have been issued a
Client IDandClient Secretby Hostex.
Unless you already hold OAuth credentials issued by Hostex, use an Access Token.
How OAuth Works
This guide assumes you already have a Client ID and Client Secret issued by Hostex. The OAuth process involves several steps to ensure secure access control:
- Authorize Users: The application guides hosts through an authorization flow to grant API access.
- Obtain Access Token: The application exchanges an authorization code or refresh token for an
Access Token, which is used for API requests. - Make API Calls: Use the
Access Tokento interact with Hostex API endpoints. - Manage Tokens: Refresh or revoke tokens as needed to maintain security.
Enabling Host disconnection
If a Host decides to stop using your application, you must fully disconnect them from your application.
To disconnect a Host, you can provide them with a disconnection button within your application. Alternatively, Hosts can disconnect from your application directly within their account settings on the Hostex website .
API Endpoints Overview
Hostex OAuth API includes the following key endpoints:
1. Obtain/Refresh Access Tokens
Endpoint: /oauth/authorizations
Description: Used to obtain a new access token using OAuth 2.0 grant types or refresh an existing token.
2. Delete/Revoke Tokens
Endpoint: /oauth/revoke
Description: Allows clients to revoke an access or refresh token, disconnecting the application from Hostex.
