{"id":7231,"date":"2025-04-01T22:00:06","date_gmt":"2025-04-01T14:00:06","guid":{"rendered":"https:\/\/doc.smartflomeet.ttns.in\/developer\/?page_id=7231"},"modified":"2025-04-01T23:12:19","modified_gmt":"2025-04-01T15:12:19","slug":"data-store","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video\/solutions\/data-store\/","title":{"rendered":"Data Store"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\"><p>You can use Video Service to save Application data related to your Video Room, Owners, Users and Sessions. These data can be retrieved later in-session and post-session through API Call<\/p><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Table of Contents<\/h3>\n\n\n\n<ul><li><a href=\"#overview\">Overview<\/a><\/li><li><a href=\"#basics\">Basic Understanding<\/a>\n<ul>\n<li><a href=\"#objects\">Object Hierarchy<\/a><\/li>\n\n\n\n<li><a href=\"#data-scope\">Scope of Data Store<\/a><\/li>\n\n\n\n<li><a href=\"#pre-requisite\">Pre-Requisite<\/a><\/li>\n<\/ul>\n<\/li><li><a href=\"#sdk\">SDK to store &amp; retrieve Data<\/a><\/li><\/ul>\n\n\n\n<a name=\"overview\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p>This is a limited data storage service from Video using which application developers can  build Video Room based utilities that requires in-session data flow and across session data persistency.  <\/p>\n\n\n\n<p>This is a Subscription based Service.  <\/p>\n\n\n\n<a name=\"basics\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Basic Understanding<\/h2>\n\n\n\n<p>Lets understand the basics of Data Store to know what you can store and for how long. This will help you make use of Data Store service effectively. <\/p>\n\n\n\n<a name=\"objects\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Object Hierarchy<\/h3>\n\n\n\n<ul><li><strong>Application<\/strong> <ul><li>When you create a Video Project or Application using Portal, its assigned with an <code>app_id<\/code>. <\/li><li>Video resources are accessible to this<code> app_id.<\/code> Therefore it is the Parent Object. Everything else comes under it.   <\/li><\/ul><\/li><li><strong>Video Room<\/strong> <ul><li>All Video Rooms created using Video API are created under the Application i.e. <code>app_id<\/code>. <\/li><li>Video Room created is identified by <code>room_id<\/code>. <\/li><li>Further, each Video Room has a Owner, referred as <code>owner_ref<\/code>. <\/li><\/ul><\/li><li><strong>Video Session<\/strong> <ul><li>Video Sessions are held in a Video Room. <\/li><li>One Video Room may have one or more Video Sessions.<\/li><li>A single Video Session is identified by by <code>conf_num<\/code>, i.e., Conference Number. <\/li><\/ul><\/li><li><strong>End User<\/strong> <ul><li>End User joins a Video Session from different type of end-point \/ devices.  <\/li><li>Each User connected with a Video Session is identified by a <code>client_id<\/code> assigned to him.<\/li><li>Every time a user rejoins or reconnects a Video Session he is assigned with a new <code>client_id<\/code>.  <\/li><\/ul><\/li><\/ul>\n\n\n\n<a name=\"data-scope\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Scope of Data Store<\/h3>\n\n\n\n<p>As you understood Object Hierarchy, their identifier and few other entity there in; be informed that following type of data you can store in Video Service.<\/p>\n\n\n\n<ul><li><strong>Application Data<\/strong>:\n<ul>\n<li>You can save Application level data. <\/li>\n\n\n\n<li><em>In-Session Availability<\/em>: This data is available to all Video Rooms and Sessions therein.  Data is automatically made available to the Session on session initiation. <\/li>\n\n\n\n<li><em>Retention Period:<\/em> Data is retained till 7 days past Application suspension.<\/li>\n<\/ul>\n<\/li><li><strong>Room Data<\/strong>:\n<ul>\n<li>You can save Video Room level data. <\/li>\n\n\n\n<li><em>In-Session Availability: <\/em>This data is accessible across all Sessions done in that Room.. Data is automatically made available to the Session on session initiation. <\/li>\n\n\n\n<li><em>Retention Period: <\/em>Data is retained until a Room is deleted or til 7 days past Application suspension.<\/li>\n<\/ul>\n<\/li><li><strong>Owner Data: <\/strong>\n<ul>\n<li>You can save Room Owner level data.<\/li>\n\n\n\n<li><em>In-Session Availability:<\/em> This data accessible across all Sessions done in all Video Rooms owned by the same Owner. Data is automatically made available to the Session on session initiation. <\/li>\n\n\n\n<li><em>Retention Period:<\/em> Data is retained till 7 days past Application suspension.<\/li>\n<\/ul>\n<\/li><li><strong>User Data<\/strong>:\n<ul>\n<li>You can save User level data. <\/li>\n\n\n\n<li><em>In-Session Availability:<\/em>  This data is accessible across all Video Rooms whenever user joins a Session.<\/li>\n\n\n\n<li><em>Retention Period: <\/em>Data is retained till 7 days past Application suspension.<\/li>\n<\/ul>\n<\/li><li><strong>Session Data: <\/strong>\n<ul>\n<li>YOu can save Session Level data.<\/li>\n\n\n\n<li><code>In-Session Availability: <\/code>This data is accessible within the same Session. However, if needed, it may be made available in subsequent sessions in the same Video Room.<\/li>\n\n\n\n<li><em>Retention Period: <\/em>Data is retained for 7 days only.<\/li>\n<\/ul>\n<\/li><\/ul>\n\n\n\n<a name=\"pre-requisite\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Pre-requisite<\/h3>\n\n\n\n<ul><li><strong>Subscription: <\/strong>Its a subscription based service. Ensure that your plan has this add-on. <\/li><li><strong>For Owner-level data store:<\/strong>\n<ul>\n<li>You must use unique user-id of the user as <code>owner_ref<\/code> while <a href=\"\/developer\/video-api\/server-api\/rooms-route\/#create-room\">creating room<\/a>. <\/li>\n\n\n\n<li>The same user-id needs to be used as <code>user_ref <\/code>while <a href=\"\/developer\/video-api\/server-api\/rooms-route\/#create-token\">creating a Token<\/a> for the user. When this user joins a Video Session, he gets access his owner data. <\/li>\n\n\n\n<li>Therefore, if unique user-id is not used as <code>owner_ref<\/code> (With Room) and <code>user_ref<\/code> (With Token), you can&#8217;t make user of Data Store service effectively. <\/li>\n<\/ul>\n<\/li><li><strong>For user-level data store: <\/strong>\n<ul>\n<li>You must use unique user-id for each user as <code>user_ref <\/code>while <a href=\"\/developer\/video-api\/server-api\/rooms-route\/#create-token\">creating Token<\/a> for them. When users join Video Session, they get access to their own user data. <\/li>\n\n\n\n<li>Any data saved at user level will be saved against the joined user&#8217;s <code>user_ref.<\/code> <\/li>\n\n\n\n<li>Therefore, if unique user-id is not used as <code>user_ref<\/code> (With Token), you can&#8217;t make user of Data Store service effectively. <\/li>\n<\/ul>\n<\/li><\/ul>\n\n\n\n<a name=\"sdk\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">SDKs to store and retrieve Data<\/h2>\n\n\n\n<p>All Video SDKs has methods to store and retrieve data of different scope. The examples given here using Web SDK only. For all other SDKs, you need to refer to related SDK Documentation. <\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">SDK Support for different data scope<\/h3>\n\n\n\n<ul><li><strong>Application Level<\/strong>: SDK can&#8217;t alter data. Read only.  <\/li><li><strong>Room Level<\/strong>: SDK can create, edit, delete data. JSON Objects, arrays can be defined.<\/li><li><strong>Room Owner Level<\/strong>:  SDK can&#8217;t alter data. Read only. <\/li><li><strong>Session Level<\/strong>: SDK can create, edit, delete data. JSON Objects, arrays can be defined.<\/li><li><strong>User Level<\/strong>: SDK can create, edit, delete data. JSON Objects, arrays can be defined.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Retrieve from Data Store<\/h3>\n\n\n\n<p>Use the following method to retrieve data of different scope to use them in-session. <\/p>\n\n\n\n<p><strong>Method:<\/strong> <code>getCustomData(options, callback)<\/code><\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>options<\/code>: JSON Object with configurable options to retrieve the right data.\n<ul>\n<li><code>scope<\/code>: Enumerated values: app, user, owner, session, room\n<ul>\n<li>With \u201capp\u201d scope, no further qualifier is needed. It returns App level custom data.<\/li>\n\n\n\n<li>With \u201cowner\u201d scope, no further qualifier is needed. &nbsp;It returns custom data for connected Room\u2019s Owner-Ref.<\/li>\n\n\n\n<li>With \u201croom\u201d scope, no further qualifier is needed. It returns custom data for connected Room.<\/li>\n\n\n\n<li>With \u201cuser\u201d scope, \u201cuser_ref\u201d will also be used to get custom data for that user.<\/li>\n\n\n\n<li>With \u201csession\u201d scope, optionally either \u201csession\u201d or \u201cconf_num\u201d qualifier be used to get data for requested sessions. If neither is used, it returns current session data.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>user_ref<\/code><em>:<\/em>\n<ul>\n<li><em>It<\/em> is required with \u201cuser\u201d scope. It returns custom data for the given user_ref.<\/li>\n\n\n\n<li>It is option with \u201csession\u201d scope. It returns session data for the given user_ref.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>session<\/code>: It is used with \u201csession\u201d scope. Optional. Values:\n<ul>\n<li>\u201call\u201d &#8211; for all session data of the same room.&nbsp;<\/li>\n\n\n\n<li>\u201clast\u201d \u2013 for last session data of the same room.&nbsp;<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>conf_num<\/code>: It is used with \u201csession\u201d scope. Optional. It takes the conf_num of session for which data is needed.<\/li>\n<\/ul>\n<\/li><\/ul>\n\n\n\n<p><strong>Example: scope=user<\/strong><\/p>\n\n\n\n<p>Please note the Options input may have different keys for querying different scope. To get user \u201cXOXO\u201d data, use the following option:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">var Options = {\t\n\t\"scope\": \"user\",\n\t\"user_ref\": \"XOXO\"\t\n}<\/pre>\n\n\n\n<p>You receive following response:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\t\"result\": 0,              \n\t\"clientId\": \"\",             \n\t\"name\": \"\",                  \n\t\"user_ref\": \"\",              \n\t\"role\": \"participant\",       \n\t\u201cdata\u201d: {\t\/* This is your own Data *\/\n\t\t\u201ccustom_data1\u201d: \u201cString\u201d,\n\t\t\u201ccustom_data2\u201d: \u201cString\u201d,\n\t\t\u201cin_session_new_data\u201d: \u201cString\u201d, \n\t\t\u201cin_session_new_data\u201d: \u201cString\u201d  \n\t}\n}\n<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Set &amp; Reset Data<\/h3>\n\n\n\n<p>Use the following method to set, update data of different scope in the Video Session.  <\/p>\n\n\n\n<p><strong>Method:<\/strong> <code>setCustomData(scope, data, callback)<\/code><\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>scope<\/code>: Enumerated values: <code>user<\/code>, <code>room<\/code>, <code>session<\/code>. Each scope, will have different \u201c<code>data<\/code>\u201d structure.<\/li><li><code>data<\/code>: JSON Object related to scope.&nbsp;<\/li><\/ul>\n\n\n\n<p><strong>Example: <\/strong>\u201c<code>data<\/code>\u201d parameter for scope \u201c<code>user<\/code>\u201d. This is executed from end point to affect the connected user\u2019s data only.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">var data = {\n\t\"custom_data1\": \"String\",\t\t\/\/ update\n\t\"custom_data2\": \"String\",\n\t\"in_session_new_data\": \"String\",\t\/\/ new\n\t\"in_session_new_data\": \"String\"\n}<\/pre>\n\n\n\n<p><strong>Example<\/strong>: E.g. \u201c<code>data<\/code>\u201d parameter for scope \u201c<code>session<\/code>\u201d. This is executed from any end point to affect current session only<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">var session_data = {\n\t\"poll\": {\n\t\t\"question: \"String\",\t \n\t\t\"options\": [{\n\t\t\t\"opt\": \"String\",\n\t\t\t\"response\": Number\t\n\t\t}]\n\t}\n}\n<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Save data to Data Store<\/h3>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Refer in detail<\/h3>\n\n\n\n<p>To read detailed implementation in different SDKs, follow the links given below:<\/p>\n\n\n\n<ul><li><a href=\"#\">Web SDK<\/a><\/li><li><a href=\"#\">Android SDK<\/a><\/li><li><a href=\"#\">iOS SDK<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>You can use Video Service to save Application data related to your Video Room, Owners, Users and Sessions. These data can be retrieved later in-session and post-session through API Call Table of Contents Overview This is a limited data storage service from Video using which application developers can build Video Room based utilities that requires in-session data flow and across session data persistency. This is a Subscription based Service. Basic&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":116,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"You can use Video Service to save Application data related to your Video Room, Owners, Users and Sessions. These data can be retrieved later in-session and post-session through API Call Table of Contents Overview This is a limited data storage service from Video using which application developers can build Video Room based utilities that requires&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/7231"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=7231"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/7231\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/116"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=7231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}