YellowBeard API

API Endpoint

http://apis.smart.yellowbeard.com
    

Welcome to the YellowBeard API reference. The YellowBeard API is a RESTful API based on the HTTP protocol and the JSON format.

All requests are authenticated using a token which can be obtained by calling POST /auth/api-handshake.

Authentication

bearerAuth

Type http
Scheme bearer
Request header Authorization
Format Bearer < token >
More info https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication

Login


# example url
POST http://apis.smart.yellowbeard.com/auth/api-handshake 
    

POST - /auth/api-handshake


# example response
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiImp0aSI6IjZiOWJmM
            zEyYjVlNmRmNDVmMjk4YTA4ODE3YmRhZmVjMmU1liMTY3Mzc3N
            g5Yzc0YjkzZDBjM2NmYWIyNTRmZWYzZWFmZjRmZWZmFiIn0.eyJ
            hdWQiOiIxIiwianRpIjoiNmI5YmYzMTJiNWU2ZGY0YyOThhMDg4M
            TdiZGFmZWMyZTVjOWIxNjczNzc2ODljNzRiOTNkMGM2ZhYjI1NGZ
            lZjNlYWZmNGZlZTZmYWIiLCJpYXQiOjE1ODUxMzgxODIm5iZiI6MT
            U4NTEzODE4MSwiZXhwIjoxNjE2Njc0MTgxLCJzdWIi3OSIsInNjb3
            BlcyI6W119.Y0_MBwjiHy3vTfD2zPZJIo3pbg7jsgl1_wY0MYr0"
} 
    

QUERY PARAMETERS

Field Type Description
email String Your email address.
password String Your account password.

Response

200 Successfull Operation
422 Missing Parameters
401 Invalid Credentials, Unable Connectivity

Get Locations


# example url
GET http://apis.smart.yellowbeard.com/get-locations
    

GET - /get-locations


# example response
{
    "locations": [
        {
            "id": 1,
            "uuid": "d3180900-3a87-347e-8ffe-1808bb5101ec",
            "name": "YellowBeard Head Quarter",
            "address": "Danneskiold-Samsøes Allé 41",
            "postcode": "1434",
            "city": "København",
            "country": "Denmark",
            "latitude": "55.902325",
            "longitude": "12.484671"
        }
    ]
}
    

Response

200 Successfull Operation
401 Unauthorized
422 Other Exception



Create Token


# example url
POST http://apis.smart.yellowbeard.com/create-token 
    

POST - /create-token


# example response
{
    "token_data": {
        "token_id": 12312341,
        "token": "EF47CH09H25B1PM",
        "amount": 100,
        "total_cups": 10,
        "time_from": "2020-03-25 05:00:56",
        "time_to": "2021-03-25 05:00:56",
        "location": 59
    }
} 
    

QUERY PARAMETERS

Field Type Description
location Integer Location ID, use `id` from /get-locations api call
amount Decimal Amount to allocate for a token
total_cups Integer Number of times token can be used

Response

200 Successfull Operation
422 Missing Parameters
401 Unauthorized
422 Other Exception

Token Detail


# example url
GET http://apis.smart.yellowbeard.com/check-token/EF47CH09H25B1PM
    

GET - /check-token/< token >


# example response
{
    "token_data": {
        "token_id": 12312341,
        "token": "EF47CH09H25B1PM",
        "amount": 80,
        "total_cups": 8,
        "time_from": "2020-03-25 05:00:56",
        "time_to": "2021-03-25 05:00:56",
        "location": 59
    }
}
    

QUERY PARAMETERS

Field Type Description
string Use `token` in url parameter and see token details. Remaining amount, remaining valid times and other information.

Response

200 Successfull Operation
401 Unauthorized
422 Other Exception