alvinl/stem

POST Endpoint

Closed this issue · 0 comments

Allow the user to add a POST endpoint in the config, the bot can then send post data to that endpoint on every event or contained to just trade events (ie whnever a trade finishes, post the items recieved and from whom). This could also work vice versa where you can send a post command to the bot. This feature would be useful for integrating with a forum or a website.

Example config parameter:

{
  "API": {
    "endpoint": "http://website.com.com/botapi.php"
  }
}
  • endpoint can also be an array to allow for multiple POST calls

Example POST data (trade end):

{
  "event": "tradeEnded",
  "tradeStatus": "1",
  "traded": "133526574",
  "itemsReceived": ["array of items received in trade"],
  "time": "timestamp",
  "tradeLength": "amount of time the trade took"
}
  • event can be the type of event to send
    • tradeEnded a trade has ended
    • message a new message
    • etc.
  • tradeStatus the status of the trade ending
    • 1 trade ended successfully with items traded
    • 2 trade timeout
    • etc.
  • traded the steamID of the user the bot was trading
  • itemsReceived an array of items received, can be empty
  • time when the trade was initiated
  • tradeLength how long the trade lasted, this could be replace with a timeEnd timestamp

Any suggestions are welcome, weather or not this will be added for the v1.0 release is still being decided