NAV Navigation
Shell HTTP JavaScript Node.js Ruby Python Java Go PHP

Antwerp Velo Smartbike API v3.1 v0.0.1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

API for Antwerp Velo

Base URLs:

Terms of service

Authentication

Default

oauthToken

Code samples

# You can also use wget
curl -X POST https://antwerp.pub.api31.smartbike.com/oauth/v2/token \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST https://antwerp.pub.api31.smartbike.com/oauth/v2/token HTTP/1.1
Host: antwerp.pub.api31.smartbike.com
Content-Type: application/json
Accept: application/json

const inputBody = '{
  "username": "string",
  "password": "string",
  "grant_type": "password",
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('https://antwerp.pub.api31.smartbike.com/oauth/v2/token',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

const fetch = require('node-fetch');
const inputBody = {
  "username": "string",
  "password": "string",
  "grant_type": "password",
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('https://antwerp.pub.api31.smartbike.com/oauth/v2/token',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://antwerp.pub.api31.smartbike.com/oauth/v2/token',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://antwerp.pub.api31.smartbike.com/oauth/v2/token', headers = headers)

print(r.json())

URL obj = new URL("https://antwerp.pub.api31.smartbike.com/oauth/v2/token");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://antwerp.pub.api31.smartbike.com/oauth/v2/token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://antwerp.pub.api31.smartbike.com/oauth/v2/token', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

POST /oauth/v2/token

Get OAuth Token (Login or Refresh)

Body parameter

{
  "username": "string",
  "password": "string",
  "grant_type": "password",
  "client_id": "string",
  "client_secret": "string"
}

Parameters

Name In Type Required Description
body body any true none

Example responses

200 Response

{
  "access_token": "string",
  "refresh_token": "string",
  "expires_in": 0,
  "scope": "string",
  "token_type": "string"
}

Responses

Status Meaning Description Schema
200 OK OAuth token response OAuthTokenResponseBody

customerSummary

Code samples

# You can also use wget
curl -X GET https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary HTTP/1.1
Host: antwerp.pub.api31.smartbike.com
Accept: application/json


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary', headers = headers)

print(r.json())

URL obj = new URL("https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/summary', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

GET /api/en/v3/customer/summary

Get customer ride summary

Example responses

200 Response

{
  "ridesCount": 0,
  "ridesHours": 0
}

Responses

Status Meaning Description Schema
200 OK Ride summary data CustomerSummaryResponseBody

customerDetails

Code samples

# You can also use wget
curl -X GET https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details HTTP/1.1
Host: antwerp.pub.api31.smartbike.com
Accept: application/json


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details', headers = headers)

print(r.json())

URL obj = new URL("https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://antwerp.pub.api31.smartbike.com/api/en/v3/customer/details', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

GET /api/en/v3/customer/details

Get customer details

Example responses

200 Response

{
  "id": 0,
  "firstName": "string",
  "lastName": "string",
  "lastName2": "string",
  "username": "string",
  "contactEmail": "string",
  "telephoneNumber": "string",
  "additionalNumber": "string"
}

Responses

Status Meaning Description Schema
200 OK Customer personal data CustomerDetailsResponseBody

graphqlCustomer

Code samples

# You can also use wget
curl -X POST https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer HTTP/1.1
Host: antwerp.pub.api31.smartbike.com
Content-Type: application/json
Accept: application/json

const inputBody = '{
  "query": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

const fetch = require('node-fetch');
const inputBody = {
  "query": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer', headers = headers)

print(r.json())

URL obj = new URL("https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://antwerp.pub.api31.smartbike.com/graphql/graphql/customer', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

POST /graphql/graphql/customer

Run customer GraphQL query

Body parameter

{
  "query": "string"
}

Parameters

Name In Type Required Description
body body CustomerGraphqlRequestBody true none

Example responses

200 Response

{
  "data": {
    "CustomerIsRiding": {
      "id": 0,
      "accountId": 0,
      "status": "string",
      "duration": 0,
      "bikeNumber": "string",
      "originStationCode": "string",
      "originStation": "string",
      "originSlotId": "string",
      "checkoutTime": "2019-08-24T14:15:22Z",
      "destinationStationCode": "string",
      "destinationStation": "string",
      "destinationSlotId": "string",
      "checkinTime": "2019-08-24T14:15:22Z"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK GraphQL customer data Inline

Response Schema

Schemas

OAuthTokenLoginRequestBody

{
  "username": "string",
  "password": "string",
  "grant_type": "password",
  "client_id": "string",
  "client_secret": "string"
}

Properties

Name Type Required Restrictions Description
username string true none none
password string true none none
grant_type string true none none
client_id string true none none
client_secret string true none none

Enumerated Values

Property Value
grant_type password

OAuthTokenRefreshRequestBody

{
  "refresh_token": "string",
  "grant_type": "refresh_token",
  "client_id": "string",
  "client_secret": "string"
}

Properties

Name Type Required Restrictions Description
refresh_token string true none none
grant_type string true none none
client_id string true none none
client_secret string true none none

Enumerated Values

Property Value
grant_type refresh_token

OAuthTokenResponseBody

{
  "access_token": "string",
  "refresh_token": "string",
  "expires_in": 0,
  "scope": "string",
  "token_type": "string"
}

Properties

Name Type Required Restrictions Description
access_token string true none none
refresh_token string true none none
expires_in integer true none none
scope string¦null false none none
token_type string true none none

CustomerSummaryResponseBody

{
  "ridesCount": 0,
  "ridesHours": 0
}

Properties

Name Type Required Restrictions Description
ridesCount integer false none none
ridesHours integer false none none

CustomerDetailsResponseBody

{
  "id": 0,
  "firstName": "string",
  "lastName": "string",
  "lastName2": "string",
  "username": "string",
  "contactEmail": "string",
  "telephoneNumber": "string",
  "additionalNumber": "string"
}

Properties

Name Type Required Restrictions Description
id integer false none none
firstName string false none none
lastName string false none none
lastName2 string¦null false none none
username string false none none
contactEmail string false none none
telephoneNumber string false none none
additionalNumber string¦null false none none

CustomerGraphqlRequestBody

{
  "query": "string"
}

Properties

Name Type Required Restrictions Description
query string true none none

CustomerRide

{
  "id": 0,
  "accountId": 0,
  "status": "string",
  "duration": 0,
  "bikeNumber": "string",
  "originStationCode": "string",
  "originStation": "string",
  "originSlotId": "string",
  "checkoutTime": "2019-08-24T14:15:22Z",
  "destinationStationCode": "string",
  "destinationStation": "string",
  "destinationSlotId": "string",
  "checkinTime": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
id integer false none none
accountId integer false none none
status string false none none
duration integer false none none
bikeNumber string false none none
originStationCode string false none none
originStation string false none none
originSlotId string false none none
checkoutTime string(date-time) false none none
destinationStationCode string false none none
destinationStation string false none none
destinationSlotId string false none none
checkinTime string(date-time) false none none

CustomerIsRidingGraphqlResponseBodyData

{
  "CustomerIsRiding": {
    "id": 0,
    "accountId": 0,
    "status": "string",
    "duration": 0,
    "bikeNumber": "string",
    "originStationCode": "string",
    "originStation": "string",
    "originSlotId": "string",
    "checkoutTime": "2019-08-24T14:15:22Z",
    "destinationStationCode": "string",
    "destinationStation": "string",
    "destinationSlotId": "string",
    "checkinTime": "2019-08-24T14:15:22Z"
  }
}

Properties

Name Type Required Restrictions Description
CustomerIsRiding CustomerRide false none none

CustomerIsRidingGraphqlResponseBody

{
  "data": {
    "CustomerIsRiding": {
      "id": 0,
      "accountId": 0,
      "status": "string",
      "duration": 0,
      "bikeNumber": "string",
      "originStationCode": "string",
      "originStation": "string",
      "originSlotId": "string",
      "checkoutTime": "2019-08-24T14:15:22Z",
      "destinationStationCode": "string",
      "destinationStation": "string",
      "destinationSlotId": "string",
      "checkinTime": "2019-08-24T14:15:22Z"
    }
  }
}

Properties

Name Type Required Restrictions Description
data CustomerIsRidingGraphqlResponseBodyData false none none

CustomerRidesGraphqlResponseBodyData

{
  "CustomerRides": [
    {
      "id": 0,
      "accountId": 0,
      "status": "string",
      "duration": 0,
      "bikeNumber": "string",
      "originStationCode": "string",
      "originStation": "string",
      "originSlotId": "string",
      "checkoutTime": "2019-08-24T14:15:22Z",
      "destinationStationCode": "string",
      "destinationStation": "string",
      "destinationSlotId": "string",
      "checkinTime": "2019-08-24T14:15:22Z"
    }
  ]
}

Properties

Name Type Required Restrictions Description
CustomerRides [CustomerRide] false none none

CustomerRidesGraphqlResponseBody

{
  "data": {
    "CustomerRides": [
      {
        "id": 0,
        "accountId": 0,
        "status": "string",
        "duration": 0,
        "bikeNumber": "string",
        "originStationCode": "string",
        "originStation": "string",
        "originSlotId": "string",
        "checkoutTime": "2019-08-24T14:15:22Z",
        "destinationStationCode": "string",
        "destinationStation": "string",
        "destinationSlotId": "string",
        "checkinTime": "2019-08-24T14:15:22Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
data CustomerRidesGraphqlResponseBodyData false none none