Use the TytoCare REST APIs

This section describes the TytoCare integration APIs and their error scenarios. Each API section lists the HTTP error codes possible for each specific API as well as the sample log message for the scenario.

Station APIs

Create station

POST - https://{portal-FQDN}/api/extintegration/tyto/v1/stations/

Possible error messages

  • HTTP 409 - Station Already Exists

Corresponding user-app.log messages:

2019-02-14 23:22:06,413 ERROR [catalina-exec-72](com.vidyo.services.TytoRemoteAPIService.performCommunication:353) - Received an error from tyto services:
, URI: https://app-stage1.tytocare.com/api/v1/integration/stations
, method: POST
, requestBody: StationSaveRequest{identifier='AFSGHD37474bggdgd', description='description'}
, received response status: , http code: 409
, responseBody: {
"code" : "ERROR_STATION_ALREADY_EXISTS"
}
2019-02-14 23:22:06,413 ERROR [catalina-exec-72](com.vidyo.rest.controllers.tyto.TytoErrorHandlerController.handleProcessingException:41) - processed tyto communication exception, returning status: 409 and error body to client STATION_ALREADY_EXISTS

  • HTTP 400 - Invalid Format of Station Identifier [Unsupported special characters]

Corresponding user-app.log messages:

2019-04-08 17:35:12,030 ERROR [catalina-exec-57](com.vidyo.utils.LogUtils.logValidationError:12) - validation error - id: AFSGH$#%$&&*$^%#%D37474 is invalid
, URI: https://tyto-vvp7.vidyoqa.com/api/extintegration/tyto/v1/stations/
, method: POST
, entity: StationSaveRequest{identifier='AFSGH$#%$&&*$^%#%D37474', description='description'}

  • HTTP 422 - Invalid Format of Station Identifier [Empty Identifier]

Corresponding user-app.log messages:

2019-04-08 17:36:42,530 ERROR [catalina-exec-68](com.vidyo.services.TytoRemoteAPIService.performCommunication:353) - Received an error from tyto services:
, URI: https://app-stage1.tytocare.com/api/v1/integration/stations
, method: POST
, requestBody: StationSaveRequest{identifier='', description='description'}
, received response status: , http code: 422
, responseBody: {
"code" : "REQUEST_IS_NOT_VALID",
"message" : "station - may not be null\n"
}
2019-04-08 17:36:42,530 ERROR [catalina-exec-68](com.vidyo.rest.controllers.tyto.TytoErrorHandlerController.handleProcessingException:41) - processed tyto communication exception, returning status: 422 and error body to client REQUEST_IS_NOT_VALID

Retrieve station

GET - https://{portal-FQDN}/api/extintegration/tyto/v1/stations/{identifier}

Possible error messages

  • HTTP 404 - Station does not exist 

Corresponding user-app.log messages:

2019-02-14 23:25:00,158 ERROR [catalina-exec-71](com.vidyo.services.TytoRemoteAPIService.getStationStatus:131) - Unexpected Error - Station Endpoint Data for EndpointGUID AFSGHD37474bggdgd3 is not available in Portal
2019-02-14 23:25:00,374 ERROR [catalina-exec-71](com.vidyo.services.TytoRemoteAPIService.performCommunication:353) - Received an error from tyto services:
, URI: https://app-stage1.tytocare.com/api/v1/integration/stations/AFSGHD37474bggdgd3
, method: GET
, requestBody: None ,
, received response status: , http code: 404
, responseBody: {
"code" : "ERROR_STATION_DOES_NOT_EXIST"
}
2019-02-14 23:25:00,375 ERROR [catalina-exec-71](com.vidyo.rest.controllers.tyto.TytoErrorHandlerController.handleProcessingException:41) - processed tyto communication exception, returning status: 404 and error body to client STATION_DOES_NOT_EXIST

  • HTTP 400 - Invalid Station Id format [Unsupported characters in the Identifier]
  • HTTP 405 - Invalid Station Id format [Empty Station Identifier]

