8000 GitHub - Elinea/dota2-StorageAPI: Dota 2 storage api for storing custom values in custom games
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Elinea/dota2-StorageAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

#Storage API ######Storage API interface to store data for Dota 2 Custom Game players.

##How to setup

  • Clone or download the storageapi folder into your addon's vscript folder
  • Get API key from http://dota2.tools/api/v1/storage/createApiKey?game=<Name of your custom game>&author=<Your name> or make your own server receiver and edit STORAGEAPI_API_URL in storage.lua
  • Check info on server responses at the bottom of this readme if you decide to build your own reciever

##Usage

require('storageapi/json')
require('storageapi/storage')

Storage:SetApiKey(api_key)

Storage:Put( steam_id, data, function( resultTable, successBool )
	if successBool then
		print("Successfully put data in storage")
	end
end)

Storage:Get( steam_id, function( resultTable, successBool )
	if successBool then
		DeepPrintTable(resultTable)
	end
end)

##Testing GET: STORAGEAPI_API_URL?api_key=<api_key>&steam_id=<steam_id>

PUT (POST): STORAGEAPI_API_URL?api_key=<api_key>&steam_id=<steam_id>&data=<json>

##Server

GET with query string api_key=<api_key>&steam_id=<steam_id> should return

{
	"data": {
		"api_key": string,
		"steam_id": string,
		"data": {
			json_object
		}
	}
}

POST with query string api_key=<api_key>&steam_id=<steam_id>&data=<json> should return

{
  "data": {
    "success": true
  }
}

Errors should return

{
  "errors": {
    "error_code": int,
    "message": string
  }
}

About

Dota 2 storage api for storing custom values in custom games

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0