Using the API¶
In order to start using the REST API you need to:
- Sign up at Vigla,
- add a wallet,
- retrieve the
access tokenform the wallet page.
The access token is a random UUID automatically generated when you add a wallet to Vigla. It should be kept secret and for that reason it’s hidden on the page by default.
Warning
Should you have any suspicions about your access token being disclosed to unauthorized person, please generate a new one and update your config.
Basic settings¶
The base URL for all API requests is https://api.vigla.biz/
All input data is required to be in JSON format, and all responses are returned in JSON format.
Authentication¶
The API requires HTTP Basic auth with:
- username: the wallet’s master address,
- password: the
access token
Making requests¶
Let’s assume you have a wallet with:
- address
56eDKfprZtQGfB4y6gVLZx5naKVHw6KEKLDoq2WWtLng9ANuBvsw67wfqyhQECoLmjQN4cKAdvMp2WsC5fnw9seKLcCSfjj- access token
b690d2d2-80cf-41f1-a2c8-29972c076d24
An example request using Python requests library would look like:
import json
import requests
import requests.auth
auth = requests.auth.HTTPBasicAuth(
"56eDKfprZtQGfB4y6gVLZx5naKVHw6KEKLDoq2WWtLng9ANuBvsw67wfqyhQECoLmjQN4cKAdvMp2WsC5fnw9seKLcCSfjj",
"b690d2d2-80cf-41f1-a2c8-29972c076d24")
rsp = requests.post("https://api.vigla.biz/info/", auth=auth)
print(json.dumps(rsp.json(), indent=2))
And example output would be:
{
"active_until": "2020-05-18T11:00:26.743958",
"addresses": {
"active": 65,
"all": 76
},
"created": "2020-02-18T11:00:26.744348",
"height": 0,
"master_address": "56eDKfprZtQGfB4y6gVLZx5naKVHw6KEKLDoq2WWtLng9ANuBvsw67wfqyhQECoLmjQN4cKAdvMp2WsC5fnw9seKLcCSfjj",
"name": "test order payments",
"net": "stage",
"notify_url": "http://my.shop.url/vigla-notify/",
"watch_master": false
}
With the connection properly set up, it’s time to obtain your first address.