openapi: 3.0.2
x-explorer-enabled: false
x-samples-languages:
- curl
- node
- java
- javascript
- python
- go
info:
title: Notification
description: The Notification API is used to manage subscriptions for the real-time notification of Analytics and Agent
& Engagement events.
contact:
name: Avaya API Team
url: https://developers.avayacloud.com/onecloud-ccaas
email: apiteam@avaya.com
license:
name: Avaya Software Development Kit (SDK) Software License Terms
url: http://support.avaya.com/css/P8/documents/101038288
version: 1.0.1
tags:
- name: Subscriptions
description: 'Subscriptions can be created to register for streams of real-time event notifications.
'
security:
- {}
- BearerAuth: []
AppKey: []
servers:
- url: '{protocol}://{server}{basePath}'
description: Open API
variables:
protocol:
enum:
- https
default: https
server:
default: HOST-REGION.api.avayacloud.com
basePath:
default: /api/notification/v1
- url: '{protocol}://{server}:{port}'
description: Internal API
variables:
protocol:
enum:
- http
- https
default: http
server:
default: ix-notification-service
port:
enum:
- '80'
- '443'
default: '80'
paths:
/accounts/{accountId}/subscriptions:
parameters:
- $ref: '#/components/parameters/accountId'
post:
tags:
- Subscriptions
summary: Create Subscription
description: Create a new subscription for notification events
operationId: createSubscription
requestBody:
description: Create a new Subscription
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSubscription'
examples:
Create Agent & Engagement WebSocket Subscription:
$ref: '#/components/examples/CreateAgentAndEngagementWebsocketSubscription'
Create Agent & Engagement Webhook Subscription:
$ref: '#/components/examples/CreateAgentAndEngagementWebhookSubscription'
Create Analytics WebSocket Subscription:
$ref: '#/components/examples/CreateAnalyticsWebSocketSubscription'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
examples:
Agent & Engagement WebSocket Subscription Response:
$ref: '#/components/examples/AgentAndEngagementWebsocketSubscriptionResponse'
Agent & Engagement Webhook Subscription Response:
$ref: '#/components/examples/AgentAndEngagementWebhookSubscriptionResponse'
Analytics WebSocket Subscription Response:
$ref: '#/components/examples/AnalyticsWebSocketSubscriptionResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalServer'
deprecated: false
get:
tags:
- Subscriptions
summary: List Subscriptions
description: Return a list of existing notification subscriptions
operationId: listSubscriptions
parameters:
- name: pageNumber
in: query
description: The page number of the records to retrieve. Default value is 1
required: false
schema:
type: integer
format: int32
example: 1
default: 1
minimum: 1
- name: pageSize
in: query
description: The max number of records to retrieve per page. Default value is 10, max value is 25.
required: false
schema:
type: integer
format: int32
example: 10
default: 10
minimum: 1
maximum: 25
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionPage'
examples:
default:
$ref: '#/components/examples/SubscriptionPage'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalServer'
deprecated: false
/accounts/{accountId}/subscriptions/{subscriptionId}:
parameters:
- $ref: '#/components/parameters/accountId'
- $ref: '#/components/parameters/subscriptionId'
get:
tags:
- Subscriptions
summary: Get Subscription
description: Returns a single notification subscription by it's subscriptionId
operationId: getSubscription
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
examples:
default:
$ref: '#/components/examples/AgentAndEngagementWebsocketSubscriptionResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServer'
deprecated: false
delete:
tags:
- Subscriptions
summary: Delete Subscription
description: Delete an existing subscription by subscriptionId
operationId: deleteSubscription
responses:
'204':
description: No Content
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServer'
deprecated: false
/accounts/{accountId}/subscriptions/{subscriptionId}:renew:
parameters:
- $ref: '#/components/parameters/accountId'
- $ref: '#/components/parameters/subscriptionId'
post:
tags:
- Subscriptions
summary: Renew Subscription
description: 'Renew an existing subscription by subscriptionId before it has expired. A subscription can be kept ACTIVE
indefinitely or this can be leveraged to change an INACTIVE subscription back to ACTIVE. The subscription expiration
is tied to the access token used to create it. You must renew the subscription via this API before the expiresIn time
has passed, otherwise the subscription will be set to INACTIVE.
For a ''WEBHOOK'' subscription, the authToken can also be updated at this time in case the token you verify has expired.'
operationId: renewSubscription
requestBody:
description: Renew an existing subscription and update the authToken
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/RenewSubscription'
examples:
Renew Susbscription & Update authToken:
$ref: '#/components/examples/RenewSubscriptionAndAuthToken'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
examples:
default:
$ref: '#/components/examples/AgentAndEngagementWebhookSubscriptionResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServer'
deprecated: false
components:
parameters:
accountId:
name: accountId
description: The unique 6 character internal id that represents the customer account.
required: true
in: path
schema:
type: string
minLength: 6
maxLength: 6
pattern: ^[a-zA-Z]{6}$
example: ZWJJIQ
subscriptionId:
name: subscriptionId
description: The unique 36 character internal id that represents the subscription.
required: true
in: path
schema:
type: string
minLength: 36
maxLength: 36
pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$
example: fdbec917-e76e-4645-8120-4eac46f29487
responses:
BadRequest:
description: Constraint Violation
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorConstraintViolation'
Unauthorized:
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorUnauthorized'
Forbidden:
description: Forbidden
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorForbidden'
NotFound:
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorNotFound'
InternalServer:
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorInternalServerError'
schemas:
CreateSubscription:
type: object
description: Request payload for creating a subscription
required:
- family
- events
- transport
properties:
family:
$ref: '#/components/schemas/Family'
events:
type: array
minItems: 1
maxItems: 25
description: The collection of events to filter on within the chosen family. To receive all events associated with
a family then specify 'ALL' here. Event types vary depending on family selected, see developers guide for more
details on the events for each family.
example:
- ALL
items:
type: string
minLength: 1
maxLength: 256
transport:
$ref: '#/components/schemas/Transport'
extensions:
type: object
description: Additional extensions based on the family of the subscription. So families may have both manadatory
and optional extensions. See the developers guide for more details on the extensions avaialble for each family.
minProperties: 0
maxProperties: 50
additionalProperties:
type: string
maxLength: 256
SubscriptionResponse:
type: object
description: Request payload for creating a subscription
required:
- family
- events
- transport
properties:
family:
$ref: '#/components/schemas/Family'
events:
type: array
minItems: 1
maxItems: 25
description: The collection of events to filter on within the chosen family. To receive all events associated with
a family then specify 'ALL' here. Event types vary depending on family selected, see developers guide for more
details on the events for each family.
example:
- ALL
items:
type: string
minLength: 1
maxLength: 256
transport:
$ref: '#/components/schemas/TransportResponse'
extensions:
type: object
description: Additional extensions based on the family of the subscription. So families may have both manadatory
and optional extensions. See the developers guide for more details on the extensions avaialble for each family.
minProperties: 0
maxProperties: 50
additionalProperties:
type: string
maxLength: 256
RenewSubscription:
type: object
description: Request payload for renewing a subscription
required:
- transport
properties:
transport:
$ref: '#/components/schemas/RenewTransport'
Family:
type: string
maxLength: 256
description: The family of events the subscription applies to
enum:
- AGENT_ENGAGEMENT
- ANALYTICS
Transport:
type: object
description: Transport settings for the subscription.
required:
- type
properties:
type:
type: string
description: The transport type for which notifications should be received.
enum:
- WEBHOOK
- WEBSOCKET
default: WEBSOCKET
endpoint:
type: string
maxLength: 2048
description: The endpoint (URL) for the subscription. *Required* for 'WEBHOOK' subscription. Leave this field blank
for 'WEBSOCKET' and the URL will be generated for you to connect upon successful creation of subscription.
authToken:
type: string
minLength: 0
maxLength: 256
description: Optional authentication token for verification of an incoming 'WEBHOOK'. Must be used in conjunction
with the authTokenHeader field in order for the server to provide this in a 'WEBHOOK'.
authTokenHeader:
type: string
minLength: 0
maxLength: 256
description: Optional authentication token header name. Must be used in conjunction with the authToken field in
order for the server to provide this in a 'WEBHOOK'.
default: auth-token
TransportResponse:
type: object
description: Transport settings for the subscription.
required:
- type
properties:
type:
type: string
description: The transport type for which notifications should be received.
enum:
- WEBHOOK
- WEBSOCKET
default: WEBSOCKET
endpoint:
type: string
maxLength: 2048
description: The endpoint (URL) for the subscription. *Required* for 'WEBHOOK' subscription. Leave this field blank
for 'WEBSOCKET' and the URL will be generated for you to connect upon successful creation of subscription.
authToken:
type: string
minLength: 0
maxLength: 256
description: Optional authentication token for verification of an incoming 'WEBHOOK'. Must be used in conjunction
with the authTokenHeader field in order for the server to provide this in a 'WEBHOOK'.
authTokenHeader:
type: string
minLength: 0
maxLength: 256
description: Optional authentication token header name. Must be used in conjunction with the authToken field in
order for the server to provide this in a 'WEBHOOK'.
default: auth-token
pingInterval:
type: integer
format: int32
default: 300
description: 'The maximum interval (seconds) at which a ping is expected to be sent by the client before websocket
is closed and subscription set to INACTIVE.
It is recommended the client send ping more frequently (every 30 seconds) to preclude any proxies from closing
the connection.
'
RenewTransport:
type: object
description: Transport settings for the subscription renew.
required:
- authToken
properties:
authToken:
type: string
minLength: 0
maxLength: 256
description: Optional authentication token for verification of an incoming 'WEBHOOK'. Must be used in conjunction
with the authTokenHeader field in order for the server to provide this in a 'WEBHOOK'.
Subscription:
allOf:
- type: object
description: Subscription details of a successful response
properties:
subscriptionId:
type: string
minLength: 36
maxLength: 36
pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$
description: The unique 36 character internal id that represents the subscription.
example: fdbec917-e76e-4645-8120-4eac46f29487
createdAt:
type: string
description: The datetime in ISO 8601 format that the subscription was created.
format: date-time
example: '2020-08-01T14:25:23.162Z'
expiresAt:
type: string
description: The datetime in ISO 8601 format that the subscription expires at.
format: date-time
example: '2020-08-08T14:25:23.177Z'
expiresIn:
type: integer
description: The number of seconds remaining before the subscription expires.
format: int64
example: 900
status:
type: string
enum:
- ACTIVE
- INACTIVE
- PENDING
minLength: 1
maxLength: 256
readOnly: true
description: Indicator for the status of the subscription whether ACTIVE, INACTIVE or PENDING.
example: ACTIVE
- $ref: '#/components/schemas/SubscriptionResponse'
SubscriptionPage:
type: object
description: A page containing the current list of subscriptions with links to the previous and next pages.
properties:
pagination:
$ref: '#/components/schemas/Pagination'
subscriptions:
type: array
items:
$ref: '#/components/schemas/Subscription'
links:
$ref: '#/components/schemas/Links'
Problem:
type: object
description: 'Problem Detail as a way to carry machine-readable details of errors in a HTTP response to avoid
the need to define new error response formats for HTTP APIs RFC 7807
'
properties:
type:
type: string
format: uri
description: 'An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable
documentation for the problem type (e.g., using HTML).
'
default: about:blank
example: https://developers.avayacloud.com/onecloud-ccaas/docs/error-handling#constraint-violation
title:
type: string
description: 'A short, summary of the problem type. Written in english and readable for engineers (usually not suited
for non technical stakeholders and not localized).
'
example: Service Unavailable
nullable: true
status:
type: integer
format: int32
description: 'The HTTP status code generated by the origin server for this occurrence of the problem.
'
minimum: 100
maximum: 600
exclusiveMaximum: true
example: 503
nullable: true
detail:
type: string
description: 'A human readable explanation specific to this occurrence of the problem.
'
example: Connection to database timed out
nullable: true
instance:
type: string
format: uri
description: 'An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further
information if dereferenced.
'
nullable: true
violations:
type: array
description: 'A list of violations that occurred as a result of invalid data provided as part of a request.
'
nullable: true
items:
type: object
properties:
field:
type: string
description: 'The name of the field in the request that caused the violation. This can be the name of a path
parameter, query parameter, or a field within the request body.
'
example: accountId
message:
type: string
description: 'A human readable explanation specific to this occurrence of the violation.
'
example: must match "^[a-zA-Z]{6}$"
code:
type: integer
format: int32
description: 'The violation code generated by the server for this occurrence of the violation. Use this code
when implementing any error handling logic instead of the message, as the message can change.
'
example: 20006
example:
- field: emailAddress
message: must not be null
code: 20002
- field: accountId
message: must match "^[a-zA-Z]{6}$"
code: 20006
Pagination:
type: object
properties:
pageNumber:
type: integer
format: int32
description: The current page number.
pageSize:
type: integer
format: int32
description: The max number of records that can be retrieved on this page.
total:
type: integer
format: int32
description: The total number of records.
Links:
type: object
properties:
prev:
type: string
description: URL of the previous page. Blank if currently on the first page.
next:
type: string
description: URL of the next page. Blank if currently on the last page.
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: This API uses Bearer Token Authorization Flow
bearerFormat: JWT
AppKey:
type: apiKey
in: header
name: appkey
description: This API needs an appKey as header
examples:
CreateAgentAndEngagementWebsocketSubscription:
description: Create Agent & Engagement Websocket Subscription
value:
family: AGENT_ENGAGEMENT
events:
- ALL
transport:
type: WEBSOCKET
AgentAndEngagementWebsocketSubscriptionResponse:
description: Subscription Response
value:
subscriptionId: fdbec917-e76e-4645-8120-4eac46f29488
createdAt: '2020-08-01T14:25:23.162Z'
expiresAt: '2020-08-08T14:25:23.177Z'
expiresIn: 900
status: ACTIVE
family: AGENT_ENGAGEMENT
events:
- ALL
transport:
type: WEBSOCKET
endpoint: wss://uk.cc.avayacloud.com/ws/notification/v1/agent-engagement/ZWJJIQ/fdbec917-e76e-4645-8120-4eac46f29488
pingInterval: 300
CreateAgentAndEngagementWebhookSubscription:
description: Create Agent & Engagement Webhook Subscription
value:
family: AGENT_ENGAGEMENT
events:
- AgentParticipant
- InboundEngagementCreated
transport:
type: WEBHOOK
endpoint: https://webhook.site/ccc61bd0-a607-4ba0-b891-a9d7484d6196
authToken: eyJ0eXAiOiJKV1QiLCJub25jZSI6Ildp...
authTokenHeader: my-custom-header
RenewSubscriptionAndAuthToken:
description: Renew Subscription and authToken
value:
transport:
authToken: eyJ0eXAiOiJKV1QiLCJub25jZSI6Ildp...
AgentAndEngagementWebhookSubscriptionResponse:
description: Subscription Response
value:
subscriptionId: fdbec917-e76e-4645-8120-4eac46f29487
createdAt: '2020-08-01T14:25:23.162Z'
expiresAt: '2020-08-08T14:25:23.177Z'
expiresIn: 900
status: ACTIVE
family: AGENT_ENGAGEMENT
events:
- AgentParticipant
- InboundEngagementCreated
transport:
type: WEBHOOK
endpoint: https://webhook.site/fdbec917-e76e-4645-8120-4eac46f29487
authToken: eyJ0eXAiOiJKV1QiLCJub25jZSI6Ildp...
authTokenHeader: my-custom-header
CreateAnalyticsWebSocketSubscription:
description: Create Analytics WebSocket Subscription
value:
family: ANALYTICS
events:
- ALL
transport:
type: WEBSOCKET
extensions:
measureProducerId: Agent_ITD_1.0.0
AnalyticsWebSocketSubscriptionResponse:
description: Subscription Response
value:
subscriptionId: fdbec917-e76e-4645-8120-4eac46f29489
createdAt: '2020-08-01T14:25:23.162Z'
expiresAt: '2020-08-08T14:25:23.177Z'
expiresIn: 900
status: ACTIVE
family: ANALYTICS
events:
- ALL
transport:
type: WEBSOCKET
endpoint: wss://uk.cc.avayacloud.com/ws/notification/v1/analytics/realtime
pingInterval: 300
extensions:
measureProducerId: Agent_ITD_1.0.0
SubscriptionPage:
value:
pagination:
pageNumber: 2
pageSize: 20
total: 60
subscriptions:
- subscriptionId: fdbec917-e76e-4645-8120-4eac46f29487
createdAt: '2020-08-01T14:25:23.162Z'
expiresAt: '2020-08-08T14:25:23.177Z'
expiresIn: 900
status: ACTIVE
family: AGENT_ENGAGEMENT
events:
- ALL
transport:
type: WEBHOOK
endpoint: https://webhook.site/ccc61bd0-a607-4ba0-b891-a9d7484d6196
authToken: eyJ0eXAiOiJKV1QiLCJub25jZSI6Ildp...
authTokenHeader: my-custom-header
links:
prev: /api/notification/v1/accounts/JDBUTC/subscriptions?pageNumber=1&pageSize=20
next: /api/notification/v1/accounts/JDBUTC/subscriptions?pageNumber=3&pageSize=20
ErrorConstraintViolation:
description: Constraint Violation
value:
type: https://developers.avayacloud.com/onecloud-ccaas/docs/error-handling#constraint-violation
title: Constraint Violation
status: 400
detail: A problem that indicates a syntactically correct, yet semantically illegal request. The Server can not process
this request until the client resolves the semantic errors described in the violations section.
violations:
- field: family
message: must not be null
ErrorUnauthorized:
description: Unauthorized
value:
type: https://developers.avayacloud.com/onecloud-ccaas/docs/error-handling#unauthorized
title: Unauthorized
status: 401
detail: This operation requires authentication. See https://developers.avayacloud.com/onecloud-ccaas/docs/how-to-authenticate-with-ccaas-apis
ErrorForbidden:
description: Forbidden
value:
type: https://developers.avayacloud.com/onecloud-ccaas/docs/error-handling#forbidden
title: Forbidden
status: 403
detail: According to the access control policy the current user and/or accountId does not have permission to access
this resource.
ErrorNotFound:
description: Not Found
value:
type: https://developers.avayacloud.com/onecloud-ccaas/docs/error-handling#resource-not-found
title: Resource Not Found
status: 404
detail: Resource not found.
ErrorInternalServerError:
description: Server Error
value:
type: https://developers.avayacloud.com/onecloud-ccaas/docs/error-handling#server-error
title: Server Error
status: 500
detail: An internal server error was encountered.