Horse Racing Forum - PaceAdvantage.Com - Horse Racing Message Board

Go Back   Horse Racing Forum - PaceAdvantage.Com - Horse Racing Message Board > Thoroughbred Horse Racing Discussion > Advance Deposit Wagering (ADW)


Reply
 
Thread Tools Rate Thread
Old 10-13-2023, 12:37 PM   #1
sleepystork
Registered User
 
Join Date: Jul 2023
Posts: 2
AmWager API code to place a wager

Does anyone have a piece of example code to place a wager using the AmWager API? I wrote code that does everything else, but I can't figure out what is required from their documentation to place a wager. It can be in any language, and I can do the conversion.
sleepystork is offline   Reply With Quote Reply
Old 10-13-2023, 02:50 PM   #2
DLigett
Registered User
 
DLigett's Avatar
 
Join Date: Aug 2014
Posts: 34
This is *not* a complete working example, but maybe it will help...

Code:
procedure TWagerPlacerForm.PlaceSingleBetButtonClick(Sender: TObject);

var bet        : string;
    paramstr   : string;
    len        : integer;
    i          : integer;
    DataBuffer : array [0..1000] of Byte;
    str        : string;
    TicketID   : string;
    EventID    : string;
    RaceID     : string;
    BaseAmount : string;
    Total      : string;
    Balance    : string;
    PoolID     : string;
    Runners    : string;

begin
bet := '{  "CustomerId": "' + CustomerId + '",'            +
       '   "DutchType": 0,'                                +
       '   "FileUploadName": null,'                        +
       '   "NickName": null,'                              +
       '   "RunId": "' + RunId + '",'                      +
       '   "TicketAmount": 2,'                             +
       '   "ToteTicketRequest": '                          +
       '      {'                                           +
       '      "CurrencyId": "USD",'                        +
       '      "EventId": "' + EventIdEdit.Text +'",'       +
       '      "ParentStackId": "",'                        +
       '      "RaceId": ' + RaceIdEdit.Text + ','          +
       '      "StackId": "",'                              +
       '      "Wagers": '                                  +
       '         ['                                        +
       '         {'                                        +
       '         "BaseAmount": 2,'                         +
       '         "Bets": 1,'                               +
       '         "Legs": '                                 +
       '             ['                                    +
       '             {'                                    +
       '            "Auto": false,'                        +
       '            "Runners": "' + RunnersEdit.Text + '"' +
       '             }'                                    +
       '             ],'                                   +
       '         "Modifier": 0,'                           +
       '         "PoolId": "' + PoolEdit.Text + '",'       +
       '         "Total": 2'                               +
       '         }'                                        +
       '         ]'                                        +
       '      }'                                           +
       '}';

paramstr := bet;

len := Length(paramstr);

for i := 1 to len do
   DataBuffer[i - 1] := byte(paramstr[i]);

Response.Clear;

WebPostData(appname,
            'wagerapi.amwager.com',
            'api/ToteWagering/IssueSingleTicket',
            @DataBuffer,len,
            'application/json',
            Token,
            Response);
end;
Dan
DLigett is offline   Reply With Quote Reply
Old 10-14-2023, 09:15 AM   #3
sleepystork
Registered User
 
Join Date: Jul 2023
Posts: 2
Thanks. Perfect!
sleepystork is offline   Reply With Quote Reply
Old 10-16-2023, 09:09 AM   #4
Gorrex
Registered User
 
Join Date: Apr 2008
Location: Louisville
Posts: 278
We are also currently working on a Version 2 API that will be a bit more simplified and easier to understand and use. I'll post here once its ready.
__________________

Jason Martin
IT Director
AmWest Entertainment - AmWager
Gorrex is offline   Reply With Quote Reply
Old 11-04-2023, 09:07 PM   #5
tamaharbor
Registered User
 
Join Date: Jun 2004
Location: Denver, CO
Posts: 285
How can I find out more about the existing API? Thanks.
tamaharbor is online now   Reply With Quote Reply
Old 11-06-2023, 07:01 PM   #6
tamaharbor
Registered User
 
Join Date: Jun 2004
Location: Denver, CO
Posts: 285
AmWager support has indicated their API is not available to the public? Please help?
tamaharbor is online now   Reply With Quote Reply
Reply





Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

» Advertisement
» Current Polls
Wh deserves to be the favorite? (last 4 figures)
Powered by vBadvanced CMPS v3.2.3

All times are GMT -4. The time now is 11:03 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 1999 - 2023 -- PaceAdvantage.Com -- All Rights Reserved
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program
designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.