Ads displayed for guests and not donating members only. Get ad-free by donating. If you have already donated, please read here.
Results 1 to 16 of 16

Thread: vBAddict API: Uploading Dossier, Battle Results and Replays to vBAddict.net

  1. #1
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127

    vBAddict API: Uploading Dossier, Battle Results and Replays to vBAddict.net

    The new uploading mechanism is now in place.

    KNOWN CLIENTS



    You need to provide the UserAgent Property with Application/Script Name and full version number, e.g. "ADU 3.3.0.0"


    CHECK

    Before uploading large files or just for availability ping you can use the check functionality by just calling this URL:
    Code:
    http://www.vbaddict.net:82/upload_check/RESPONSE/
    An example of the output:
    Code:
    <?xml version="1.0"?>
    <response>
    <status>1</status>
    <message>Server is currently undergoing maintenance.</message>
    <version>1.0.0</version>
    <data/>
    </response>
    UPLOAD FILE

    Uploads must be sent with Method "PUT" to a specific URL. Target Server is on Port 82.

    Code:
    http://www.vbaddict.net:82/upload_file/TYPE/SERVER/USERNAME/TOKEN/RESPONSE/



    POSSIBLE VALUES

    TYPE
    battleresult, dossier, replay, ats

    SERVER
    eu, na, ru, net, asia, kr, vn, cn

    USERNAME
    Full Username

    TOKEN
    A Token is a string which is used to authenticate uploads to vBAddict. It is similar to a Password.
    As long as you don't have your personal Token created, all uploads by Active Dossier Uploader or WotNumbers are still working.
    Once you create your personal Token, your profile switches to a protected one. As a protected profile, uploads are only accepted with the Token. Nobody else is able to upload data to your profile.

    Create Token:
    http://www.vbaddict.net/token.php

    You need to provide a textbox in configuration where the user should be able to enter the Token. It's an alphanumeric string with a length of 20 chars. If the user does not have a token yet, provide a - hyphen.

    RESPONSE
    json, xml, debug

    debug is xml with additional informations about the upload



    RESPONSE

    Return Codes for response/status:
    Code:
    0 Success
    1 Server is Offline (e.g. maintenance or too much users)
    2 Unknown uploading type
    3 Unknown server
    4 Unknown method / UserAgent
    5 Bad Token
    6 Cannot process uploaded file (See response/data/file for details)
    Return Codes for response/data/file/status
    Code:
    0 File processed with Success
    1 Temporary Error, try again later
    2 Critical Error (mostly because filesize not in valid range)



    EXAMPLE

    To upload a dossier to the Profile "Phalynx" from EU Server and with debug output, this would be the URL:
    Code:
    http://www.vbaddict.net:82/upload_file/dossier/eu/Phalynx/6ec0585616ec05856144/debug/
    Response
    Code:
    <?xml version="1.0"?>
    <response>
    	<status>0</status>
    	<message>Success</message>
    	<version>0.9</version>
    	<data>
    		<player>
    			<accountid>500993944</accountid>
    			<clanid>500018766</clanid>
    			<userid>1</userid>
    			<verified>1</verified>
    			<link>http://www.vbaddict.net/player/phalynx-eu-0af79b837139a524d1df5b2289bcc213</link>
    		</player>
    		<file>
    			<status>0</status>
    			<message>Success</message>
    		</file>
    	</data>
    	<debug>
    		<output>debug</output>
    		<type>dossier</type>
    		<server>eu</server>
    		<username>Phalynx</username>
    		<application>ADU 3.3.0.0</application>
    		<token>6ec0585616ec05856144</token>
    	</debug>
    </response>

    In this case, the uploaded Dossier and Token were accepted and processed.

    On success, you will get some details about the user in response/data/player
    • userid: vBAddict User ID
    • accountid: WG's Account DBID
    • clanid: WG's Clan DBID
    • verified: Account has been verified by WG API
    • link: Full Link to Users Player Profile
    Last edited by Phalynx.eu; 2017-03-07 at 14:57.

  2. #2
    I can confirm that upload_check works, and upload_file for battleresult and dossier as well. Tested both with and without token. Implemented fully working solution using .NET 4.5 and HttpWebRequest methods.

  3. #3
    On Linux, so anything Windows based is a pain to use. Have some experience with APIs, but I can't seem to get my files to upload via curl.

    Code:
    $ curl -X PUT -T 20150216_1746_usa-T14_28_desert.wotreplay http://carius.vbaddict.net:82/upload_file/replay/na/bobross/-/json/ -A "ADU 3.3.0.0" -H "Accept: application/json"
    
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL /upload_file/replay/na/BobRoss/-/json/20150216_1746_usa-T14_28_desert.wotreplay was not found on this server.</p>
    </body></html>
    I've tried variations without the UserAgent (or UserAgent properly identified as curl) and Accept headers, but that didn't change anything. Tried battleresults as well with the same result. Do I need to specify the mimetype or anything? If so, what are the mimetypes for the goofy file extensions WoT uses?

    FWIW, the upload_check works peachy.

    Code:
    $ curl http://carius.vbaddict.net:82/upload_check/json/{"status":0,"message":"OK","version":"0.9.5"}
    Anything you see that I'm obviously doing wrong here?

    Thanks!

  4. #4
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    Seems cURL is attaching the name of the uploaded file to the URL it is calling. Can't assist with cURL, sorry.

    Please use another user agent to avoid confusion.

  5. #5
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    Tried it with cURL and found a way for upload.

    It works this way:
    Code:
    curl --upload-file "full_path_to_replay.wotreplay" http://carius.vbaddict.net:82/upload_file/replay/%SERVER%/%USERNAME%/%TOKEN%/%RESPONSE%

  6. #6
    I get a 404 message when I attempt to execute the ping test in Chrome, and a timeout when i attempt ping from command line. Is this service running?

    http://carius.vbaddict.net:82/upload_check/RESPONSE/

  7. #7
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    Replace RESPONSE with the correct output format: json, xml, debug

  8. #8
    I tried running this :

    curl --upload-file "full_path_to_replay.wotreplay" http://carius.vbaddict.net:82/upload...EN%/%RESPONSE%

    with the correct parameters filled in, but it seems there is nothing hapopening there,despite me getting a successful feedback.

  9. #9

    Working script for Macintosh dossier upload

    Working script to constantly auto-upload on Macintosh

    You will need to have jq (and curl) installed. If you have homebrew, you can simply install it by running "brew install jq". If not, install homebrew first

    Moved to this thread

    Of course, you can easily adapt this script to run on linux..
    Last edited by lotusthemotus.eu; 2015-09-07 at 12:30.

  10. #10
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    Thanks for sharing!

  11. #11
    Thanks for running the site.. it's damn cool

  12. #12
    Has the server moved? I can't get any response, just 404.

  13. #13
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    Which link are you using?

  14. #14

    This post was made as an issue

    Can you perhaps just provide a web interface for battle results uploading, like you do with dossiers?

  15. #15
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    Quote Originally Posted by RecceDG.na View Post
    Can you perhaps just provide a web interface for battle results uploading, like you do with dossiers?
    Sure. Related issue: http://www.vbaddict.net/issue/1220-U...esults-via-Web

  16. #16
    Rookie
    Join Date
    Oct 2015
    Location
    Maple Ridge, BC, Canada
    Posts
    3
    neither ADU or ATS will download yes vBAddict was open??????? how do I make this work?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •