{ "openapi": "3.0.2", "info": { "x-api-id": "6e7ee34d-e269-4d85-a304-12dd13896e5b", "x-audience": "external-public", "version": "2.0.0", "title": "Adastra Telephony API", "contact": { "name": "OneAdvanced", "url": "https://oneadvanced.com/contact-us", "email": "api@oneadvanced.com" }, "license": { "name": "Commercial License - OneAdvanced", "url": "https://oneadvanced.com" }, "termsOfService": "https://www.oneadvanced.com/advanced-terms-and-conditions/", "description": "API designed for Telephony providers to interact with Adastra.", "x-jentic-source-url": "https://api.swaggerhub.com/apis/AdvancedComputerSoft/adastra-telephony-api/2.0.0/swagger.json" }, "servers": [ { "description": "SwaggerHub API Auto Mocking", "url": "https://virtserver.swaggerhub.com/AdvancedComputerSoft/adastra-telephony-api/2.0.0" } ], "paths": { "/caller-details": { "post": { "tags": [ "Caller Details" ], "summary": "Post caller details", "description": "Post collected caller details along with the destination call handlers phone identifier at the point of transferring the phone call. This will pre-populate the Case Entry screen for the call handler, either with a single patient match or with search criteria. Returns an appropriate response.", "operationId": "postCallerDetails", "requestBody": { "$ref": "#/components/requestBodies/CallerDetailsRequestModel" }, "responses": { "200": { "$ref": "#/components/responses/CallerDetailsResponseModel" }, "400": { "$ref": "#/components/responses/Problem400Response" }, "401": { "$ref": "#/components/responses/Problem401Response" }, "403": { "$ref": "#/components/responses/Problem403Response" }, "415": { "$ref": "#/components/responses/Problem415Response" }, "500": { "$ref": "#/components/responses/Problem500Response" } } } } }, "components": { "schemas": { "CallerDetailsRequestModel": { "type": "object", "required": [ "requestId", "callerPhoneNumber" ], "additionalProperties": false, "properties": { "requestId": { "type": "string", "description": "Request Identifier", "example": "12345" }, "destinationPhoneId": { "type": "string", "minLength": 1, "maxLength": 30, "description": "Identifier for the destination call handlers phone (i.e. DN, Agent ID)", "example": "123" }, "callerPhoneNumber": { "type": "string", "description": "Callers phone number", "minLength": 8, "maxLength": 15, "example": "07824777777" }, "vectorDirectoryNumber": { "type": "string", "description": "Vector Directory Number (VDN) of the call", "minLength": 1, "maxLength": 20, "example": "8547055" }, "isCallerPatient": { "type": "boolean", "description": "Is the caller the patient or are they calling on behalf of someone else", "example": true, "default": false }, "patientDemographics": { "type": "object", "description": "Patient demographics", "properties": { "forename": { "type": "string", "description": "Patient forename", "minLength": 1, "maxLength": 50, "example": "John" }, "surname": { "type": "string", "description": "Patient surname", "minLength": 1, "maxLength": 50, "example": "Smith" }, "dateOfBirth": { "type": "string", "format": "date", "description": "Patient date of birth in yyyy-mm-dd format", "example": "1957-06-15" }, "mobileNumber": { "type": "string", "description": "Patients mobile number", "minLength": 8, "maxLength": 15, "example": "07824777777" }, "sex": { "type": "string", "enum": [ "Female", "Male", "NotKnown", "NotSpecified" ], "description": "Patient sex", "example": "Male", "default": "NotKnown" }, "nationalNumber": { "type": "string", "description": "Patients national number (NHS, CHI, etc)", "minLength": 10, "maxLength": 12, "example": "4857773456" } } }, "homeAddress": { "type": "object", "description": "Patient home address", "properties": { "line1": { "type": "string", "minLength": 1, "maxLength": 100, "description": "First line of address", "example": "First line" }, "line2": { "type": "string", "minLength": 1, "maxLength": 100, "description": "Second line of address", "example": "Second line" }, "line3": { "type": "string", "minLength": 1, "maxLength": 100, "description": "Third line of address", "example": "Third line" }, "town": { "type": "string", "minLength": 1, "maxLength": 60, "description": "Town", "example": "Town" }, "county": { "type": "string", "minLength": 1, "maxLength": 60, "description": "County", "example": "County" }, "postcode": { "type": "string", "minLength": 5, "maxLength": 10, "description": "Postcode", "example": "Postcode" } } } } }, "CallerDetailsResponseModel": { "type": "object", "required": [ "requestId" ], "properties": { "requestId": { "type": "string", "description": "Same requestId passed into the initial request", "example": "12345" } } }, "ProblemDetailsModel": { "description": "Implementation of [RFC7807](https://tools.ietf.org/html/rfc7807) Problem Details object. Content type should always be ```application/problem+json```. Problem type definitions MAY extend the problem details object with additional members", "type": "object", "required": [ "type", "title", "status" ], "additionalProperties": false, "properties": { "type": { "type": "string", "format": "uri", "description": "A type URI", "example": "https://oneadvanced.com/problem/400" }, "title": { "type": "string", "description": "A short, human-readable summary of the problem type", "example": "Bad Request" }, "status": { "type": "integer", "format": "int32", "description": "The HTTP status code for this occurrence of the problem", "example": 400 }, "detail": { "type": "string", "description": "A human-readable explanation specific to this occurrence of the problem", "example": "The request is invalid." }, "issues": { "type": "array", "description": "A list of issues that exist with the request. Note this is an extension that is supported by the RFC but specific to Advanced.", "items": { "type": "object", "properties": { "fieldName": { "type": "string" }, "error": { "type": "string" } } }, "example": [ { "fieldName": "fieldName", "error": "This is the problem with the field" }, { "fieldName": "fieldOther", "error": "This is the problem with the field" } ] }, "instance": { "type": "string", "description": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced", "example": "https://oneadvanced.com/support/problem/74837463" } } } }, "requestBodies": { "CallerDetailsRequestModel": { "description": "Schema for caller request", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CallerDetailsRequestModel" } } } } }, "responses": { "CallerDetailsResponseModel": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CallerDetailsResponseModel" } } } }, "Problem400Response": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetailsModel" }, "example": { "type": "https://oneadvanced.com/problem/400", "title": "Bad Request", "status": 400, "detail": "The request is invalid.", "issues": [ { "fieldName": "fieldName", "error": "This is the problem with the field" }, { "fieldName": "fieldOther", "error": "This is the problem with the field" } ] } } } }, "Problem401Response": { "description": "Unauthorized", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetailsModel" }, "example": { "type": "https://oneadvanced.com/problem/401", "title": "Unauthorized", "status": 401 } } } }, "Problem403Response": { "description": "Forbidden", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetailsModel" }, "example": { "type": "https://oneadvanced.com/problem/403", "title": "Forbidden", "status": 403 } } } }, "Problem415Response": { "description": "Unsupported Media Type", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetailsModel" }, "example": { "type": "https://oneadvanced.com/problem/415", "title": "Unsupported Media Type", "status": 415, "detail": "The request could not be completed due to the request body being formed of an unsupported media type. Only application/json is accepted by this API." } } } }, "Problem500Response": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetailsModel" }, "example": { "type": "https://oneadvanced.com/problem/500", "title": "An internal error occurred.", "status": 500, "detail": "The server is unable to process the request." } } } } }, "securitySchemes": { "oAuth": { "type": "oauth2", "description": "Endpoints using OAuth 2 with the Client Credentials flow.", "flows": { "clientCredentials": { "tokenUrl": "https://identity.oneadvanced.com/auth/realm/protocol/openid-connect/token", "scopes": {} } } } } }, "security": [ { "oAuth": [] } ], "tags": [ { "name": "Caller Details", "description": "Caller details collected via telephony system" } ] }