Billing


Retrieves historical usage data

GEThttps://api-ipfs.attoaioz.cyou/api/billing/historyUsage

Parameters

Query

offset
(default: 0)
limit
(default: 10)

Header

pinning_api_key*
PINNING-API-KEY
pinning_secret_key*
PINNING-SECRET-KEY

Response

200: OK
{
    "data": {
        "total_days": number,
        "history_usages": [
            {
                "date": "2023-01-01T11:11:11.111111Z",
                "total_storage": number,
                "total_bandwidth": number,
                "total_amount": "string"
            }
        ]
    },
    "status": "success"
}
curl --location --request GET 'https://api-ipfs.attoaioz.cyou/api/billing/historyUsage?offset=0&limit=10' \
--header 'pinning_api_key: KEY' \
--header 'pinning_secret_key: SECRET'
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api-ipfs.attoaioz.cyou/api/billing/historyUsage?offset=0&limit=10',
  headers: { 
    'pinning_api_key': 'KEY', 
    'pinning_secret_key': 'SECRET'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
import requests

url = "https://api-ipfs.attoaioz.cyou/api/billing/historyUsage?offset=0&limit=10"

payload = ""
headers = {
  'pinning_api_key': 'KEY',
  'pinning_secret_key': 'SECRET'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-ipfs.attoaioz.cyou/api/billing/historyUsage?offset=0&limit=10"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("pinning_api_key", "KEY")
  req.Header.Add("pinning_secret_key", "SECRET")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Retrieves top up data

GEThttps://api-ipfs.attoaioz.cyou/api/billing/topUp

Parameters

Query

offset
(default: 0)
limit
(default: 10)

Header

pinning_api_key*
PINNING-API-KEY
pinning_secret_key*
PINNING-SECRET-KEY

Response

200: OK
{
    "data": {
        "totals": number,
        "top_up_usages": [
            {
                "cosmos_tx_hash": "string",
                "event_index": number,
                "evm_tx_hash": "string",
                "id": "string",
                "sender": "string",
                "recipient": "string",
                "block_number": number,
                "status": true,
                "amount": {
                    "denom": "string",
                    "amount": "string"
                },
                "total_amount": "string",
                "created_at": "2023-01-01T11:11:11.111111Z",
                "updated_at": "2023-01-01T11:11:11.111111Z"
            }
        ]
    },
    "status": "success"
}
curl --location --request GET 'https://api-ipfs.attoaioz.cyou/api/billing/topUp?offset=0&limit=10' \
--header 'pinning_api_key: KEY' \
--header 'pinning_secret_key: SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "test-api-key3",
    "scopes": {
        "data": {
            "pinList": true
        },
        "pinning": {
            "unpin": true
        }
    }
}'
var axios = require('axios');
var data = JSON.stringify({
  "name": "test-api-key3",
  "scopes": {
    "data": {
      "pinList": true
    },
    "pinning": {
      "unpin": true
    }
  }
});

var config = {
  method: 'get',
  url: 'https://api-ipfs.attoaioz.cyou/api/billing/topUp?offset=0&limit=10',
  headers: { 
    'pinning_api_key': 'KEY', 
    'pinning_secret_key': 'SECRET', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
import requests
import json

url = "https://api-ipfs.attoaioz.cyou/api/billing/topUp?offset=0&limit=10"

payload = json.dumps({
  "name": "test-api-key3",
  "scopes": {
    "data": {
      "pinList": True
    },
    "pinning": {
      "unpin": True
    }
  }
})
headers = {
  'pinning_api_key': 'KEY',
  'pinning_secret_key': 'SECRET',
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-ipfs.attoaioz.cyou/api/billing/topUp?offset=0&limit=10"
  method := "GET"

  payload := strings.NewReader(`{
    "name": "test-api-key3",
    "scopes": {
        "data": {
            "pinList": true
        },
        "pinning": {
            "unpin": true
        }
    }
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("pinning_api_key", "KEY")
  req.Header.Add("pinning_secret_key", "SECRET")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Get this month usage data for a user

GEThttps://api-ipfs.attoaioz.cyou/api/billing/thisMonthUsage

Parameters

Query

offset
(default: 0)
limit
(default: 10)

Header

pinning_api_key*
PINNING-API-KEY
pinning_secret_key*
PINNING-SECRET-KEY

Response

200: OK
{
    "data": {
        "total_storage": number,
        "storage_usage": number,
        "bandwidth_usage": number,
        "storage_cost": "string",
        "bandwidth_cost": "string"
    },
    "status": "success"
}
curl --location --request GET 'https://api-ipfs.attoaioz.cyou/api/billing/thisMonthUsage?offset=0&limit=10' \
--header 'pinning_api_key: KEY' \
--header 'pinning_secret_key: SECRET'
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api-ipfs.attoaioz.cyou/api/billing/thisMonthUsage?offset=0&limit=10',
  headers: { 
    'pinning_api_key': 'KEY', 
    'pinning_secret_key': 'SECRET'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
import requests

url = "https://api-ipfs.attoaioz.cyou/api/billing/thisMonthUsage?offset=0&limit=10"

payload={}
headers = {
  'pinning_api_key': 'KEY',
  'pinning_secret_key': 'SECRET'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-ipfs.attoaioz.cyou/api/billing/thisMonthUsage?offset=0&limit=10"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("pinning_api_key", "KEY")
  req.Header.Add("pinning_secret_key", "SECRET")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}