{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"d31118e0-24ea-a4f6-3443-8909f562d29e","name":"KG - Poker API","description":"## Introduction\n\nThis document describes the general informations about how to call the api methods.\n\n## Test Stage URLs\n\n- **API Service (staging) URL:** [http://apiv3.test.ktestworks.com/](http://apiv3.test.ktestworks.com/)\n    \n\n### First Steps\n\nBefore you start, please remember;\n\n- Our API Server only responds to our merchants' IP addresses for security reasons. Contact us for your server's IP authorization,\n    \n- You can use only **POST** method for your API requests,\n    \n- You need to generate hash for every API request you send, examples of generating hash for your API requests are in next section,\n    \n- Every response have '_status_', '_code_', '_responseDate_' and '_elapsedTime_' fields by default,\n    \n- You can specify your request response's data type as **XML** or **JSON**,\n    \n- You must generate hash for every API request.\n    \n\n### Generating Hash\n\nBefore sending your request to our API server you need to create an hash password combining your request parameters with your private key and include it in your request parameters.\n\n**You may choose either token (generateToken) or hash validation on test stage. We highly recommend you to make sure that hash validation is integrated, works as expected before production environment.**\n\nThis is an example of how you should use your parameters to create your hash password and send it to API server;\n\nDefine your request URL, combine your method, merchant id, parameters (in this example we got 2 parameters), parameters' values and at last your private key. Use  \n**md5** function to encode this combination and add this md5 encoded string value to your request url's as values of hash parameter. Then you are ready to send your request.\n\n```\n  /*\n  * Generating hash and request url with PHP\n  */​\n  $privateKey = '1x5hs+kbRH';\n  $requestURL = 'https://apiv3.test.ktestworks.com/?method=testConnection&merchantId=101&parameter1=value1&responseType=json';\n​\n  $createdHash = md5('testConnection' . '101' . 'value1' . 'json' . $privateKey);\n  $requestURL = $requestURL . '&hash=' . $createdHash;\n\n ```\n\n### Ip Address Verification\n\nPlease contact us if you receive the error response below;\n\n```\n\"response\": {\n    \"status\": \"failed\",\n    \"code\": 1,\n    \"message\": \"Access Denied\",\n    \"responseDate\": \"1400240221\",\n    \"elapsedTime\": \"0.0532\"​\n  }\n\n ```\n\n### Change Logs\n\n**API V3.0.1 (11.10.2021)**\n\n- GET method usage deprecated\n    \n\n**API V2.8.1 (11.08.2017)**\n\n- [banUserChat](#banUserChat()) method added\n    \n\n- defined max allowed character size (12) for username on [createMember](#createMember()) method\n    \n\n**API V2.8 (13.05.2017)**\n\n- [getTotalRakeByMemberUsername](#getTotalRakeByMemberUsername()) method added\n    \n\n- added new parameter **includeGameBalance** to retrieve game balance for [getMemberBalance](#getMemberBalance()) method\n    \n\n- minor bug fixes, code optimizations\n    \n\n**API V2.7 (27.03.2017)**\n\n- [getMemberDataByExtId](#getMemberDataByExtId()) method added\n    \n\n- [getMemberTournamentFee](#getMemberTournamentFee()) method added\n    \n\n- minor bug fixes, code optimizations\n    \n\n**API V2.5 (21.01.2017)**\n\n- added new parameter **mobile** to retrieve mobile game url for [createLobbyURL](#createLobbyURL()) method\n    \n\n- minor bug fixes, code optimizations\n    \n\n**API V2.1 (01.11.2016)**\n\n- updateMemberUsername method **deprecated**\n    \n\n- createLobbyToken method **deprecated**\n    \n\n- connectLobby method **deprecated**\n    \n\n- **state** parameter has changed as required on updateMember method\n    \n\n- [createLobbyURL](#createLobbyURL()) method added\n    \n\n**API V2.0 (10.11.2014)**\n\n- The important change is Draw Method on this API. Please be carefull when you are using this method. Please see [drawRequest()](#drawRequest()) method for details.\n    \n- Some of API Method names have been changed.\n    \n\n- Added new parameters to output of some methods.\n    \n- Added **JSON** output option.\n    \n\n### Error Codes\n\n| Code | Description |\n| --- | --- |\n| 0 | Success |\n| 1 | Access Denied. Your IP Address (_{VARIABLE}_) is not in our White List. |\n| 2 | No method selected. |\n| 3 | Invalid method. |\n| 4 | Invalid hash. |\n| 5 | No such user. |\n| 6 | Password is incorrect. |\n| 7 | User balance not found. |\n| 8 | Unexpected database error while adding Balance Change. Method: Deposit |\n| 9 | Unexpected database error while updating user balance. Method: Deposit |\n| 10 | Unexpected database error while creating draw record. |\n| 11 | You cannot use this Username. Username already exists. |\n| 12 | Error while creating new user. Please check fields and try again. |\n| 13 | Error while creating deposit process: TransactionID exists. |\n| 14 | Error while creating draw process: TransactionID exists. |\n| 15 | Balance is not enough. Please check amount. Method: Draw |\n| 16 | Error while create security token. |\n| 17 | Game log not found. |\n| 18 | Transaction not found. |\n| 19 | Balance is not enough. Please check amount. Method: _{VARIABLE}_ |\n| 20 | Member is inactive |\n| 98 | Active Game not found. |\n| 99 | Error while changing member status. |\n| 100 | HASH string is not found. |\n| 200 | Required fields (_{VARIABLE}_) cannot be empty, please check your fields. |\n| 201 | You are not allowed to call this method. |\n| 202 | _{VARIABLE}_ field cannot be empty. Do not send the parameter if you do not want to update |\n| 501 | Please contact with provider |\n| 801 | Deposit limit has been exceeded |\n| 802 | Draw limit has been exceeded |\n| 805 | Member has been banned |\n| 700 | External system error - _{VARIABLE}_ |\n| 795 | Invalid username length (max 12 character) |\n| 796 | (_{VARIABLE}_) field must have an integer value and must be equal or greater than %u. |\n| 797 | (_{VARIABLE}_) field must have an integer value and must be between %u and %u values. |\n| 798 | Could not contact with provider. Please try again later. |\n| 799 | (_{VARIABLE}_) field must have an integer value. |\n| 800 | This method is deprecated. |\n| 888 | Merchant is not active. Please contact with API Service provider. |\n| 889 | Invalid character(s) in username, please update your username with a new proper one |\n| 890 | Invalid character(s) in username |\n| 891 | Invalid amount value |\n| 892 | Merchant is not found with this domain |\n| 893 | Error while creating token |\n| 894 | Invalid connectionId |\n| 895 | Expired token |\n| 896 | Invalid token |\n| 897 | Members cannot draw/deposit money while playing games |\n| 898 | State field's value must be 'activate' or 'suspend' |\n| 899 | Game not found |\n| 975 | GameType field's value must be 'oh' or 'tp' or 'th' |\n| 976 | You can't draw while you are online on games. Please close games and retry again. |\n| 977 | GameType field's value must be 'ok' or 'oh' or 'tp' or 'th' or 'bg' |\n| 978 | Your query must include %d days or less date sequence |\n| 979 | (_{VARIABLE}_) field must contain valid date value |\n| 980 | TransactionType field's value must be 'deposit' or 'draw' |\n| 981 | Member's RakeBack amount is zero |\n| 982 | Member is not active |\n| 983 | TransactionId field must be unique |\n| 984 | Merchant ran out of weekly deposit risk limit |\n| 985 | Amount field must be greater than 0 |\n| 986 | Amount field must be numeric |\n| 987 | Please insert a value to parameter (_{VARIABLE}_) to update member or do not set the parameter |\n| 988 | No data recieved: (_{VARIABLE}_) |\n| 989 | Member with (_{VARIABLE}_) username could not be found |\n| 990 | Invalid character (\\~) in member username, do not use prefix for your members' username |\n| 991 | Member could not be created, please try again later |\n| 992 | Username field must be unique, (_{VARIABLE}_) username is already exists, please pick another username |\n| 993 | IP Address field must be a valid IP address |\n| 994 | Email field must be a valid email address |\n| 995 | Username field must be at least 3 character long |\n| 996 | Password field must be encrypted with sha1 algorithm |\n| 997 | No parameters recieved |\n| 998 | Merchant is not found |\n| 999 | Method not found |","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"3457664","team":85483,"collectionId":"d31118e0-24ea-a4f6-3443-8909f562d29e","publishedId":"7LuZypF","public":true,"publicUrl":"https://apidoc.klassrv.com","privateUrl":"https://go.postman.co/documentation/3457664-d31118e0-24ea-a4f6-3443-8909f562d29e","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","version":"8.11.6","publishDate":"2018-08-17T16:17:22.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Poker Testing","id":"8df5295d-1ffc-4bba-8ed8-bc734d99265f","owner":"3457664","values":[{"key":"testing_base_url","value":"http://apiv3.test.ktestworks.com","enabled":true},{"key":"test_token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElkIjoiMjM3IiwiaWF0IjoxNzE2MzkzOTI0LCJleHAiOjE3MTY0MDExMjR9.PqjDLfeBivQ25QfEdpybVt5WRsxfR7bPcV2Biw1La20","enabled":true},{"key":"test_username","value":"newtest2","enabled":true},{"key":"test_merchant_id","value":"237","enabled":true},{"key":"prod_base_url","value":"http://api.newpoker.klasgaming.com/","enabled":true},{"key":"testing_callback_url","value":"http://seamless.test.ktestworks.com","enabled":true},{"key":"test_merchant_id_sv2","value":"419","enabled":true,"type":"default"},{"key":"test_merchant_secret_sv2","value":"ETGmJxlCuPNh","enabled":true,"type":"default"},{"key":"operators_seamless_url","value":"https://operators.base.url/","enabled":true,"type":"default"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/3c52a4032075d00582fb1c197f94180d965f638b73c127c3cfd4575ee1587c0d","favicon":"https://klassrv.com/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Poker Testing","value":"3457664-8df5295d-1ffc-4bba-8ed8-bc734d99265f"}],"canonicalUrl":"https://apidoc.klassrv.com/view/metadata/7LuZypF"}