I'm new to the programming API's, I'm trying to write my bot to run on a site and this is the doc to the API Crypto-games API doc site but I get the 400 error on execution for the place bet command and the error won't print out the error content, just the error code. Here is what they gave on their site
URL: /v1/placebet/:coin/:key
{ "Bet": 0.00001024, "Payout": 2.0, "UnderOver": true, "ClientSeed": "somerandomseed" }
UnderOver is target result. Example: < 49.600 or > 50.399`
And here's a sample Javascript they gave
var input = { Bet: 0.00001024, Payout: 2.0, UnderOver: true,
ClientSeed: "somerandomseed" };
$.ajax({
url: "https://api.crypto-games.net/v1/placebet/BTC/7Ii8vdPBUBfTPHcuzkHuhftkGD43iWwbFkdwBQa7GL8R4AwBr3",
data: JSON.stringify(input),
dataType: "json",
contentType: "application/json",
type: "POST",
success: function (r) {
console.log(r);
}
});
here is the Python code I wrote to run the placebet command
import requests
import json
parameter = {"Bet": 10.0000000, "Payout":2.0, " >50.399": True, "ClientSeed": "CTThgTlac54qK2lahvLicrFlJsJmSIEkRMt4VcuN"}
parameters = json.dumps(parameter)
response = requests.get("https://api.crypto-games.net/v1/placebet/PLAY/XxxMyAPIHerexxX", params = parameters)
print(response.content)
print(response.status_code)
I tried running it without the json.dumps() but I still get the same output. Can someone point out what I'm doing wrong, all criticism and suggestions are welcome.
json.dumps(), but you do need to make it arequests.postfunction call instead.