openapi: 3.2.0
info:
title: Digital - SDK Auth JWT Token API
description: Create a JWT token for Omni SDK or Chat SDK. This API is intended to be used by trusted applications hosted by customers. The token generated by this API will be used by both anonymous and authenticated end users when integrating the customer's client applications with Omni SDK or Chat SDK.
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
servers:
- url: '{protocol}://{server}{basePath}'
description: Open API
variables:
protocol:
enum:
- https
default: https
server:
default: HOST-REGION.api.avayacloud.com
basePath:
default: /api/digital/chat/v1
- url: '{protocol}://{server}:{port}'
description: Internal API
variables:
protocol:
enum:
- http
- https
default: http
server:
default: msg-web-gateway
port:
enum:
- '80'
- '443'
default: '80'
security:
- {}
- BearerAuth: []
AppKey: []
tags:
- name: JWT Token
description: The API provides jwt token used by SDK
paths:
/accounts/{accountId}/tokens:
post:
tags:
- JWT Token
summary: Generate JWT Token
description: 'Generates a JWT Token for use in web based chat API''s.
Tokens will **expire after 15 minutes** and use same api to generate new token.'
operationId: generateDigitalChatToken
parameters:
- 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: ABCDEF
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateJWTToken'
examples:
verified-customer:
$ref: '#/components/examples/GenerateJWTTokenAuth'
unverified-customer:
$ref: '#/components/examples/GenerateJWTTokenNoAuth'
responses:
'201':
description: Token generated
content:
application/json:
schema:
$ref: '#/components/schemas/Token'
examples:
Token Generated Response:
$ref: '#/components/examples/Token'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalServerError'
deprecated: false
components:
examples:
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.
GenerateJWTTokenNoAuth:
value:
integrationId: 0847c56d-30fd-4b75-90be-a4ff8d08bd44
customerId: f44266bc-9133-4aa2-bf17-80374f1195ac
verifiedCustomer: false
customerName: ''
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: integrationId
message: must match "^[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}$"
code: 20006
GenerateJWTTokenAuth:
value:
integrationId: 0847c56d-30fd-4b75-90be-a4ff8d08bd44
customerId: 9104fa6f-cb4a-43ea-8b28-c1ab36832c76
verifiedCustomer: true
customerName: Joe Soap
customerIdentifiers:
emailAddresses:
- john@example.com
phoneNumbers:
- +91 20 4101 8003
ttl: 15
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
Token:
value:
jwtToken: jwt.eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvY2MuYXZheWFjbG91ZC5jb20iLCJzdWIiOiJ1c2VyY2hhdEludGVncmF0aW9uIiwiaW50ZWdyYXRpb25JZCI6IjQ2NTljNWE0LTgwMzItMTFlYy1hOGEzLTAyNDJhYzEyMDA0NSIsImV4cCI6MTY0NTc3MzEzNSwianRpIjoiY2RhZDhhYzQtZDM3Mi00NjRlLWFhMGEtZDcxODdjZDNiNWM2In0.e7-H43WzSxAOuQ0l9ySiTp-nfWVyS_bNjFgqPrv2VtwG1_-UzbC4p6ISvWdEf-dRBZYPmcj8JTX0bB3Afm5bd2oPt4dCyyW__5b20QTLZcoI_1gTAUj8TrwBk_kdOMZnT-YgEcGXJVnzARBN08WQY0rdvqShRARODmZV0QiYXBuLYHTZXevkLWXqXwpvGWdqs4atbhKyZNDFMer9MGwzB_UCnzg8AMsli2biPJQkrklMrh7-x-RP1Rq5SZ77CT4Q1mH5ExhxXwpikz1VUWtirLZHKfRlntQ5UHsJbE31_zHr2dEG-jaVxxxYU5usIAPxiDSbkn4H4Jf6t9gDN6DMxA
ErrorInternalServerError:
description: Internal Server Error
value:
type: https://developers.avayacloud.com/onecloud-ccaas/docs/error-handling#internal-error
title: Internal Server Error
status: 500
detail: An internal server error was encountered.
responses:
Unauthorized:
description: Unauthorized.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorUnauthorized'
BadRequest:
description: Bad Request
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorConstraintViolation'
Forbidden:
description: Forbidden.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorForbidden'
InternalServerError:
description: Internal Server Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
default:
$ref: '#/components/examples/ErrorInternalServerError'
schemas:
Token:
type: object
description: The auth token
required:
- jwtToken
properties:
jwtToken:
type: string
description: The generated JWT token
GenerateJWTToken:
type: object
required:
- integrationId
- customerId
properties:
integrationId:
type: string
description: The unique 36 character id for this specific chat integration
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}$
customerId:
type: string
description: The unique identifier for the end-customer.
minLength: 1
maxLength: 256
verifiedCustomer:
type: boolean
description: Indicates if the end-customer has been verified and the customer name and identifiers can be trusted by the Contact Center. This should be set to false for anonymous end-customers.
default: false
customerName:
type: string
description: The end-customers full name.
maxLength: 70
customerIdentifiers:
$ref: '#/components/schemas/CustomerIdentifiers'
ttl:
type: integer
description: Time to live for the token, in minutes
default: 15
minimum: 15
maximum: 60
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
- 'null'
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
status:
type:
- integer
- 'null'
format: int32
description: 'The HTTP status code generated by the origin server for this occurrence of the problem.
'
minimum: 100
example: 503
exclusiveMaximum: 600
detail:
type:
- string
- 'null'
description: 'A human readable explanation specific to this occurrence of the problem.
'
example: Connection to database timed out
instance:
type:
- string
- 'null'
format: uri
description: 'An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
'
violations:
type:
- array
- 'null'
description: 'A list of violations that occurred as a result of invalid data provided as part of a request.
'
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
CustomerIdentifiers:
type: object
description: Unique identifiers for identifying the end-customer such as phoneNumbers or emailAddresses. Customer identifiers should not be added for anonymous users.
minProperties: 1
maxProperties: 10
additionalProperties:
type: array
description: 'Additional identifiers related to the Customer. The maximum length of an identifer key is 50 characters and must be a valid "name" of a pre-configured identifier in Customer Journey.
'
maxItems: 5
items:
type: string
minLength: 1
maxLength: 256
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
x-explorer-enabled: false
x-samples-languages:
- curl
- node
- java
- javascript
- python
- go