Generating authentication code for Click-to-Call
This API generates a short-lived authentication code for click-to-call functionality. For more information on the authentication code, see Authenticate using authentication code.
Endpoint
POST /api/v1/sipConnections/{sipConnectionId}/generateAuthenticationCode
Path parameters
|
Path parameter |
Type |
Description |
|---|---|---|
|
sipConnectionId |
string |
The ID of the Click-to-Call SIP connection |
Request headers
Authorization: Bearer {token}
Query parameters
None
Request body
|
Field |
Type |
Description |
|---|---|---|
|
callerPhone (optional) |
string |
If provided, it is used to assert the identity of the caller. The value must be in E.164 format. The field is optional. If not provided, the caller phone number is not validated. |
Response body
The response body is a JSON object with the following fields.
|
Field |
Type |
Description |
|---|---|---|
|
authenticationCode |
string |
The generated authentication code. Valid for 1 minute and can only be used once. |
Request example
POST /api/v1/sipConnections/f399069f-e84f-41e4-ac71-fab2ded73f1c/generateAuthenticationCode HTTP/1.1
Host: livehub.audiocodes.io
Authorization: Bearer ui9SvgRDw4mdbwLHEPJuMHX6qjkvK…
Content-Type: application/json
{
"callerPhone": "+123456789"
}
Response example
HTTP/1.1 200 OK
Content-Type: application/json
{
"authenticationCode": "LHv1_8e22ba993a094a85af5b3d9fd2c87f2a"
}
Response codes
-
200: Successful response, which contains the generated token.
-
400: Returned if the request is invalid.
-
401: Returned if the provided access token is invalid or expired.
-
404: Returned if the specified SIP connection does not exist.
Notes:
-
The generated authentication code is valid for 1 minute and can only be used once.
-
Call this endpoint from your backend application, not directly from the client-side code.
-
Ensure that your Live Hub access token is kept secure and not exposed to client-side applications.