Help & Guide
Release 2.19r
22.4 API Interface

Information can be sent to and retrieved from Bridgewebs using an API Call using the HTTP Post Extension:

The results files can be uploaded through the web site, but for software developers it is possible to use an HTTP post directive to post the files directly rather than use FTP.

An HTTP post basically does what a user would do by going to a web page and clicking submit with the fields filled in.

The reply can be read to see what happened and parse "message = xxxxx" to find the status.

Your Software

It will be necessary to provide an option for the user to enter the Club Code instead of "myclub" and their Bridgewebs club "password" in the software Options/Configuration file somewhere.

Then provide suitable buttons [Upload to BridgeWebs] etc. somewhere on the Results page to execute the transfer

See below for VB or Perl example..

Results Upload API

To upload the results with attachments, the parameters are:

club      = myclub
password  = secret
type      = upload
filename  = xxxxxxxx.csv
event_id  = N (if known, see Calendar below)
data      = a string of all the lines of the xxxxxxxx.csv file
dealname  = xxxxxxxx.dlm (can be dlm, bri, pbn, dup)
dealdata  = a string of all the lines of the xxxxxxxx.dlm file
dealXname = xxxxxxxx.dlm (can be dlm, bri, pbn, dup) } Where X is 2-9 for extra sessions.
dealXdata = a string of all the lines of the xxxxxx.dlm file }
infoname  = info.pdf (PDF supporting Info file)
infodata  = a string of all the lines of the info.pdf file
// for ACBL Uploads
acblname  = ACBL file name 140709.ACA (as necessary)
acbldata  = a string of all the lines of the ACBL file
bwsname   = BWS file name 140709.ACA (as necessary)
bwsdata   = a string of all the lines of the BWS file

The data of the files can be strung together from the file and put it in one field "data" or "handdata" as appropriate. It is as if you cut and paste the file into a web text box. In this case, the filename specified is not actually accessed but is used as the file name when writing the data on the bridgewebs server for consistency with the manual technique.

The reply can be parsed to see what happened.
Parse "message = xxxxx" to find the status.

Player Upload API

To upload the player file, the parameters are:

club      = myclub
password  = secret
type      = upload
transfer  = pdb
filename  = xxxxxxxx.XXX
data      = a string of all the lines of the xxxxxxxx file

Where XXX is

txt = Scorebridge format
csv = csv format
xml = EBU USEBIO Format

Player Download API

To download the player file, the parameters are:

club      = myclub
password  = secret
type      = download
transfer  = pdb
filename  = xxxxxxxx.XXX

Where XXX is

txt = Scorebridge format
csv = csv format
xml = EBU USEBIO Format

The reply will contain the player file in a separate line.

message = Download Successful
data = ..............., then split the content of that line replacing (tilde) with \n.

Direct Document Upload API

To just upload a document to the club directory, the parameters are:

club     = myclub
password = secret
type     = upload
transfer = doc
filename = bw.csv
data     = a string of all the lines of the bw.csv file

Hand Upload API

To upload a .pbn deal file and attach to an event, the parameters are:

club     = myclub
password = secret
type     = upload
transfer = deal
event    = YYYYMMDD_X e.g. 20140709_1,
           X is the unique Id of the event for that date, usually 1.
dealname = xxxxxxxx.pbn
dealdata = an encoded string of all the lines of the xxxxxxxx.pbn file

As a safety feature, will fail if the event does not exist. So the club will need to create Calendar entries in advance.

Calendar Download API

To download the club calendar, the parameters are:

club     = myclub
password = secret
type     = download
year     = 2014 (yyyy)
transfer = cal

This will return a JSON argument of the calendar entries for the YEAR as a pair, id = title, file (if uploaded)

json = {"events":{"201407091":{"file":"2014Jul09!!.dat","title":"Duplicate Pairs"},.....}}

Event Download API

Similar to the Calendar, but just the events for a particular day, the parameters are:

club     = myclub
password = secret
type     = download
transfer = events
date     = 20140709 (yyyymmdd)

This will return a JSON argument of the calendar entries for the day as a pair, id = title, file (if uploaded)

json = {"events":{"1":{"file":"2014Jul09!!.dat","title":"Duplicate Pairs"},"2":{"title":"Create New Event"}}}

and a list of events for the day, Title File uploaded

event_id_1 = Duplicate Pairs 10022_res_2014Aug19!!.dat
event_id_2 = Create New Even
t

We are migrating this to JSON, so if you add a parameter

   format = json

this will return a pure json data file.

Last updated : 18th Jan 2019 17:43 GMT