/alerts


Last updated: August 1st, 2024.

Description

This endpoint is used to get information about the devices with alerts.

This endpoint must be consumed in GET request.

Security

This endpoint is secured, you must send a Bearer Token, to be able to invoke the endpoint. To get the token, you should invoke first the /oauth/token service of the security microservice, if you don't know what service is, please talk with your sysadmin for further information.


Request

As part of the request a Bearer Token must be sent, (if you don't send a valid token a 401 error will be retrieved). Look at the next example below in Postman.

Image Placeholder
Bearer Token in HTTP Header



This must be sent in the Http headers of the request. Look at the next curl example below.

Copy codecurl --location 'host:port/zynchro.api.monitoring/v1/player-health/alerts?client_id=38&smartgroup_id=0&transaction_id=123456' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDMyODQ4MjIsInVzZXJfbmFtZSI6ImFsZWphbmRyby56YW5hYnJpYUBkaWdpd29ya3MuY29tLm14IiwiYXV0aG9yaXRpZXMiOlsiUk9MRV9TWVNURU1BRE1JTiJdLCJqdGkiOiJEUzBUWklOeG1MZEZ0S1dqNlFOVEJGV3pUX00iLCJjbGllbnRfaWQiOiJ6eW5jaHJvIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIl19.RL21mKd89C7hlFt2MxToU2wjDO0uAJh8Sa9ObD6nHgQ'




In Java this would be an example of the code: It will depend on the dependency you use.

Copy codeOkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .build();
Request request = new Request.Builder()
  .url("host:port/zynchro.api.monitoring/v1/player-health/alerts?client_id=38&smartgroup_id=0&transaction_id=123456")
  .method("GET", body)
  .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDMyODQ4MjIsInVzZXJfbmFtZSI6ImFsZWphbmRyby56YW5hYnJpYUBkaWdpd29ya3MuY29tLm14IiwiYXV0aG9yaXRpZXMiOlsiUk9MRV9TWVNURU1BRE1JTiJdLCJqdGkiOiJEUzBUWklOeG1MZEZ0S1dqNlFOVEJGV3pUX00iLCJjbGllbnRfaWQiOiJ6eW5jaHJvIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIl19.RL21mKd89C7hlFt2MxToU2wjDO0uAJh8Sa9ObD6nHgQ")
  .build();
Response response = client.newCall(request).execute();




These are the params required in the request:




Field
SubField
Type
Description
IsRequired
transaction_id

text

A custom value to identify the data related to the request in the response (you can see the transactionId in the response header).




Example:

  • REQ000001

Note: This field is not related with the data to be retrieved, must be used by the client app in order to identify the request/response (if that is useful), the same value can be send in multiple request (it’s not validated that the same value was sent before).




N
client_id 

int

The id of the client associated to the request,




Example:

  • 38
Y
smartgroup_id

int

The id of the specific smart group to query.




Example:

  • 199

Note: if the smartgroup_id is not send then all the info retrieved is for all the smartgroups associated to the client.

N




Consuming Service




Example Request

Consuming service 

(GET) URL:HOST:PORT/zynchro.api.monitoring/v1/player-health/alerts?client_id=38&smartgroup_id=0&transaction_id=123456

Request Params:

client_id=38

smartgroup_id=0

transaction_id=123456




Response




Response 200 OK

If the params presented in the request are valid, then you will receive a response 200 "ok" message code. Look at the next example below:

{
    "header": {
        "resultCode": "ok",
        "messageCode": "ok",
        "messageDescription": "request ok",
        "transactionId": "123456"
    },
    "data": {
        "totalLocations": 3939,
        "totalPlayers": 7871,
        "results": [
            {
                "state": "California",
                "city": "Del Sur",
                "locationName": "Store #1563",
                "playerName": "TV Wall",
                "serial": "TUE01J002398",
                "offline": true,
                "resolution": false,
                "firmware": true,
                "tvPower": false,
                "tvInput": false,
                "lastPingStr": "85d 6h 16m 26s  ago",
                "lastPingSecs": 7366587,
                "localIP": "7.153.172.128",
                "presentation": "TVWall-Main-Banner-4K-60p-FR1-v2"
            },
            {
                "state": "Ohio",
                "city": "Youngstown",
                "locationName": "Store #2211",
                "playerName": "TV Wall",
                "serial": "D3E98T001086",
                "offline": true,
                "resolution": false,
                "firmware": true,
                "tvPower": false,
                "tvInput": false,
                "lastPingStr": "85d 6h 16m 26s  ago",
                "lastPingSecs": 7366587,
                "localIP": "7.118.164.210",
                "presentation": "TVWall-Main-Banner-4K-60p-FR1-v2"
            }
        ]
    }
}


Description of the response data:

Field
SubField
Type
Description

header

 

Object

Specific data related to the response.

 

resultCode

text

The result code of the response, can be:

·         error -> if errors were found

·         ok -> if NO errors were found

 

messageCode

text

The message code related to the result code of the response, can be:

Example:

 

 

messageDescription

text

The description of the message code

Example:

·         Request ok

·         Please check your params fields

 

transactionId

text

The transactionId specified in the request, if no transactionId was sent in the request then the transacionId in the response will be null.

errors

 

Array

 This field is present if there are errors in the request.

 

fieldName

text

The field with errors.

 

fieldDesc

text

 The description of the error.

Data

 

Object

The specific response data related to the request.


totalLocations

int

Total locations associated to the smartgroup or client.


Example:

  • 3939


totalPlayers

int

Total players/devices associated to the smartgroup or client.


Example:

  • 7871


results

Array

List/Array of devices with alerts.

results (object)





state

text

The state where the device/player is located.


Example:

  • California


city

text

The city where the device/player is located.


Example:

  • Del Sur


locationName

text

The name of the location where the device/player is located.


Example:

  • California


playerName

text

The name of the device/player


Example:

  • Zynchro Player 123


serial

text

The name of the device/player


Example:

  • TUE01J002398


offline

boolean

A boolean value that indicates if the player is offline.


Example:

  • true



resolution

boolean

A boolean value that indicates if the resolution is enabled.


Example:

  • false


firmware

boolean

A boolean value that indicates if the firmware has the last version.


Example:

  • true


tvPower

boolean

A boolean value that indicates if the power of the TV is enabled.


Example:

  • false


tvInput

boolean

A boolean value that indicates if the input of the TV is enabled.


Example:

  • false


lastPingStr

text

A String/text that indicates the time of the last ping to the player/device, in the format:

  • numDays numHours numMinutes numSeconds


Example:

  • 85d 6h 16m 26s  ago


lastPingSecs

text

A numeric value that indicates the number of seconds of the last ping to the player/device:


Example:

  • 7366587


localIP

text

The local ip of the player/device.


Example:

  • 7.153.172.128



presentation

text

The name of the presentation associated to the device/player.


Example:

  • TVWall-Main-Banner-4K-60p-FR1-v2

Response 400

If there are errors with the request, then you will receive a 400 message response BAD_REQUEST with the errors field present, like the following example:

Copy code{
    "header": {
        "resultCode": "error",
        "messageCode": "BAD_REQUEST",
        "messageDescription": "Please check your params fields",
        "transactionId": "123456"
    },
    "errors": [
        {
            "fieldName": "client_id",
            "fieldDesc": "Field is required, and must be of type int "
        }
    ]
}







Response 401

If you dont send any token, then you will receive a error message of "unauthorized", take a look at the next example:

Copy code{
    "error": "unauthorized",
    "error_description": "Full authentication is required to access this resource"
}







If you send a Token but the Token you are sending is expired, then you will receive a response message with an "invalid_token" error, take a look at the next example:




Copy code{
    "error": "invalid_token",
    "error_description": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDM2MTk5NzMsInVzZXJfbmFtZSI6ImFsZWphbmRyby56YW5hYnJpYUBkaWdpd29ya3MuY29tLm14IiwiYXV0aG9yaXRpZXMiOlsiUk9MRV9TWVNURU1BRE1JTiJdLCJqdGkiOiJHTGtQb3hQbVRTZUs2RFhmc1NfNkUxRkMxZmsiLCJjbGllbnRfaWQiOiJ6eW5jaHJvIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIl19.yAFbdU18wMtQXSGUY3_noQn4BQv0RqYjDbw0sr1x6Yk"
}




This is the data retrieved when the 401 unauthorized is retrieved:

Field
SubField
Type
Description

error

 

text

The type of the error, can be:

  • unauthorized
  • invalid_token




error_description




text

The description of the error, for the "invalid_token", this field retrieves the bearer token you're sending

Postman Collection


Download File: