Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion api/signalwire-rest/fabric-api/_spec_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,24 @@ components:
message: Ciphers are invalid
attribute: ciphers
url: https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#invalid_parameter
EmbedsTokensRequest:
type: object
required:
- token
properties:
token:
type: string
example: c2c_7acc0e5e968706a032983cd80cdca219
description: Click to Call Token
EmbedsTokensResponse:
type: object
required:
- token
properties:
token:
type: string
example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMubHZoLm1lIiwidHlwIjoiU0FUIn0..
description: Encrypted guest token.
EncryptionType:
type: string
enum:
Expand Down Expand Up @@ -3877,6 +3895,7 @@ tags:
- name: "AI Agents: Dialogflow"
- name: Call Flows
- name: cXML Application
- name: Embeds Tokens
- name: External LAML Handler
- name: External SWML Handler
- name: Fabric Address
Expand All @@ -3893,7 +3912,51 @@ tags:
- name: SWML Scripts
- name: Conference Rooms
paths:

/embeds/tokens:
servers:
- url: https://embeds.signalwire.com/api/fabric
post:
operationId: EmbedsTokens_create
summary: Create Embeds Tokens
description: Exchanges a public Click-to-Call (C2C) token for a short-lived, private embed guest token used to authorize a call. This allows secure activation of the C2C widget without exposing sensitive credentials.
parameters: []
responses:
'201':
description: The request has succeeded and a new resource has been created as a result.
content:
application/json:
schema:
$ref: '#/components/schemas/EmbedsTokensResponse'
'401':
description: Access is unauthorized.
content:
application/json:
schema:
anyOf:
- type: string
enum:
- Unauthorized
- type: string
enum:
- Forbidden
'404':
description: The server cannot find the requested resource.
content:
application/json:
schema:
type: string
enum:
- Not Found
tags:
- Embeds Tokens
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EmbedsTokensRequest'
security:
- {}
/guests/tokens:
post:
operationId: GuestTokens_create
Expand Down
27 changes: 27 additions & 0 deletions api/signalwire-rest/fabric-api/embeds-tokens/main.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Import necessary modules or types
import "@typespec/http";
import "./models/requests.tsp";
import "./models/responses.tsp";
import "./models/errors.tsp";

using TypeSpec.Http;
using Types.StatusCodes;

@server("https://embeds.signalwire.com/api/fabric/", "Endpoint")
// Define the API path for embeds
@useAuth({ type: Http.AuthType.noAuth })
@route("/embeds/tokens")
namespace FabricAPI.EmbedsTokens {
@tag("Embeds Tokens")
@friendlyName("Embeds Tokens")
interface EmbedsTokens {
@summary("Create Embeds Tokens")
@doc("Exchanges a public Click-to-Call (C2C) token for a short-lived, private embed guest token used to authorize a call. This allows secure activation of the C2C widget without exposing sensitive credentials.")
@post
create(@body body: EmbedsTokensRequest):
{ @statusCode statusCode: 201; @body subscriber: EmbedsTokensResponse; } |
StatusCode401 |
StatusCode404 |
StatusCode403;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import "../../../types/status-codes";

using Types.StatusCodes;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import "@typespec/http";

using TypeSpec.Http;

model EmbedsTokensRequest {
@doc("Click to Call Token")
@example("c2c_7acc0e5e968706a032983cd80cdca219")
token: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
model EmbedsTokensResponse {
@doc("Encrypted guest token.")
@example("eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMubHZoLm1lIiwidHlwIjoiU0FUIn0..")
token: string;
}
1 change: 1 addition & 0 deletions api/signalwire-rest/fabric-api/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "./ai-agent";
import "./ai-agent-addresses";
import "./cxml-application";
import "./cxml-application-addresses";
import "./embeds-tokens";


using TypeSpec.Http;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tags:
- name: 'AI Agents: Custom'
- name: AI Agent
- name: cXML Application
- name: Embeds Tokens
paths:
/addresses:
get:
Expand Down Expand Up @@ -85,6 +86,49 @@ paths:
- Fabric Address
security:
- BearerAuth: []
/embeds/tokens:
post:
operationId: EmbedsTokens_create
summary: Create Embeds Tokens
description: Exchanges a public Click-to-Call (C2C) token for a short-lived, private embed guest token used to authorize a call. This allows secure activation of the C2C widget without exposing sensitive credentials.
parameters: []
responses:
'201':
description: The request has succeeded and a new resource has been created as a result.
content:
application/json:
schema:
$ref: '#/components/schemas/EmbedsTokensResponse'
'401':
description: Access is unauthorized.
content:
application/json:
schema:
anyOf:
- type: string
enum:
- Unauthorized
- type: string
enum:
- Forbidden
'404':
description: The server cannot find the requested resource.
content:
application/json:
schema:
type: string
enum:
- Not Found
tags:
- Embeds Tokens
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EmbedsTokensRequest'
security:
- {}
/guests/tokens:
post:
operationId: GuestTokens_create
Expand Down Expand Up @@ -2849,6 +2893,24 @@ components:
- call
- subscriber
description: DisplayTypes
EmbedsTokensRequest:
type: object
required:
- token
properties:
token:
type: string
description: Click to Call Token
example: c2c_7acc0e5e968706a032983cd80cdca219
EmbedsTokensResponse:
type: object
required:
- token
properties:
token:
type: string
description: Encrypted guest token.
example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiY2giOiJwdWMubHZoLm1lIiwidHlwIjoiU0FUIn0..
EncryptionType:
type: string
enum:
Expand Down
6 changes: 6 additions & 0 deletions api/signalwire-rest/types/status-codes/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ namespace Types.StatusCodes {
}
}

@error
model StatusCode403 {
@statusCode statusCode: 401;
@bodyRoot error: "Forbidden"
}

This file was deleted.

This file was deleted.

Loading