Authentication Method: oAuth 2.0
OAuth 2.0 is an authorization framework based on token authentication that allows access to the API without revealing user credentials by using access tokens.
This method uses the user's credentials (user ID and password) to validate identity and deliver an access token for API usage.
User Credentials
The user ID and password are generated and provided by Gosocket for both test and production environments.
UserName: xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx
Password: xxxxxxxxxxxxxx
To generate oAuth 2.0 type credentials, it is necessary to have a domain user @gosocket.net with an administrator profile.
- Log in to the portal.
- Enter the company settings.
- Select the Apikeys tab: In this tab, existing credentials are displayed, and new credentials can be created.
- To create a new credential, click on the button to Add Apikey and select the authentication method:
After confirming the method, a row will be inserted in the list of credentials.
Token Acquisition
- Sandbox Environment: https://developers-sbx.gosocket.net/oauth2/token
- Production Environment: https://developers.gosocket.net/oauth2/token
Use the POST method and the following parameters:
- Grand Type: client_credentials
- Client_id: UserName of the credentials generated by Gosocket
- Client_secret: Password of the credentials generated by Gosocket
- scope: All
The obtained token is of "Bearer" type.
Example:
{
"access_token": "NAjqd5J2p61Pc6EYX8yKbz1oPnDQFYFY",
"expires_in": 7200,
"token_type": "bearer"
}
API Consumption
To consume the API, it is necessary to use the obtained token and configure the Bearer Token authentication method. The token's validity must be taken into account since a new one must be generated if it expires.
- API with oAuth 2.0 authentication in Sandbox environment: https://developers-sbx.gosocket.net/api/v2/
- API with oAuth 2.0 authentication in Production environment: https://developers.gosocket.net/api/v2/