Pair Tyto device with station

POST - https://{portal-FQDN}/api/extintegration/tyto/v1/stations/{identifier}/pairingRequests

Possible error messages

  • POST - HTTP 404 - Station does not exist

Corresponding user-app.log messages:

2019-04-08 17:44:01,831 ERROR [catalina-exec-25](com.vidyo.services.TytoRemoteAPIService.performCommunication:353) - Received an error from tyto services:
, URI: https://app-stage1.tytocare.com/api/v1/integration/stations/AFSGHD37474bgrrrgdgd/pairingRequests
, method: POST
, requestBody: None ,
, received response status: , http code: 404
, responseBody: {
"code" : "ERROR_STATION_DOES_NOT_EXIST"
}
2019-04-08 17:44:01,832 ERROR [catalina-exec-25](com.vidyo.rest.controllers.tyto.TytoErrorHandlerController.handleProcessingException:41) - processed tyto communication exception, returning status: 404 and error body to client STATION_DOES_NOT_EXIST
2019-04-08 17:44:01,833 WARN [catalina-exec-25](org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException:140) - Resolved [com.vidyo.exceptions.tyto.TytoCommunicationException: 404 ]

  • POST - HTTP 400 - Invalid Station Id format [Unsupported characters in the Identifier]
  • POST - HTTP 500 - Invalid Station Id format [Empty Identifier]

Create or update clinician

PUT - https://{portal-FQDN}/api/extintegration/tyto/v1/stations/clinicians/{endpointGUID}

Possible error messages

  • PUT - HTTP 404 - Clinician does not exist [Empty Identifier]
  • PUT - HTTP 404 - Clinician does not exist [Invalid Identifier]
  • PUT - HTTP 400 - Clinician Identifier format invalid [unsupported special characters]

Visit APIs

Create visit

POST https://{portal-FQDN}/api/extintegration/tyto/v1/visits

Possible error messages

  • HTTP 422 - Invalid Format of Visit Identifier [Empty Identifier]

Sample request:

{
"identifier": "",
"clinicianIdentifier": "908F9B554A5A-4135948213",
"stationIdentifier": "88938957485C-176289082"
}

Response:

HTTP 422 - Unprocessable Entity ["VISIT_IDENTIFIER_NOT_PROVIDED"]

  • HTTP- 400 - Invalid Visit Identifier [Unsupported characers/exceeding max length of 140 characters]

Response:

["INVALID_IDENTIFIER"]

  • HTTP 404 - Invalid Clinician Identifier/Empty Clinician Identifier

Response:

["CLINICIAN_ENDPOINT_NOT_FOUND"]

  • HTTP 404 - Invalid Station Identifier/Empty Station Identifier

Response:

["STATION_ENDPOINT_NOT_FOUND"]

Get visit status

GET https://{portal-FQDN}/api/extintegration/tyto/v1/visits/ {visitId - got from create visit}

Possible error messages

  • HTTP 405 - Empty Visit Identifier

Response:

405 - Method not allowed

  • HTTP 404 - Invalid Visit Identifier

Response:

[
"VISIT_NOT_FOUND"
]

Create reviewer

PUT https://{portal-FQDN}/api/extintegration/tyto/v1/visits/{visitId - got from create visit}/reviews

Possible error messages

  • HTTP 404 - Invalid Visit Identifier
  • HTTP 500 - Empty Visit Identifier in URL
  • HTTP 404 - Invalid Reviewer Identifier/ Empty Reviewer Identifier

Response:

[
"ENDPOINT_GUID_NOT_FOUND"
]

Update visit status as completed

PUT https://tyto-vvp7.vidyoqa.com/api/extintegration/tyto/v1/visits/7c1a8b76534c47baa504601d9bb5e253/status

Possible error messages

  • HTTP 400 - Bad Request

Response:

[
"INVALID_VISIT_STATUS"
]