{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Getting started with the Spigo API","type":"basic","slug":"getting-started","excerpt":"This page will help you get started with Spigo. You'll be up and running in a jiffy!","body":"The Spigo Platform offers a two-way API based on REST, with JSON as data format and UTF-8 as character encoding.\n\nTo use the API, the employed programming language must be able to create an HTTPS connection. Most programming languages have available libraries facilitating this. Furthermore, a JSON library conforming to the employed programming language is needed. Such a library can be acquired from http://www.json.org/.\n\nTo receive callback events from the Spigo Platform the partner must supply an HTTPS service url which can be posted to. If the server hosting the service employs whitelisting a series of IPs from Spigo must be whitelisted. Note that these IPs differ on our staging and production environments.\n\nThe IPs to be whitelisted are as follows:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Staging environment\",\n    \"h-1\": \"Production environment\",\n    \"0-0\": \"34.254.138.20\\n34.254.59.104\",\n    \"0-1\": \"18.203.30.17\\n18.202.194.158\\n18.203.7.167\\n34.248.216.129\\n\\n18.203.175.80\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API communication to Spigo\"\n}\n[/block]\nCommunication from a partner to Spigo is facilitated by connecting to the following url (Depending on the environment):\n\nStaging: https://staginggames.spigo.com/rest/action\nProduction: https://games.spigo.com/rest/action\n\nAlways use https. Never http. Http calls will always fail with 401 Unauthorized\n\nIn the header of all HTTPS requests, a partner token issued by Spigo is needed. A partner token is always made up by a [UUID ](http://en.wikipedia.org/wiki/Universally_unique_identifier).\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /rest/action/ HTTP/1.1\\nX-Spigo-Token: e9d1e69c-ef7b-427c-9515-e9eec4d4043c\\n\\n{\\n   \\\"action\\\": \\\"getGames\\\",\\n   \\\"localeISO639_ISO3166\\\": \\\"da-DK\\\",\\n   \\\"gameId\\\": 43\\n}\",\n      \"language\": \"text\",\n      \"name\": \"Example of an HTTP request\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Length: 33\\nContent-Type: application/json; charset=UTF-8\\n\\n{\\n    \\\"games\\\": [\\n        {\\n            \\\"gameId\\\": 43,\\n            \\\"name\\\": \\\"Tropicana\\\",\\n            \\\"rules\\\": [],\\n            \\\"gameType\\\": \\\"SlotMachine\\\",\\n            \\\"minPlayers\\\": 0,\\n            \\\"maxPlayers\\\": 0,\\n            \\\"supportsTournament\\\": false,\\n            \\\"categories\\\": null,\\n            \\\"imageSquare\\\": \\\"https://9e48deae78fc6a4c2753-1f437e60cc599588460a14cd5302bb04.ssl.cf3.rackcdn.com/e69939d6-ff2c-4afb-a326-74f28b6fc17e.png\\\",\\n            \\\"imageBackground\\\": \\\"https://9e48deae78fc6a4c2753-1f437e60cc599588460a14cd5302bb04.ssl.cf3.rackcdn.com/457a43e4-4228-406c-9157-f739ac820a97.png\\\",\\n            \\\"imageLogo\\\": \\\"https://9e48deae78fc6a4c2753-1f437e60cc599588460a14cd5302bb04.ssl.cf3.rackcdn.com/a63e8f1d-3c20-426c-aed5-40b2e9dda6a9.png\\\",\\n            \\\"descriptionShort\\\": \\\"Velkommen til undervandsparadiset Tropicana, hjemstedet for eksotiske undervandsdyr og Kong Tritons sagnomspundne skat! Optjen minispilssymboler, og få adgang til Kong Tritons tre udfordringer, hvor store præmier kan vindes.\\\",\\n            \\\"descriptionLong\\\": \\\"<h1>Vidste du at...</h1>\\\\r\\\\n<p>\\\\r\\\\nDen første spillemaskine blev opfundet af Charles Fey i 1887 i San Francisco. Der var allerede opfundet simple pokermaskiner, der tillod en spiller at vinde en cigar eller en drink, når der fremkom en vindende kombination.<br \\\\\\\\>\\\\r\\\\nDet, som adskilte Feys Automater fra andre, var, at hans udbetalte gevinsten i mønter. Hans spillemaskine havde tre hjul, og hvert hjul havde påtrykt ti symboler, som enten viste hestesko, spar, ruder, hjerter eller klokke. Kombinationen med tre klokker ville udløse jackpot og dermed den største præmie. Automaten var epokegørende, da man ved at indkaste en mønt og dernæst trække i et håndtag kunne få hjulene til at spinne.<br \\\\\\\\>\\\\r\\\\n</p>\\\\r\\\\n<p>\\\\r\\\\nI Tropicana kan du spille 3 forskellige minispil. I Perledykkeren kan du åbne østers ved at spille Yatzy med dem. I Klovnefisk hjælper du klovnefisken Kasper med at finde piratskatten. Deltag i undervandsparadisets store grand prix i Søhestevæddeløb, og vælg den hurtigste deltager.\\\\r\\\\n</p>\\\"\\n        }\\n    ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API communication from Spigo\"\n}\n[/block]\nTo avoid busy polling of the API thus causing unnecessary server load, the Spigo Platform sends out various events. The mandatory events are described in the Outbound Core API and the Slot Machine API.\n\nTo receive events, the partner must register an HTTPS callback url. E.g.:\n\nhttps://partner.com/spigo/callback/\n\nThe callback URL is configured by Spigo. Remember to check for the presence of the partner token in the header to ensure that calls are from Spigo.\n\nIn addition to setting up the callback URL, the partner needs to select exactly which events to receive callbacks from.\n\nRequests are sent immediately. Please note that no data can be lost even though the loss of individual events is possible. All events have a consecutive index so it is readily apparent if an event has been lost. The event may still be obtained subsequently using the API by supplying the id of a lost event.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /spigo/callback/ HTTP/1.1\\nX-Spigo-Token: e9d1e69c-ef7b-427c-9515-e9eec4d4043c\\n\\n{\\n\\t\\\"action\\\": \\\"getPlayerBalance\\\",\\n\\t\\\"playerIdentifier\\\": \\\"e0cd1c8b-d24a-45bd-a5e5-b1cd01c18aa6\\\",\\n\\t\\\"playerPartnerIdentifier\\\": \\\"123456-FF\\\"\\n}\",\n      \"language\": \"text\",\n      \"name\": \"Example of a callback event\"\n    }\n  ]\n}\n[/block]","updates":["5514bbb5fa9cbe230084782f"],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5a55b149f85c3a0032f10e5f","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Documentation","slug":"documentation","order":0,"from_sync":false,"reference":false,"_id":"5a55b149f85c3a0032f10e56","version":"5a55b149f85c3a0032f10e55","project":"550dd1756c0b4c0d00fd436e","createdAt":"2015-03-21T20:15:50.122Z","__v":0},"user":"550dd13d5b757f0d00f14139","parentDoc":null,"project":"550dd1756c0b4c0d00fd436e","version":{"version":"1.5","version_clean":"1.5.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5a55b149f85c3a0032f10e56","5a55b149f85c3a0032f10e57","5a55b149f85c3a0032f10e58","5a55b149f85c3a0032f10e59","5a55b149f85c3a0032f10e5a","5a55b149f85c3a0032f10e5b","5a55b149f85c3a0032f10e5c","5a55b149f85c3a0032f10e5d","5d1da68fa911a50226595581"],"_id":"5a55b149f85c3a0032f10e55","project":"550dd1756c0b4c0d00fd436e","createdAt":"2018-01-10T06:23:05.406Z","releaseDate":"2018-01-10T06:23:05.406Z","__v":2},"createdAt":"2015-03-21T20:15:51.099Z","githubsync":"","__v":0}

Getting started with the Spigo API

This page will help you get started with Spigo. You'll be up and running in a jiffy!

The Spigo Platform offers a two-way API based on REST, with JSON as data format and UTF-8 as character encoding. To use the API, the employed programming language must be able to create an HTTPS connection. Most programming languages have available libraries facilitating this. Furthermore, a JSON library conforming to the employed programming language is needed. Such a library can be acquired from http://www.json.org/. To receive callback events from the Spigo Platform the partner must supply an HTTPS service url which can be posted to. If the server hosting the service employs whitelisting a series of IPs from Spigo must be whitelisted. Note that these IPs differ on our staging and production environments. The IPs to be whitelisted are as follows: [block:parameters] { "data": { "h-0": "Staging environment", "h-1": "Production environment", "0-0": "34.254.138.20\n34.254.59.104", "0-1": "18.203.30.17\n18.202.194.158\n18.203.7.167\n34.248.216.129\n\n18.203.175.80" }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "API communication to Spigo" } [/block] Communication from a partner to Spigo is facilitated by connecting to the following url (Depending on the environment): Staging: https://staginggames.spigo.com/rest/action Production: https://games.spigo.com/rest/action Always use https. Never http. Http calls will always fail with 401 Unauthorized In the header of all HTTPS requests, a partner token issued by Spigo is needed. A partner token is always made up by a [UUID ](http://en.wikipedia.org/wiki/Universally_unique_identifier). [block:code] { "codes": [ { "code": "POST /rest/action/ HTTP/1.1\nX-Spigo-Token: e9d1e69c-ef7b-427c-9515-e9eec4d4043c\n\n{\n \"action\": \"getGames\",\n \"localeISO639_ISO3166\": \"da-DK\",\n \"gameId\": 43\n}", "language": "text", "name": "Example of an HTTP request" } ] } [/block] [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Length: 33\nContent-Type: application/json; charset=UTF-8\n\n{\n \"games\": [\n {\n \"gameId\": 43,\n \"name\": \"Tropicana\",\n \"rules\": [],\n \"gameType\": \"SlotMachine\",\n \"minPlayers\": 0,\n \"maxPlayers\": 0,\n \"supportsTournament\": false,\n \"categories\": null,\n \"imageSquare\": \"https://9e48deae78fc6a4c2753-1f437e60cc599588460a14cd5302bb04.ssl.cf3.rackcdn.com/e69939d6-ff2c-4afb-a326-74f28b6fc17e.png\",\n \"imageBackground\": \"https://9e48deae78fc6a4c2753-1f437e60cc599588460a14cd5302bb04.ssl.cf3.rackcdn.com/457a43e4-4228-406c-9157-f739ac820a97.png\",\n \"imageLogo\": \"https://9e48deae78fc6a4c2753-1f437e60cc599588460a14cd5302bb04.ssl.cf3.rackcdn.com/a63e8f1d-3c20-426c-aed5-40b2e9dda6a9.png\",\n \"descriptionShort\": \"Velkommen til undervandsparadiset Tropicana, hjemstedet for eksotiske undervandsdyr og Kong Tritons sagnomspundne skat! Optjen minispilssymboler, og få adgang til Kong Tritons tre udfordringer, hvor store præmier kan vindes.\",\n \"descriptionLong\": \"<h1>Vidste du at...</h1>\\r\\n<p>\\r\\nDen første spillemaskine blev opfundet af Charles Fey i 1887 i San Francisco. Der var allerede opfundet simple pokermaskiner, der tillod en spiller at vinde en cigar eller en drink, når der fremkom en vindende kombination.<br \\\\>\\r\\nDet, som adskilte Feys Automater fra andre, var, at hans udbetalte gevinsten i mønter. Hans spillemaskine havde tre hjul, og hvert hjul havde påtrykt ti symboler, som enten viste hestesko, spar, ruder, hjerter eller klokke. Kombinationen med tre klokker ville udløse jackpot og dermed den største præmie. Automaten var epokegørende, da man ved at indkaste en mønt og dernæst trække i et håndtag kunne få hjulene til at spinne.<br \\\\>\\r\\n</p>\\r\\n<p>\\r\\nI Tropicana kan du spille 3 forskellige minispil. I Perledykkeren kan du åbne østers ved at spille Yatzy med dem. I Klovnefisk hjælper du klovnefisken Kasper med at finde piratskatten. Deltag i undervandsparadisets store grand prix i Søhestevæddeløb, og vælg den hurtigste deltager.\\r\\n</p>\"\n }\n ]\n}", "language": "json", "name": "Response" } ] } [/block] [block:api-header] { "type": "basic", "title": "API communication from Spigo" } [/block] To avoid busy polling of the API thus causing unnecessary server load, the Spigo Platform sends out various events. The mandatory events are described in the Outbound Core API and the Slot Machine API. To receive events, the partner must register an HTTPS callback url. E.g.: https://partner.com/spigo/callback/ The callback URL is configured by Spigo. Remember to check for the presence of the partner token in the header to ensure that calls are from Spigo. In addition to setting up the callback URL, the partner needs to select exactly which events to receive callbacks from. Requests are sent immediately. Please note that no data can be lost even though the loss of individual events is possible. All events have a consecutive index so it is readily apparent if an event has been lost. The event may still be obtained subsequently using the API by supplying the id of a lost event. [block:code] { "codes": [ { "code": "POST /spigo/callback/ HTTP/1.1\nX-Spigo-Token: e9d1e69c-ef7b-427c-9515-e9eec4d4043c\n\n{\n\t\"action\": \"getPlayerBalance\",\n\t\"playerIdentifier\": \"e0cd1c8b-d24a-45bd-a5e5-b1cd01c18aa6\",\n\t\"playerPartnerIdentifier\": \"123456-FF\"\n}", "language": "text", "name": "Example of a callback event" } ] } [/block]