> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.smartsim.telecom.li/llms.txt.

# Organization usage and costs statistics per day for the current month

GET https://smartsim.telecom.li/api/v1/stats/daily

Retrieve usage and costs statistics for the currently logged in organization and all child organizations, accumulated per days from beginning of the month until today.

Data traffic costs aren't returned for enterprise organizations with inclusive volume.

Reference: https://docs.smartsim.telecom.li/developers/api/organization/statistics-daily-by-id-get

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Response

### 200

Success

- `list of any`

## Examples

**Response**

```json
[
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-26T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-25T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-24T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-23T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-22T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-21T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": "0.1265244000",
      "currency": null,
      "traffic_type": {
        "description": "Data",
        "id": 5,
        "unit": "MB"
      },
      "volume": 0.632622,
      "volume_rx": 0.447761,
      "volume_tx": 0.184861
    },
    "date": "2019-03-20T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-19T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-18T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-17T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-16T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-15T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-14T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": "0.0406042000",
      "currency": null,
      "traffic_type": {
        "description": "Data",
        "id": 5,
        "unit": "MB"
      },
      "volume": 0.203021,
      "volume_rx": 0.168322,
      "volume_tx": 0.034699
    },
    "date": "2019-03-13T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-12T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": "0.1940802000",
      "currency": null,
      "traffic_type": {
        "description": "Data",
        "id": 5,
        "unit": "MB"
      },
      "volume": 0.970401,
      "volume_rx": 0.702297,
      "volume_tx": 0.268104
    },
    "date": "2019-03-11T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-10T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-09T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-08T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": "0.0895020000",
      "currency": null,
      "traffic_type": {
        "description": "Data",
        "id": 5,
        "unit": "MB"
      },
      "volume": 0.44751,
      "volume_rx": 0.295016,
      "volume_tx": 0.152494
    },
    "date": "2019-03-07T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": "0.3607010000",
      "currency": null,
      "traffic_type": {
        "description": "Data",
        "id": 5,
        "unit": "MB"
      },
      "volume": 1.803505,
      "volume_rx": 1.334108,
      "volume_tx": 0.469397
    },
    "date": "2019-03-06T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": "1.9742046000",
      "currency": null,
      "traffic_type": {
        "description": "Data",
        "id": 5,
        "unit": "MB"
      },
      "volume": 9.871023,
      "volume_rx": 8.223547,
      "volume_tx": 1.647476
    },
    "date": "2019-03-05T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-04T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-03T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-02T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    },
    "date": "2019-03-01T00:00:00.000Z",
    "sms": {
      "cost": null,
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  },
  {
    "data": {
      "cost": "2.7856164000",
      "currency": null,
      "traffic_type": {
        "description": "Data",
        "id": 5,
        "unit": "MB"
      },
      "volume": 13.928082,
      "volume_rx": 11.171051,
      "volume_tx": 2.757031
    },
    "date": "TOTAL",
    "sms": {
      "cost": 0,
      "currency": "",
      "traffic_type": "",
      "volume": 0,
      "volume_rx": 0,
      "volume_tx": 0
    }
  }
]
```

**SDK Code**

```python Retrieved
import requests

url = "https://smartsim.telecom.li/api/v1/stats/daily"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Retrieved
const url = 'https://smartsim.telecom.li/api/v1/stats/daily';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Retrieved
package main

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

func main() {

	url := "https://smartsim.telecom.li/api/v1/stats/daily"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Retrieved
require 'uri'
require 'net/http'

url = URI("https://smartsim.telecom.li/api/v1/stats/daily")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Retrieved
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://smartsim.telecom.li/api/v1/stats/daily")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Retrieved
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://smartsim.telecom.li/api/v1/stats/daily', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Retrieved
using RestSharp;

var client = new RestClient("https://smartsim.telecom.li/api/v1/stats/daily");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Retrieved
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://smartsim.telecom.li/api/v1/stats/daily")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```