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  

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  

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