OScore Open API
OScore API reference
OScore is a digital asset score that is calculated based on the assigned to each wallet account on the Ontology chain. The score can be queried by sending requests to the following public APIs.

Request Particulars

  1. 1.
    The timestamp sent in the request is only valid for 30 seconds. In case this threshold is exceeded the error code 62020 will be sent in the response.
  2. 2.
    The request needs to be signed by the respective ONT ID. The back end carries out signature verification. If verification fails, the 62006 error code will be sent in response.
  3. 3.
    The ONT ID and timestamp are concatenated together to obtain the signature content. The signature is a base64 string. For example, for ont_id=did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm and timestamp=1596164819, the ONT ID's private key is used to sign the signature data and generate the base64 string. The data to be signed is did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm1596164819
The base URL used to send the requests is https://service.onto.app/S5

Fetch User's Asset Score

This method can be used to fetch a user's asset score by passing the ONT ID.
Method: POST
URL: /v2/ontoservice/asset_score
Request:
1
{
2
"ont_id": "did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm",
3
"signature": "AYAMGuzl1lh4VQ6PbIQIa2M....fvs6VIfhBfYD4HkqqIGE=",
4
"timestamp": 1596164819 // UNIX timestamp
5
}
Copied!
Response:
1
{
2
"Action": "",
3
"Error": 0,
4
"Desc": "SUCCESS",
5
"Version": "1.0",
6
"Result": {
7
"score": "400"
8
}
9
}
Copied!

Fetch User's Asset Score Details

This method can be used to fetch details regarding a user's asset score by passing the ONT ID.
Method: POST
URL: /v2/ontoservice/asset_score/detail
Request:
1
{
2
"ont_id": "did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm",
3
"signature": "AYAMGuzl1lh4VQ6PbIQIa2M....fvs6VIfhBfYD4HkqqIGE=",
4
"timestamp": 1596164819
5
}
Copied!
Response:
1
{
2
"Action": "",
3
"Error": 0,
4
"Desc": "SUCCESS",
5
"Version": "1.0",
6
"Result": {
7
"snapshot_asset_avg_usd": "0",
8
"asset_usd": "0",
9
"exchange_asset_usd": "0"
10
}
11
}
Copied!
Field
Type
Description
snapshot_asset_avg_usd
String
Daily average asset value for all accounts in USD
asset_usd
String
Current asset value in USD
exchange_asset_usd
String
Total assets in exchange wallet accounts in USD
Last modified 1yr ago