/players-zy


Description

This endpoint is used for getting control info about the devices assigned to a client

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, for getting 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 send, (if you don't send a valid token a 401 error will be retrieved), look at the next example in Postman for a better understanding.

Bearer Token in Http Header

This must be sent in the Http headers of the request, look at the next curl example for a better understanding.

Copy codecurl --location 'localhost:9096/zynchro.api.controltower/v1/players/players-zy?transaction_id=123456&client_id=33&status=0' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDMyODQ4MjIsInVzZXJfbmFtZSI6ImFsZWphbmRyby56YW5hYnJpYUBkaWdpd29ya3MuY29tLm14IiwiYXV0aG9yaXRpZXMiOlsiUk9MRV9TWVNURU1BRE1JTiJdLCJqdGkiOiJEUzBUWklOeG1MZEZ0S1dqNlFOVEJGV3pUX00iLCJjbGllbnRfaWQiOiJ6eW5jaHJvIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIl19.RL21mKd89C7hlFt2MxToU2wjDO0uAJh8Sa9ObD6nHgQ'


In java it would be something like this (depending on the dependency you use)

Copy codeOkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("localhost:9096/zynchro.api.controltower/v1/players/players-zy?transaction_id=123456&client_id=33&status=0")
  .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 sended in multiple request (it’s not validated that the same value was sended before).


N
client_id 

int

The id of the client associated to the request,


Example:

  • 38
Y
status

int

The status of the devices to filter:

  • 0 -> all
  • 1 -> online
  • 2 -> offline


Example:

  • 0


N




Consuming Service


Example Request

Consuming service 

(GET) URL:HOST:PORTzynchro.api.controltower/v1/players/players-zy?transaction_id=123456&

client_id=33&status=0

Request Params:

  • client_id=38
  • status=0
  • transaction_id=123456


Response


Response 200 OK

If the params present in the request are valid, then you will receive a response 200 "ok" message code look at the next example:

Copy code{
    "header": {
        "resultCode": "ok",
        "messageCode": "ok",
        "messageDescription": "request ok",
        "transactionId": "123456"
    },
    "data": [
        {
            "id": 9691,
            "client": " Beauty Department",
            "country": "United States",
            "state": "Alabama",
            "city": "Jacksonville",
            "locationId": "300",
            "location": "Store #300",
            "playerName": "Endcap - Vertical - Advertising - Inner Beauty",
            "localIp": "7.147.124.67",
            "model": "XD1034",
            "serial": "D3E8CP001344",
            "firmware": "8.4.14",
            "zynchroFirmware": null,
            "offline": "1d 11m 3s ago",
            "presentation": "4K Landscape",
            "storage": "55 GB",
            "sdCardManufacturerId": 9,
            "sdProductName": "MB43A",
            "sdVersionSpec": 3,
            "sdProductRevision": "1.4",
            "sdSpeedClass": "Class10",
            "sdInstalled": "Yes",
            "playlist": "Beauty EndCap - Inner Mindful Beauty",
            "status": "Offline",
            "tvPower1": "On",
            "tvPower2": "",
            "tvPower3": "",
            "tvPower4": "",
            "tvInput1": "HDMI 1",
            "tvInput2": "",
            "tvInput3": "",
            "tvInput4": ""
        },
        {
            "id": 9695,
            "client": " Beauty Department",
            "country": "United States",
            "state": "Alabama",
            "city": "Jacksonville",
            "locationId": "300",
            "location": "Store #300",
            "playerName": "Endcap - Vertical - Advertising - The Curl Shop",
            "localIp": "7.147.124.187",
            "model": "XD1034",
            "serial": "D3E8CM001482",
            "firmware": "8.4.14",
            "zynchroFirmware": "3.14.16",
            "offline": "1d 11m 19s ago",
            "presentation": "4K Landscape",
            "storage": "55 GB",
            "sdCardManufacturerId": 9,
            "sdProductName": "MB43A",
            "sdVersionSpec": 3,
            "sdProductRevision": "1.4",
            "sdSpeedClass": "Class10",
            "sdInstalled": "Yes",
            "playlist": "Beauty EndCap - The Curl Shop",
            "status": "Offline",
            "tvPower1": "On",
            "tvPower2": "",
            "tvPower3": "",
            "tvPower4": "",
            "tvInput1": "HDMI 1",
            "tvInput2": "",
            "tvInput3": "",
            "tvInput4": ""
        }
    ]
}


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 sended 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.


id

int

The identifier of the alert.


Example:

  • 2469


client

text

The client name to what device is assigned to


Example:

  • Tech Department


country

text

The country where the device is assigned to


Example:

  • United States


state

text

The states where the device is assigned to


Example:

  • Wisconsin


city

text

The city where the device is assigned to


Example:

  • Oshkosh


locationId

text

The location identifier where the device is assigned to


Example:

  • 1430


location

text

The location name where the device is assigned to


Example:

  • Store # 1430


playerName

text

The player name of the device


Example:

  • Advertising Trend


localIp

text

The local ip of the device


Example:

  • 1.2.3.4


model

text

The model of the device


Example:

  • XD1034


serial

text

The serial of the device


Example:

  • ABCD123456


firmware

text

The firmware version installed on the device


Example:

  • 8.4.14


zynchroFirmware

text

The zynchro firmware version installed on the device


Example:

  • 3.14.16


offline

text

The offline time of the device (in case the device is offline)


Example:

  • 1d 10m 47s ago


presentation

text

The name of the presentation installed on the device


Example:

  • 4k promo campaign


storage

text

Total storage on the device human readable


Example:

  • 55 GB


sdCardManufacturerId

int

The manufacturer id of the sd card insatlled on the device


Example:

  • 1


sdProductName

text

The product name of the sd card insatlled on the device


Example:

  • MB43A


sdVersionSpec

int

The spec version of the sd card insatlled on the device


Example:

  • 3


sdProductRevision

text

The product revision version of the sd card insatlled on the device


Example:

  • 1.4


sdSpeedClass

text

The speed class category of the sd card insatlled on the device


Example:

  • Class10


sdInstalled

text

Indicates if there is an sd card insatlled on the device


Example:

  • Yes


playlist

text

The name of the playlist installed on the device


Example:

  • Trending Videos


status

text

The status of the device, can be online/offline


Example:

  • Online


tvPower1

text

The tv power 1 channel of the device can be on/off


Example:

  • On

Note: a null o empty value indicates there is no data associated to this channel


tvPower2

text

The tv power 2 channel of the device can be on/off


Example:

  • Off

Note: a null o empty value indicates there is no data associated to this channel


tvPower3

text

The tv power 3 channel of the device can be on/off


Example:

  • Off

Note: a null o empty value indicates there is no data associated to this channel


tvPower4

text

The tv power 4 channel of the device can be on/off


Example:

  • Off

Note: a null o empty value indicates there is no data associated to this channel


tvInput1

text

The tv input 1 source of the device


Example:

  • HDMI 1

Note: a null o empty value indicates there is no data associated to this source


tvInput2

text

The tv input 2 source of the device


Example:

  • HDMI 2

Note: a null o empty value indicates there is no data associated to this source


tvInput3

text

The tv input 3 source of the device


Example:

  • HDMI 3

Note: a null o empty value indicates there is no data associated to this source


tvInput4

text

The tv input 4 source of the device


Example:

  • HDMI 4

Note: a null o empty value indicates there is no data associated to this source


Response 401

If you dont send any token, then you will receive a error message of "unauthorized", 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, 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

File download: