API: Difference between revisions

From ETM
Jump to navigation Jump to search
Line 7: Line 7:
1. Go on the server and enable the api calls for your account with: /user api on
1. Go on the server and enable the api calls for your account with: /user api on
2. Copy your secret with: /user secret
2. Copy your secret with: /user secret
3. Call the URL with HEADER-Parameter {"userName":"USERNAME","secret":"YOURSECRET"}"
3. Call the URL with HEADER-Parameter "Auth" and value: {"userName":"USERNAME","secret":"YOURSECRET"}


</syntaxhighlight>
</syntaxhighlight>

Revision as of 11:41, 24 May 2020

Api Urls

https://s200.etm.dev/transaction/[UserName]/latest
https://s200.etm.dev/shop/[UserName]/[world]

These calls need authentication. To auth you need to:
1. Go on the server and enable the api calls for your account with: /user api on
2. Copy your secret with: /user secret
3. Call the URL with HEADER-Parameter "Auth" and value: {"userName":"USERNAME","secret":"YOURSECRET"}


curl -H "Auth:{\"userName\":\"Kademlia\",\"secret\":\"xxxxxxxxxxxxxx\"}" https://s200.etm.dev/transaction/Kademlia/latest


curl -H "Auth:{\"userName\":\"tigerjunge15\",\"secret\":\"F4kWNs7UKfUss7XKdJE8P9DOwFrQB2RvTYx+hPFWGoGZaC/NrSIyEg==\"}" https://s200.etm.dev/transaction/tigerjunge15/latest

Latest transactions example

Http-Header "Auth" with value: {"userName":"tigerjunge15","secret":"F4kWNs7UKfUss7XKdJE8P9DOwFrQB2RvTYx+hPFWGoGZaC/NrSIyEg=="}"

Url: https://s200.etm.dev/transaction/tigerjunge15/latest


{"userName":"Lasergott","secret":"fe6FeQsgDDWybNAZsXEHsdgQ7nIXprUd/feIBRMD4ifqdvWnV98bnA=="}"