Delete or Update Session Through API
Create a new API rule (similarly to https://synthesisvr.com/knowledge-base/reading-leaderboard-through-api/) or edit an existing one and assign the “customers” permission. HTTPS POST Request: https://api.synthesisvr.com/data/sessions/<API_KEY>/<ACTION>/<SESSION_UUID> Example: https://api.synthesisvr.com/data/sessions/11111111-1111-1111-1111-111111111111/update/22222222-2222-2222-2222-222222222222 https://api.synthesisvr.com/data/sessions/11111111-1111-1111-1111-111111111111/delete/22222222-2222-2222-2222-222222222222 ACTION= update OR delete Update HTTPS POST PARAMETERS: date=2030-01-01 — mandatory — specify new date for the session time=15:30 — mandatory — specify new time duration=60 — optional — specify new duration people=2 — optional — specify the number of involved stations experience=1 — optional — specify the experience type id Note — there are no HTTPS POST parameters for the “delete” action.
Synthesis VR API – Gift Cards
1. Create a new API rule (similarly to https://synthesisvr.com/knowledge-base/reading-leaderboard-through-api/) or edit an existing one and assign the following permission: Gift Cards Important — SynthesisVR RECOMMEND using the “Strict Access” option and limit the endpoint access to your trusted IP addresses. Generate new Gift Card: 2. Get the key for the rule and construct an HTTP GET request like this: https://api.synthesisvr.com/data/giftcard/<KEY>/generate/<AMOUNT>/<EXPIRE_PERIOD> Example: https://api.synthesisvr.com/data/giftcard/11111111-1111-1111-1111-111111111111/generate/15.50/2 months Response data: { “code”: “REO6CUWR”, “valid”: “2018-02-22T00:00:00”, “amount”: 15.50, “status”: 1 } Delete an unused Gift Card: 3. Construct an HTTP GET request: https://api.synthesisvr.com/data/giftcard/<KEY>/delete/<CODE> Example: https://api.synthesisvr.com/data/giftcard/11111111-1111-1111-1111-111111111111/delete/REO6CUWR
Reading Survey Data Through API
To programmatically read the Survey data collected by SynthesisVR, please follow the steps: 1. Login into SynthesisVR with your administrator account and navigate to: 2. Click on the API & Webhooks tab and then click on the + sign in the top right: Make sure the Survey permission is assigned.If the “Strict Access” option is enabled, you will be able to access the collected data ONLY from an IP address associated with your location. 3. Prepare the following URL: https://api.synthesisvr.com/data/survey/<API_KEY>/<START_DATE>/<RATINGS> Example: https://api.synthesisvr.com/data/survey/11111111-1111-1111-1111-111111111111/2019-06-01/4,5 Upon refreshing the Widgets page, you’ll be able to locate your API key: START_DATE — use the YYYY-MM-DD format. The results you’ll get would be related only for surveys filled from the given data onwardRATINGS — comma-separated list of the rating results you would like to receive. This allows filtering out the negative ratings. Extracting Survey data based on date:. Prepare the following URL: https://api.synthesisvr.com/data/survey/bydate/<API_KEY>/<START_DATE>/<RANGE> Example: https://api.synthesisvr.com/data/survey/bydate/11111111-1111-1111-1111-111111111111/2019-06-01/1%20year
Synthesis VR API – Local API
The local API is a special URL that runs on every of your VR stations and can be used for building third-party services and functionalities. The API URL is: http://localhost:8080/control/<API_COMMAND> Commands: Command Description status Provides a way to check the if SynthesisVR is running well. It should contain “status”:1 in the response status/hmd Represents if the HMD is currently connected to SteamVR. Returns true or false status/controllers Returns the status of all connected controllers – their battery level, if they are currently charging and if they are wireless controllers status/hmdreboot Stops SteamVR, awaits for 15 seconds and starts SteamVR idleplayback/(true|false) Enables/Disables the Idle Playback functionality
Webhooks
What is Webhook? Webhooks are an incredibly useful and resource-light way to implement event reactions. Webhooks provide a mechanism whereby a server-side application can notify a client-side application when a new event (that the client-side application might be interested in) has occurred on the server. Webhooks are also sometimes referred to as “Reverse APIs”. In APIs, the client-side application calls (consumes) the server-side application. Whereas, in the case of webhooks it is the server-side that calls (consumes) the webhook (the end-point URL provided by the client-side application), i.e. it is the server-side application that calls the client-side application. Webhooks operate on the concept of “event reaction” (don’t call me, I’ll call you if I have something new), and thus avoids the need for constant polling of the server-side application by the client-side application. Thus, rather than the client-side application constantly polling the server-side application to check for new events, the server-side application calls the client-side application (by invoking a client provided webhook URL) anytime the server-side has something new to report to the client. Webhooks and SynthesisVR The webhooks support is the only allowed way to receive events from Synthesis “as they happen”. The Webhook configuration can be found under: Administration >> Advanced Settings –> the “Online & Email Settings” dropdown >> Web Widgets & API –> the “API & Webhooks” tab. All events are HTTP POSTed to the related webhook URL. The URL must start either with http:// or https:// (preferred). Your webhook handler has to respond within 2 seconds and the response is ignored by Synthesis. Synthesis won’t attempt resending the webhook if your webhook endpoint isn’t reachable. All webhook events consist of JSON data. One HTTP POST message may contain an array of multiple webhooks. JSON SCHEMES: SESSION WEBHOOK uuid — the Synthesis session id. It can be used for obtaining more information through the sessions API (https://synthesisvr.com/knowledge-base/reading-session-data-through-api/ — use the uuid: search option) action — possible values: create – upon creation of the session delete – upon removal of the session location — contains your location title. If you need to distinguish between multiple locations, you better configure unique webhook URLs rather than rely on the location title. It is included just your webhook reading experience more pleasant 🙂 stations — provides the number of stations in session customerid — the ID of your customer. The full customer profile can be fetched through the customers API (https://synthesisvr.com/knowledge-base/reading-customers-data-through-api/ — use the id value as a search parameter) Examples: [{“uuid”: “41509791-3de8-5bb9-b4fc-a9753da95aad”, “action”: “create”, “location”: “Kamen Test”, “stations”: 1, “customerid”: 7685}] [{“uuid”: “41509791-3de8-5bb9-b4fc-a9753da95aad”, “action”: “delete”, “location”: “Kamen Test”, “stations”: 1, “customerid”: 7685}] More webhook options will come as the need of them emerge. If you have any specific request. please let us know: info@synthesisvr.com
Synthesis VR API – Booking Widget
API As explained, the booking widget just utilizes the API and gives a ready to use example. However, in many cases, that may not be enough and as you may want to better match your website design, integrate your own payment processor, use a different language and so on. What usually would be enough is to open the widget page, copy all the source code in your own site and start editing the HTML / Javascript. However, this still may not be sufficient for some of you, so here comes the direct API integration. If you are not a developer and you don’t have such on hand, please stick to the widget. The next would just confuse you unnecessary. API CALL – AVAILABILITY URL = https://api.synthesisvr.com/ Method = GET Resource = /web/<public_key>/availability Accepted parameters: Parameter Format Description people Integer the number of VR stations you wants to book experience Integer the id of the experience type. If not provided, SynthesisVR would use the first experience type that is assigned on the widget date String ; YYYY- MM-DD A date that isn’t in the past duration Integer a duration that exists under your work hour rules customer_token String (optional) A token obtained via the /web/<public_key>/customers/auth API call JSON Response: Name Type Description balance String Shows the balance for the given customer_token or $0.00 if no balance is available coupons Array Shows the available vouchers against the given customer_token. Some vouchers may not appear if they are not allowed for the desired “people” ; “experience” ; “date” and “duration” parameters dows Integer Array From 0 to 6. Points to the days of the week when reservations can be booked. 0 = Monday ; 6 = Sunday special_days Array If a day of the week is disabled via the dows parameter, but there are exceptions. stations Key – Object pairs The key refers to experience type id. Check the “Experience Type Object” for the object values. times Key – Object pairs Represents the daily availability. Check the “Availability Object” for detailed description. Experience Type Object: Name Type Description book_all Boolean This reservations requests to book all stations. descr Text Description of the experience type durations Integer Array Available durations in minutes pcs String Array The SynthesisVR IDs of the VR stations pos Integer If there are multiple experience types – the position of the current one stations Integer The total number of PCs under this experience type title String Title of the experience type Availability Object: Name Type Description cost Float The final cost to be charged per station endTimePre Timestamp – ISO 8601 A timestamp object pointing to when the session would end moreOptions Key – Object pairs Additional paid options for the current object precost Float The cost per station before discounts startTime String The startTimePre parameter in a human readable format startTimePre Timestamp – ISO 8601 A timestamp object pointing to when the session would start stations Integer The number of available (free) stations. value Time String – format HH:MM The “time” value to be used with the /web/<public_key>/book API call API CALL – VALIDATE EMAIL URL = https://api.synthesisvr.com/ Method = POST Resource = /web/<public_key>/customers/validateEmail Accepted parameters: Parameter Format Description email String (optional) Email string to validate JSON Response: Name Type Description status Boolean True = there is a customer with such email address. You could proceed to authentication. False = no such customer exists. You could proceed with a signup process API CALL – CUSTOMER AUTHENTICATION URL = https://api.synthesisvr.com/ Method = POST Resource = /web/<public_key>/customers/auth Accepted parameters: Parameter Format Description email String Email string to authenticate password String (optional) Password related to the given email service String (optional) The name of an authentication service. Example: “facebook” serviceString String (optional) The value to be authenticated for the given service string. JSON Response: Name Type Description cc String Last 4 digits of the CC associated with the account (e.g. XXXX1234) msg String Text description of the API call result name String Customer name pm String “0” = No payment method and no CC data collection is needed status Integer 1 = Authenticated ; 0 = Invalid credentials token String A string to be used with the AVAILABILITY and BOOK API calls API CALL – CUSTOMER CREATION URL = https://api.synthesisvr.com/ Method = POST Resource = /web/<public_key>/customers/create Accepted parameters: Parameter Format Description email String Email string to authenticate password String (optional) Password related to the given email service String (optional) The name of an authentication service. Example: “facebook” serviceString String (optional) The value to be authenticated for the given service string. name String Full customer’s name additional JSON key-value pairs Additional information to keep per customer. Example: {“birthday”:”1st April, 1985″,”phone”:”12135559999″} The API response is the same JSON as for: /web/<public_key>/customers/auth API CALL – CUSTOMER UPDATE CC URL = https://api.synthesisvr.com/ Method = POST Resource = /web/<public_key>/customers/updateCC Accepted parameters: Parameter Format Description customer_token String The token obtained from an “auth” or “create” API call json JSON key-value pairs The complete CC data. See below for field description. Note: the key-value pairs may vary between the payment processors JSON Response: Name Type Description status Integer 1 = Success ; 0 = Failure, use “msg” to lookup the error msg String Text description of the error. PayPal Here – JSON object: Name Type Description credit_card Integer 1 = Success ; 0 = Failure, use “msg” to lookup the error security_digits String Text description of the error. exp_date1 Integer CC expiration Month exp_date2 Integer CC expiration Year first_name String First Name last_name String Last Name cardholder_address String Address of the CC owner cardholder_city String City cardholder_country String Country cardholder_state String State cardholder_zip String ZIP code cardholder_phone String Phone number API CALL – CUSTOMER ASSIGN VOUCHER URL = https://api.synthesisvr.com/ Method = POST Resource = /web/<public_key>/customers/assignVoucher Accepted parameters: Parameter Format Description customer_token String The token obtained from an “auth” or “create” API call code String The voucher / coupon code JSON Response: Name Type Description status Integer 1 = Success ; 0 = Failure, use “msg” to lookup
Online Waivers
1. Create a new API rule (similarly to https://synthesisvr.com/knowledge-base/reading-leaderboard-through-api/) or edit an existing one and assign the following two permissions: Online Waiver Website Games 2. Get the key for the rule and construct an URL like this: Version 1: https://api.synthesisvr.com/waiver/<KEY> Version 2: https://api.synthesisvr.com/waiver/group/<KEY> Example: Version 1: https://api.synthesisvr.com/waiver/11111111-1111-1111-1111-111111111111 Version 2: https://api.synthesisvr.com/waiver/group/11111111-1111-1111-1111-111111111111 Version 2 OFFLINE: https://api.synthesisvr.com/waiver/offline/11111111-1111-1111-1111-111111111111 You can add custom waiver fields by going to “Administration” and click on your arcade name. Switch to the “Advanced” tab and click on “Additional Waiver Fields”.If you need deeper customization for the online waiver, you can open the URL constructed above and use the browser’s “View Source” option. Copy the source code onto your server/web site and use HTML and CSS to customize the waiver widget. The OFFLINE version is intended for use only inside your location. It allows the browser to load and process the waiver even when your device is completely offline. All signed forms will be stored inside the browser and will be synchronized to SynthesisVR within a minute of your device getting back online and the offline waiver page being reloaded.
Reading Sessions & Goods Data Through API
1. Create a new API rule (similarly to https://synthesisvr.com/knowledge-base/reading-leaderboard-through-api/) or edit an existing one and assign the “customers” permission. 2. The customers data is available in both – JSON and XLSX formats. HTTP GET Request: The result is suitable for automation in third party tools and backends. https://api.synthesisvr.com/data/<ENDPOINT>/<API_KEY>/<TYPE>/<RANGE>/<SEARCH CRITERIA> Example: https://api.synthesisvr.com/data/sessions/11111111-1111-1111-1111-111111111111/json/1 day/date=2019-07-12 ENDPOINT = sessions OR goods TYPE = json OR xlsx RANGE = indicates how many days should be returned after the main date (which can be set through the search criteria). The range value consist of an integer value (1) and a period string (hour ; day ; month ; year). Combinations are possible as well: 1 month 5 days 2 months 3 days 1 day 8 hours SEARCH CRITERIA = a space separated string. Support the following options: date=[YYYY-MM-DD] — specifies the start date for the RANGE value (mandatory in the common case) date>[YYYY-MM-DD] — equal or great than the specified date date<[YYYY-MM-DD] — equal or less than the specified date crdate=[YYYY-MM-DD] — search by creation date today — considers the current date upcoming — any reservation that isn’t yet used skip_api — ignore all sessions created through the API (i.e. skip all sessions booked online) api_only — return only the online session customer:[ID] — obtain results for a specific customer account label:[ID] — obtain results based on a label(tag) ID uuid:[UUID] — lookup a specific session by its SynthesisVR Session ID externaluuid:[UUID] — lookup one or more sessions by an external UUID (supplied to Synthesis at creation time) [free text] — can be used to search based on customer name, email address, phone number and other specific information. It doesn’t require a prefix as with the options above. comments — extract the comments data (only for JSON exports) phone — include the customer phone number to the export Note: Anything described above as [something] have to be replaced with the actual value you are looking for.
Reading Customers Data Through API
1. Create a new API rule (similarly to https://synthesisvr.com/knowledge-base/reading-leaderboard-through-api/) or edit an existing one and assign the “customers” permission. 2. The customers data is available in both – JSON and CSV (comma separated) formats. 3. You can call search queries and fetch JSON results ———————— JSON: The result is suitable for automation in third party tools and backends. To obtain the JSON data, prepare the following URL: (HTTP GET) https://api.synthesisvr.com/data/customers/<API_KEY>/json Example: https://api.synthesisvr.com/data/customers/11111111-1111-1111-1111-111111111111/json ———————— JSON SEARCH: To obtain the JSON data, prepare the following URL: (HTTP GET) https://api.synthesisvr.com/data/customers/<API_KEY>/search/<SEARCH> Example: https://api.synthesisvr.com/data/customers/11111111-1111-1111-1111-111111111111/search/email@domain.com ———————— CSV: As long the JSON provides all the customer information, the CSV can be formatted to a file, ready for manual important into a third party systems (e.g. email lists). The request URL will be of the type: (HTTP GET) https://api.synthesisvr.com/data/customers/<API_KEY>/csv/<PARAMETERS> Example: https://api.synthesisvr.com/data/customers/11111111-1111-1111-1111-111111111111/csv/fullname,email,phone The output file will be ordered according to your web request. Possible parameters: id = the Synthesis account id email = customer’s email address in lowercase fullname = capitalized customer’s name phone = self explanatory balance = any customer balance held by Synthesis widget = the widget used by the customer to subscribe sessions = the number of sessions for the current customer (combines previous and upcoming) regdate < or = or > = extract customers based on date of registration. The date format is YYYY-MM-DD [ANY custom field] = the identifier of the custom fields defined for the location To request more parameters, please shoot us an email to info@synthesisvr.com ———————— Profile Update (2022-11-18): You can update customer profiles by performing HTTP POST request against the following URL: (HTTP POST) https://api.synthesisvr.com/data/customers/<API_KEY>/<CUSTOMER_ID> All the new data should be in JSON format. The final JSON object is stringified and included in the request’s BODY with the “values” parameter. Example raw HTTP POST request: POST /data/customers/11111111-1111-1111-1111-111111111111/123456789 HTTP/1.1 Host: api.synthesisvr.com Content-Type: application/x-www-form-urlencoded Content-Length: 43 values=%7B%22language%22%3A%22english%22%7D You can include as many JSON key-value pairs as needed.
Reading Leaderboard Through API
To programatically read the leaderboard data collected by SynthesisVR, please follow the steps: 1. Login into SynthesisVR with your administrator account and navigate to: 2. Head to the API & Webhooks tab and click on the + button on the top right: Make sure the leaderboard permission is assigned.If the “Strict Access” option is enabled, you will be able to access the collected data ONLY from an IP address associated with your location. 3. Prepare the following URL: Example: Upon refreshing the Widgets page, you’ll be able to locate your API key: Game ID — keep it to 0 (zero) if you want to fetch information about all the collected games. Based on that response, you’ll be able to see and use specific game idsDuration — any combination of <number> + <period>. Examples: The API response data is formatted as JSON and have the following structure: The “score” object itself contains:info = raw data extracted from the game (differ between the games)score = SVR attempt to recognize and extract the score from the info objectcustomer = the customer associated with the SynthesisVR session. In a multi-station session, the data don’t necessary correlate with the actual player.utcepoch = the UTC epoch when the leaderboard record is logged (you can look up the exact date/time in any programming language ; online example: https://www.epochconverter.com/)