Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:zebrixrestapi [2016/08/02 11:04] admin |
en:zebrixrestapi [2021/08/25 10:29] (current) |
||
---|---|---|---|
Line 9: | Line 9: | ||
^Parameters^^ | ^Parameters^^ | ||
- | |customername|the customer name| | + | |clientname|the customer name| |
|username|the username| | |username|the username| | ||
|password|the user password| | |password|the user password| | ||
Line 17: | Line 17: | ||
**Call** | **Call** | ||
- | {{:en_api_login.jpg|}} | + | {{public_media:en_api_login.jpg|}} |
**Return** | **Return** | ||
- | {{:en_api_login_return.jpg|}} | + | {{public_media:en_api_login_return.jpg|}} |
===== Example of GET API on screen ===== | ===== Example of GET API on screen ===== | ||
Line 37: | Line 37: | ||
The call of the API will return a JSON array of all screens : | The call of the API will return a JSON array of all screens : | ||
- | {{::en_api_header_example.jpg|}} | + | {{public_media:en_api_header_example.jpg|}} |
To get information for a specific screen, its unique id can be added in the URL. For example, we want to get information about the screen with the id 6361 : | To get information for a specific screen, its unique id can be added in the URL. For example, we want to get information about the screen with the id 6361 : | ||
- | {{:en_api_screenapi_id.jpg|}} | + | {{public_media:en_api_screenapi_id.jpg|}} |
+ | |||
+ | ===== How to set content on a screen? ===== | ||
+ | |||
+ | Basically, you will have to post the following JSON | ||
+ | |||
+ | <code javascript>{'contentType':"page",'ContentId': contentId, 'useScheduling': False}</code> | ||
+ | |||
+ | * **contentType (string):** possible value « page » and « playlist » | ||
+ | * **contentId (integer)** : id of the content you want to set | ||
+ | * **useScheduling (boolean)** : false is mandatory when setting an arbitrary content. | ||
+ | |||
+ | To go back to schedule mode, you only need to POST the following JSON | ||
+ | |||
+ | <code javascript>{'useScheduling': True}</code> | ||
+ | |||
+ | to the following URL: | ||
+ | |||
+ | <code>POST : https://cmsv2.zebrix.net/api/screen/{screenID}/setContent</code> | ||
+ | |||
+ | To get ID of pages and playlist, you can make a GET request to following URLs: | ||
+ | |||
+ | * /api/screen | ||
+ | * /api/page | ||
+ | * /api/playlist | ||
===== How to use API for datasource ===== | ===== How to use API for datasource ===== | ||
Line 56: | Line 80: | ||
* HASBEAMER | * HASBEAMER | ||
- | {{::en_api_datasource_meetingrooms_originaldb.jpg|}} | + | {{public_media:en_api_datasource_meetingrooms_originaldb.jpg|}} |
In zebrix this table of 4 meeting rooms will requires 4 datasources (i.e. meeting room 1, meeting room 2, meeting room 3, meeting room 4). Each line/datasource will contains all columns / fields in a JSON. | In zebrix this table of 4 meeting rooms will requires 4 datasources (i.e. meeting room 1, meeting room 2, meeting room 3, meeting room 4). Each line/datasource will contains all columns / fields in a JSON. | ||
Line 68: | Line 92: | ||
Using our meeting rooms example, here is the result you will get : | Using our meeting rooms example, here is the result you will get : | ||
- | {{:en_api_datasource_meetingrooms.jpg|}} | + | {{public_media:en_api_datasource_meetingrooms.jpg|}} |
- | Theses datasource can be used by users in their page by following instructions on that page (section 5) ([[datasource_en|Using datasources in Zebrix]] | + | Theses datasource can be used by users in their page by following instructions on that page (section 5) ([[en:datasource|Using datasources in Zebrix]] |
<WRAP center round info 60%> | <WRAP center round info 60%> | ||
Please notice that some datasources are auto-generated by zebrix when the functionality of "zone with variable content" is used. These datasources can be easily recognized with their name which always begin with double uderscope + page + id of the concerned page. | Please notice that some datasources are auto-generated by zebrix when the functionality of "zone with variable content" is used. These datasources can be easily recognized with their name which always begin with double uderscope + page + id of the concerned page. | ||
- | {{::en_api_datasource_autogeneratedds.jpg|}} | + | {{public_media:en_api_datasource_autogeneratedds.jpg|}} |
</WRAP> | </WRAP> | ||
Line 84: | Line 108: | ||
The content of the datasource has to be JSON encoded and put as an object in a defaults variable. | The content of the datasource has to be JSON encoded and put as an object in a defaults variable. | ||
- | {{::en_api_datasource_json.jpg|}} | + | {{public_media:en_api_datasource_json.jpg|}} |
Example of usage : | Example of usage : | ||
- | {{:en_api_datasource_add.jpg|}} | + | {{public_media:en_api_datasource_add.jpg|}} |
==== How to update an existing datasource ==== | ==== How to update an existing datasource ==== | ||
Line 94: | Line 118: | ||
<wrap hi>POST /api/datasource/:id</wrap> | <wrap hi>POST /api/datasource/:id</wrap> | ||
- | {{:en_api_datasource_update.jpg|}} | + | {{public_media:en_api_datasource_update.jpg|}} |
The update process works the same as a creation but the id of the datasource need to be specified. | The update process works the same as a creation but the id of the datasource need to be specified. |