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. 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. 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. 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:

{
  "ont_id": "did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm",
  "signature": "AYAMGuzl1lh4VQ6PbIQIa2M....fvs6VIfhBfYD4HkqqIGE=",
  "timestamp": 1596164819 // UNIX timestamp
}

Response:

{
  "Action": "",
  "Error": 0,
  "Desc": "SUCCESS",
  "Version": "1.0",
  "Result": {
    "score": "400"
  }
}

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:

{
  "ont_id": "did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm",
  "signature": "AYAMGuzl1lh4VQ6PbIQIa2M....fvs6VIfhBfYD4HkqqIGE=",
  "timestamp": 1596164819
}

Response:

{
  "Action": "",
  "Error": 0,
  "Desc": "SUCCESS",
  "Version": "1.0",
  "Result": {
    "snapshot_asset_avg_usd": "0",
    "asset_usd": "0",
    "exchange_asset_usd": "0"
  }
}

Last updated