{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"e28f6e64-c8e0-f2ac-67be-58854e4ca203","name":"Freeplay API","description":"## Introduction\n\nThis API offers the possibility to create Freeplay tokens to selected users.\n\n## Request\n\nOur server will use JSON as the request body format to be consistent with responses. \n\n## Response format\n\nResponses will always be in JSON format.\n\n## Authentication\n\nAll endpoints in this API requires authentication in order to be accessed.\n\nAuthentication is HMAC-signature based.\nUpon registering as a partner with Colossus Bets, you'll receive an `api_auth_key` and an `api_auth_secret`.\n\nPlease follow the steps below to sign your requests.\n\n### Request Headers\n\nThere are some important headers that needs to be provided in all your requests:\n\n* Date: this is the HTTP timestamp of the request in the RFC 1123/2822 Internet Standard. For security reasons, our API will reject the request when the HTTP timestamp is too much in the past (currently set to 15 minutes max).\nValue example: `Mon, 23 Jan 1984 03:29:56 GMT`.\n\n* Authorization: this is the header that will contain the HMAC signature. The format will be `APIAuth-HMAC-SHA256 {{api_auth_key}}:{{signature}}`. You'll need to substitute `api_auth_key` and `signature`. The former will be provided by us while the latter will need to be calculated (see below in Signature Generation paragraph).\n\n* (Optional) Content-MD5: this is the standard header which is the Base64 encoding of the MD5 hash of the request body. It's optional in case of an empty body or a GET request.\n\n* (Optional) Content-Type: this is the standard header which will tell the api how to read the request body. It's optional in case of an empty body or a GET request.\n\n### Signature Generation\n\nIn order to calculate the signature, you'll first need to generate the `canonical string`. The format for it is the following:\n\n`{{HTTP_METHOD}},[Content-Type],[Content-MD5],{{RequestURI}},{{Date}}`\n\n* HTTP_METHOD: this is the HTTP Method of the request, uppercase. Can be `GET, POST, DELETE` or any other HTTP method.\n* RequestURI: this is the `path` part of your request URL, including the querystring parameters.\n* Content-Type, Content-MD5 and Date: these are the same values of the 3 headers with the same name, if present.\n\nThe elements between `{{ }}` are mandatory, while the ones between `[ ]` are optional. All commas are mandatory, even when an element is missing.\n\nOnce you calculated the canonical string based on the request, you can proceed calculating the signature from it. This can be achieved with the following 2 steps:\n\n1. Calculate the SHA256 HMAC hash of the canonical string using your `api_auth_secret` (provided by us).\n2. Encode the resulting hash using Base64 encoding.\n\n### Example\n\nWe'll now guide you through an example for a request authentication.\n\nLet's assume Colossus Bets provided you with the following details:\n\n| Variable          | Value        |\n| ----------------- | ------------ |\n| `api_auth_key`    | api_key      |\n| `api_auth_secret` | api_secret   |\n\nLet's assume that for this test we want to call the `POST /F2PConsole/api/FreeToPlay/GiveTokensToUsers` endpoint and the body of the request will be something like:\n\n\n```json\n[\n    {\n        \"user_id\" : \"john23\",\n        \"plays\" : \"2\"\n    },\n    {\n        \"user_id\" : \"amy27\",\n        \"plays\" : \"1\"\n    },\n    {\n        \"user_id\" : \"2376890\",\n        \"plays\" : \"2\"\n    }\n]\n```\n\n\nWe will then calculate the content-MD5 header, from the body (`y1OKcElbEvKAljAHcXtwEA==`) and we should compute the following canonical string: `POST,application/json,y1OKcElbEvKAljAHcXtwEA==,/f2pconsole/api/freetoplay/givetokenstousers,Thu, 22 Mar 2018 15:23:15 GMT`,  from which we can calculate the Base64 encoding of the SHA256 HMAC hash, using the `api_secret`, which give us `oapdEIG5iqI7a/9POrbLUuC4i2PAgQxYBKGWZYWWd6U=`. The final `Authorization` header will then be: `APIAuth-HMAC-SHA256 api_key:oapdEIG5iqI7a/9POrbLUuC4i2PAgQxYBKGWZYWWd6U=`.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"1255977","team":29398,"collectionId":"e28f6e64-c8e0-f2ac-67be-58854e4ca203","publishedId":"6YzuD1s","public":true,"publicUrl":"https://apifreeplaydocs.colossusbets.com","privateUrl":"https://go.postman.co/documentation/1255977-e28f6e64-c8e0-f2ac-67be-58854e4ca203","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","version":"8.10.0","publishDate":"2018-04-04T14:55:59.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"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/c2666d78390ab3fa924b4024acb7cc32cfe82699f20434f9e4e315f85b2684a7","favicon":"https://colossusbets.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"}],"canonicalUrl":"https://apifreeplaydocs.colossusbets.com/view/metadata/6YzuD1s"}