Six4Win.WebApi

<back to all web services

GetRecentWins

The following routes are available for this service:
All Verbs/qry/wins/recent
const std = @import("std");

pub const Ref = struct {
    id: ?[]const u8 = null,
    val: ?[]const u8 = null,
};

pub const BettingApp = struct {
    name: ?[]const u8 = null,
    version: ?[]const u8 = null,
};

pub const RefEx = struct {
    id: ?[]const u8 = null,
    val: ?[]const u8 = null,
    data: ?RecordDictionary = null,
};

pub const Origin = struct {
    application: ?BettingApp = null,
    ip: ?[]const u8 = null,
    organization: ?RefEx = null,
    region: ?Ref = null,
    locationGroup: ?Ref = null,
    location: ?RefEx = null,
    device: ?RefEx = null,
    clerk: ?Ref = null,
};

pub const BetOutcome = enum(i32) {
    Unknown = 0,
    Lost = 1,
    Won = 2,
    Void = 3,
};

pub const BetProcessingStatus = enum(i32) {
    Open = 0,
    Closed = 1,
};

pub const BetValidity = enum(i32) {
    Valid = 0,
    Canceled = 1,
    Void = 2,
    Reverted = 3,
};

pub const Win = struct {
    id: i64 = 0,
    sId: i64 = 0,
    bettor: ?Ref = null,
    origin: ?Origin = null,
    placedAt: ?[]const u8 = null,
    roundId: i64 = 0,
    content: ?[]const u8 = null,
    stake: f64 = 0,
    outcome: ?BetOutcome = null,
    amount: f64 = 0,
    processingStatus: ?BetProcessingStatus = null,
    validity: ?BetValidity = null,
    results: ?std.json.Value = null,
    payload: ?std.json.Value = null,
};

pub const RecentWins = struct {
    id: ?[]const u8 = null,
    wins: ?[]Win = null,
};

pub const GetRecentWins = struct {};

pub fn RecordDictionary(comptime TKey: type, comptime TVal: type) type {
    _ = TKey;
    _ = TVal;
    return struct {};
}

Zig GetRecentWins DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /qry/wins/recent HTTP/1.1 
Host: s4w2.api.bettor.webhop.biz 
Accept: application/json
Content-Type: application/json
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"String","wins":[{"id":0,"sId":0,"bettor":{"id":"String","val":"String"},"origin":{"application":{"name":"String","version":"String"},"ip":"String","organization":{"data":{"String":"String"},"id":"String","val":"String"},"region":{"id":"String","val":"String"},"locationGroup":{"id":"String","val":"String"},"location":{"data":{"String":"String"},"id":"String","val":"String"},"device":{"data":{"String":"String"},"id":"String","val":"String"},"clerk":{"id":"String","val":"String"}},"placedAt":"0001-01-01T00:00:00.0000000Z","roundId":0,"content":"String","stake":0,"outcome":0,"amount":0,"processingStatus":0,"validity":0,"results":{"String":"String"},"payload":{"String":"String"}}]}