Webshop API

From BetgamesTV
Jump to navigation Jump to search

Create Autologin Link

Creates autologin link for further request to login to webshop.


POST https://api.betgames.tv/s/api/v2/webshop/auth




Content-Type: application/json




POST  https://api.betgames.tv/s/api/v2/webshop/auth
 "hash": "hash('sha256', $secret_key . $partner_id)",
 "id": 12345,
 "shop_name": "Vilnius, Gedimino pr. 5",
 "pos_name": "Computer #3",
 "user_name": "John Smith"

Betshop, Pos and Pos user will be created automatically if they don't exist.

Key Values Details
hash hash('sha256', $secret_key . $partner_id) Required.
id Partner ID Required.
shop_name Betshop name Required. Unique for current partner
pos_name Point of Sales name Required. Unique for current Betshop
user_name User name Required. Unique for current Point of Sales










Success Example:

 "data": {
   "url": "https://webshop.betgames.tv/webshop/integrations/auth/login/:id/:token",
   "shop_id": 6202,
   "pos_id": 6228,
   "user_id": 6280
Key Description
data array - data after successful response
url URL which should be used to autologin as requested Betshop/PoS/User
shop_id ID in Betgames system of created/existing Betshop which was requested
pos_id ID in Betgames system of created/existing PoS which was requested
user_id ID in Betgames system of created/existing User which was requested









Error Example:

 "error": {
   "code": 400,
   "message": "Incorrect hash"
Status Description
200 Response successful
400 Incorrect request, invalid hash or partner_id, bad json format






Params Values
error array - error block (only on unsuccessful response)
code number - response status code
message string - message about invalid request







Login user with given URL from https://webshop.betgames.tv/webshop/integrations/auth request. If URL is valid, user will be logged in and redirected to webshop page. URL should be used in iframe or webview tag as src attribute.


GET https://webshop.betgames.tv/webshop/integrations/login/:id/:token




Params Values
id number - POS user_id
token string - token 64 characters long






Redirected to webshop page if url is valid, otherwise to login page.