Git Product home page Git Product logo

dota2-storageapi's Introduction

#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
  }
}

dota2-storageapi's People

Contributors

elinea avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.