Betrium Beta - API documentation

ENDPOINT: http://betrium.ga

Last update date: 30.03.2018

Last changes:

Content-Type: application/json

Current logging system: cookies

Note: In all requests must be sent Headers with cookies. This is a temporary quick option, tokens will be used in the future. They will also be sent to Headers. Also later, the documentation will be rewritten in a more understandable format, with examples of queries and examples of answers. This is not the final version.

POST /api/signin

Sign in to site. Return success status and cookies (set-cookie) in Headers.

Request example:

{
    email: "test@test.com", 
    password: "tester"
}

POST /api/signup

Sign up to site. If success - return success status and send email confirmation.

Request example:

{
    email: "test@test.com", 
    password: "tester", 
    password2: "tester", 
    fullname: "The Tester", 
    country: "USA", 
    nickname: "the_tester"
}

GET /api/signout

Close session.

GET /api/categories

Get all categories and subcategories with name and ID.

GET /api/account

Get all account info. (required cookies)

GET /api/account/balance

Get account balance. (required cookies)

GET /api/account/history

Get transactions history for account. (required cookies)

GET /api/bets/history

Get account bets history. (required cookies)

POST /api/bets/place

Place new bet on Sportbets event (required cookies)

Request example:

{
    currency: "usd", 
    bets: [ 
        {odd: 13, event: 43, stake: 10, type: 1},
        {odd: 14, event: 45, stake: 50, type: 2},
        {...}
    ]
}

currency – (string) This is currency of all selected bets. [usd, btc, eth]
odd - (int) ID of odd
event - (int) ID of event
stake - (double) Stake in BTC / ETH / USD
type - (int) Number 1 or 2 (top or bottom coefficient)

Return: success status, errors if they exists, rest amount and rest currency type.

GET /api/events

Get all events and odds.

GET /api/events/category/2

Get all subcategories, events and odds by category ID (ex: 2).

GET /api/events/subcategory/22

Get all events and odds by subcategory ID (ex: 22).

GET /api/event/35

Get one event with odds by event ID.

GET /api/update/1520981074

Get updates of all odds. Send UnixTime in URI with GET.

In first request send local device UnixTime, without milliseconds. This request return server unixtime.
In all next requests send this unixtime, not local!

GET /api/total/12

Get total amount of all bets in EVENT by id (ex: 12).

POST /api/search

Search events by Title.

Request example:

{
    query: "Havana",
    games: "exchange",
    limit: 3
}

Limit is not required. Default limit = 5.
Games type: exchange and bookmaker.

POST /api/settings

Save new account info. All fields is required, except passwords. (required cookies)

Request example:

{
    password: "123456qwe", 
    password2: "123456qwe", 
    fullname: "Gordon Freeman", 
    nickname: "BetaTester", 
    country: "Australia", 
    email: "new.tester@tester.com"
}