Ryarc Open API Description

Open API Overview


To consume Ryarc API you need to have valid Ryarc CMService URL & valid domain credentials:

- CMServiceURL: https://yourIP/CMService/

- Username: yourdomain\domainadmin

- Password: yourpassword


Following features are opened for access:

- Login

- Get Devices

- Get Channels by Device

- Create Command


Login


Login method is required for creating valid token

HTTP method: POST

Action name: Login

URL: CMServiceURL/Api/public/authOpenApi

Headers: Content-Type: application/json

Body:

{

"userName":" yourdomain\\domainadmin",
"password": "yourpassword"

}

Response:

{

  "errorCode": 0, 
  "errorDetails": null, 
  "token": "a89895da-0a99-4c41-bb44-8bdf402aeea3" 

}


If the login is successful, then this method return token with inactivity expiration of 15 minutes. Otherwise you will receive error & details about the exception.

We are storing the received token locally because all other requests required the token value as input.


GetCampaigns


Get Campaigns method will list all live and future Campaigns’ file URLs on a certain channel


HTTP method: POST

Action name: getCampaigns

URL: CMServiceURL/api/ryarcopenapi/getCampaigns

Input: object with 2 parameters: token (required), channelID (the ID can be found in the URL of the channel detail view or via calling GetChannels API)

Headers: Content-Type: application/json

Body:

{“token”:“a89895da-0a99-4c41-bb44-8bdf402aeea3”, “EntityID”: “3a0f98ed-4b52-4b47-8ba8d971ecb75f55”}

Response:

{

  "errorCode": 0, 
  "errorDetails": null, 
  "content": [ 
  	 { 
          "campaignID": "2d68fa86-e346-4b21-8b22-c08fac12f6cc", 
          "version": 24, 
          "files": [ 
              "https://192.168.1.10/CMService/Media/DownloadMedia/68-97-B6-EC-15-27-51-43-33-3B-E9-15-9D-23-77-87.png/jpg (1).png" 
          ] 
      }, 
      { 
          "campaignID": "040b7c87-39f0-430f-b068-1a798769b1c1", 
          "version": 16, 
          "files": [ 
              "https://192.168.1.10/CMService/Media/DownloadMedia/D9-06-1D-3D-A8-60-19-32-E9-8F-79-EC-8B-A1-C8-77.mp4/file_example_MP4_480_1_5MG.mp4", 
              "https://192.168.1.10/CMService/Media/DownloadMedia/68-97-B6-EC-15-27-51-43-33-3B-E9-15-9D-23-77-87.png/jpg.png", 
              "https://192.168.1.10/CMService/Media/DownloadMedia/68-97-B6-EC-15-27-51-43-33-3B-E9-15-9D-23-77-87.png/jpg (1).png" 
          ] 
      } 
  ] 


If the request is successful then this method returns to the campaign list with all its file download URLs. Campaigns show in order of the schedule. Otherwise, you will receive error & details about the exception.


DownloadChannelSchedules


Get All the live and future campaign schedules for the channel. The response is only about the meta data and does not contain the media files.

HTTP method: POST

Action name: DownloadChannelSchedules

URL: CMServiceURL/api/ryarcopenapi/DownloadChannelSchedules

Input: object with 2 parameters: token (required), channelID (the ID can be found in the URL of the channel detail view or via calling GetChannels API)

Headers: Content-Type: application/json

Body:

{“token”:“a89895da-0a99-4c41-bb44-8bdf402aeea3”, “EntityID”: “3a0f98ed-4b52-4b47-8ba8d971ecb75f55”}

Response:

The response body should be saved as a file. The file is a zip file, named as current date.zip. Inside the zip file, a folder ‘RyarcSync’ contains an encrypted schedule file named as the current channelID. It should be delivered to the remote CMPlayer device lateron.

It is only working for Linux at the moment, please put the encrypted schedule file ‘channelID’ under the following path

… Ryarc/CMPlayer/data/RyarcSync


Alternatively, the ‘channelID’ schedule file can also be downloaded from CMService portal as seen in the following screenshot.



‘USB Offline Update’ button downloads the zip file for the selected channels. Additionally, the zip file also contains the media files which can be manually copied into Linux media folder to skip the remote download on the device side in case internet not available there. Here is the media path to copy to.

… Ryarc/CMPlayer/media



PS: The remote player has to be configured to the same channel and it has to appear in the device list view on the CMService web portal before going offline.


GetDevices


Get Devices method will list all players from the CMS

HTTP method: POST

Action name: getPlayers

URL: CMServiceURL/api/ryarcopenapi/getPlayers

Input: object with 3 parameters: token (required), projectID (optional) & filterText (optional)

Headers: Content-Type: application/json

Body:

{“token”:“a89895da-0a99-4c41-bb44-8bdf402aeea3”, “projectID”: ””, “filterText”: ””}

Response:

{

  "errorCode": 0, 
  "errorDetails": null, 
  "players": [ 
      { 
          "playerID": "e48a4d15-8b12-474d-998e-007614a551cb", 
          "name": "DESKTOP-FPAQ738", 
          "ipAddress": "192.168.91.74" 
          "location": "-31.6792527~115.7080027" 
          "channelIDs": ["1d270505-22f2-43e9-8ce5-81f8adbe82e4"] 
      }, 
      { 
          "playerID": "c2dd4c69-caaa-45df-8954-00a1cf3b5762", 
          "name": "DESKTOP-KAELKIJ", 
          "ipAddress": "192.168.91.167" 
          "location": "-32.6792527~115.7080027" 
          "channelIDs": ["1d270505-22f2-43e9-8ce5-81f8adbe82e4"] 
      }, 
      { 
          "playerID": "0e9cadc6-6f99-4ebc-98c8-01082a20fc3e", 
          "name": "43 inch landscap TV", 
          "ipAddress": "192.168.8.253" 
          "location": "-33.6792527~115.7080027" 
          "channelIDs": ["1d270505-22f2-43e9-8ce5-81f8adbe82e4"] 
      }, 

If the request is successful then this method return list with all players. Otherwise you will receive error & details about the exception.


GetChannels


Get Channel method will list all channels connected to the specific player

HTTP method: POST

Action name: getChannels

URL: CMServiceURL/api/ryarcopenapi/getChannels

Input: object with 3 parameters: token (required), entityID (projectID/playerID) (optional) & filterText (optional)

Headers: Content-Type: application/json

Body:

{“token”:“a89895da-0a99-4c41-bb44-8bdf402aeea3”, “entityID”: “e48a4d15-8b12-474d-998e- 007614a551cb”, “filterText”: ””}

Response:

{

  "errorCode": 0, 
  "errorDetails": null, 
  "channels": [ 
      { 
          "channelID": "8b56ffe4-6584-4d83-9897-24538907a281", 
          "name": "Channel 02", 
          "params": null, 
          "channelGroupName": null, 
          "channelGroupID": null 
      }, 
      { 
          "channelID": "1d270505-22f2-43e9-8ce5-81f8adbe82e4", 
          "name": "Default Channel", 
          "params": null, 
          "channelGroupName": null, 
          "channelGroupID": null 
      }, 

If the request is successful then this method return list with all channels. Otherwise you will receive error & details about the exception.


GetProjects


Get project method will list all projects API credential is entitled to read

HTTP method: POST

Action name: getProjects

URL: CMServiceURL/api/ryarcopenapi/getProjects

Input: object with 1 parameter: token (required)

Headers: Content-Type: application/json

Body:

{“token”:“a89895da-0a99-4c41-bb44-8bdf402aeea3”}

Response:

{

  "errorCode": 0, 
  "errorDetails": null, 
  "projects": [ 
      { 
          "name": "second", 
          "playerName": null, 
          "id": "a51d72ff-7aa8-44cf-b824-814fca13b1bd" 
      } 
  ] 

}

If the request is successful then this method return list with all projects. Otherwise you will receive error & details about the exception.


CreateCommand


Create Command method will execute command on specific player, there are few parameters that should be required in order to publish command on player. All required inputs are described below.

HTTP method: POST

Action name: createCommand

URL: CMServiceURL/api/ryarcopenapi/createCommand

Input: object from CreateCommandRequest class.

1. “Token” is required. This request will pass only if the token is valid.

2. “ChannelID” – channel GUID, received in the previous request “getChannels”.

3. “Name” – Command name

4. “CommandType” – integer, there are 11 available command types (please see CommandType enum below).

5. “Schedule” – you can choose different options here. If “RunOnceAndImmediately” is equal to 1 (true) then all other property values are ignored. In this case the command will be executed only once & immediately on the player. If “RunOnceAndImmediately” is equal to 0 (false) then all other parameters are respected. From all other 4 parameters schedule is created.


o !IMPORTANT – StartDate & EndDate values needs to use following pattern: YYYYMMDD.

▪ For example if we want schedule from 03 Oct 2018 till 20 Oct 2018 then StartDate = 20181003 & EndDate = 20181020

o !IMPORTANT – ExecuteAt value needs to use following pattern: HHMMSS.

▪ For example if we want the command to be executed every day at 13:30 then the value that needs to be send to the api is 133000.


6. “DayOfWeek” – within this field we can control the days of week. This string needs to contain 7 characters. One character (0 or 1) per each day, starting from Monday. For example if we want the command to be executed only on Monday & Friday, then the value of this property is 1000100.


public class CreateCommandRequest

  {         public string Token { get; set; }         public string ChannelID { get; set; }         public string Name { get; set; }         public CommandType CommandType { get; set; }         public SampleScheduleInfo Schedule { get; set; }     }  

public enum CommandType

  { 
      Reboot = 1, 
      RequestActivityLog = 2, 
      RequestPlayLog = 3, 
      Restart = 4, 
      TurnDisplayOff = 5, 
      TurnDisplayOn = 6,         TurnSoundOff = 7, 
      TurnSoundOn = 8, 
      DeleteMediaAndRestart = 9, 
      TurnUIOff = 10, 
      TurnUIOn = 11 
  }  

public class SampleScheduleInfo

  {         public string StartDate { get; set; }         public string EndDate { get; set; }         public string DaysOfWeek { get; set; }         public string ExecuteAt { get; set; } 
      public bool RunOnceAndImmediately { get; set; } 
  } 


Headers: Content-Type: application/json

Body:

{“token”: “4b43418f-c445-4464-a82b-a1d6ee335328”, “channelID”: “d09e4ee0-4f97-49ce-82825e624d2f0449”, “name”: “APICommand”, “CommandType”: 7, “Schedule”: {“startDate”: “20220707”, ” endDate”: “20220717”, “daysOfWeek”: “1111111”, “executeAt”: “023000”, “runOnceAndImmediately”: true}}

Response:

{

  "errorCode": 0, 
  "errorDetails": "" 

}


If the request is successful then this method return ErrorCode equal to OK. Otherwise you will receive error & details about the exception.


Ryarc Open API Example

1. Login Page



2. Get Devices



3. Get Channels



4. Create Command



DEUS Api Documentation

KeyTypes

0 → Text Key

1 → Image key

2 → Switch key

Login method is required for creating valid token

HTTP method: POST

Action name: Login

URL: CMServiceURL/Api/public/Auth Headers: Content-Type: application/json

Body:

{“userName”:” yourdomain\\domainadmin”, “password”: “yourpassword”}

Response:

{

  "token": "a89895da-0a99-4c41-bb44-8bdf402aeea3" 

}


If the login is successful, then this method return token with inactivity expiration of 15 minutes. Otherwise you will receive error & details about the exception.

We are storing the received token locally because all other requests required the token value as input.


GetChannels

HTTP method: GET

Action name: Deus/Channels

URL: CMServiceURL/api/Deus/Channels

Headers: auth-token: TOKEN_FROM_LOGIN

Input: NONE

Output: Array of channel objects with channelName & channelId

[

  { 
      "channelId": "b4ac834c-fa53-4048-a0f9-019f739845e9", 
      "channelName": "RemoteAgent2-DMT" 
  }, 
  { 
      "channelId": "cefa1432-c4e8-4fa1-bed0-01e62b2eec22", 
      "channelName": "QR Code 2" 
  }, 


Get Deus Keys

HTTP method: GET

Action name: Deus/Keys

URL: CMServiceURL/api/Deus/Keys

Headers: auth-token: TOKEN_FROM_LOGIN

Input: NONE

Output: Array of deus key objects with keyId, keyName & keyType

[

  { 
      "keyId": "20757d3a-7592-06d1-b52d-06d1ebc34915", 
      "keyName": "Jinus2", 
      "keyType": 0 
  }, 
  { 
      "keyId": "593d3ef7-d6da-4a11-a826-0a469e5367a5", 
      "keyName": "Temperature_Max_Tmr", 
      "keyType": 0 
  }, 


Get Deus Keys

HTTP method: GET

Action name: Deus/pull

URL: CMServiceURL/api/Deus/Pull

Headers: auth-token: TOKEN_FROM_LOGIN

Input: id (id of channel you want to get keys for)

Output: Array of deus key objects with keyId, keyName, keyType & value for specific channel

[

  { 
      "keyId": "a1b4f595-eae0-4c37-87b7-001097334345", 
      "keyName": "MONTEREY", 
      "keyType": 0, 
      "value": "" 
  }, 
  { 
      "keyId": "f8f885d1-e2c1-460b-a0e1-003288a9faa5", 
      "keyName": "TEXARKANA", 
      "keyType": 0, 
      "value": "" 
  }, … 


Get Deus Channel Keys

HTTP method: GET

Action name: Deus/clear

URL: CMServiceURL/api/Deus/Clear

Headers: auth-token: TOKEN_FROM_LOGIN

Input: id (id of channel you want to clear keys for)

Output: EMPTY response


Create Deus Keys

HTTP method: POST

Action name: Deus/Keys

URL: CMServiceURL/api/Deus/Keys

Headers: auth-token: TOKEN_FROM_LOGIN,

Content-Type: application/json

Input: Array of key objects containing keyName & keyType

{“keys”: [{“keyName”: “API1”, “keyType”: 0},{“keyName”: “API2”, “keyType”: 0}]}

Output: EMPTY response


Change key value/image

HTTP method: POST

Action name: Deus/push

URL: CMServiceURL/api/Deus/push

Headers: auth-token: TOKEN_FROM_LOGIN,

Content-Type: form-data

Input: Metadata Array of channels containing channelId & array of keys containing keyId, keyValue, keyType. For Image key type you also need to attach the FILES and send them.

Ex.

Key:

metadata Value:

[{“channelId”:“b4ac834c-fa53-4048-a0f9-019f739845e9”,”keyValues”:[{“keyId”:“a1b4f595-eae0-4c37-87b7- 001097334345”,”value”:“1”,”keyType”:0}]}]

Output: EMPTY response


Change key value/text

HTTP method: POST

Action name: Deus/push

URL: CMServiceURL/api/Deus/saveTextKeys Headers: auth-token: TOKEN_FROM_LOGIN,

Content-Type: application/json

Input:

[{“channelId”:“b4ac834c-fa53-4048-a0f9-019f739845e9”,”keyValues”:[{“keyId”:“a1b4f595-eae0-4c37-87b7- 001097334345”,”value”:“1”,”keyType”:0}]}]

Output: EMPTY response







Remember: Token expires in 15 minutes. Please remember to refresh the token if error appears