Kampagnendetails erhalten

Diese Methode ermöglicht es Ihnen, Ihren Verbrauch abzurufen.

GET

/metrics/consumption

GET Parameter

date_start Hinzufügen eines Filters zum Abrufen des Verbrauchs, dessen Versanddatum nach diesem Datum liegt. Das Datumsformat muss wie folgt lauten: Y-m-d
date_end Hinzufügen eines Filters zum Abrufen des Verbrauchs, dessen Versanddatum vor diesem Datum liegt. Das Datumsformat muss wie folgt lauten: Y-m-d
country Fügen Sie einen Filter hinzu, um Ihren Verbrauch für ein bestimmtes Land abzurufen. Sie können den Verbrauch für mehrere Länder durch ein Komma getrennt abrufen. Die Länder müssen im Format alpha2 angegeben werden. country=FR,CH
sub_account_id Einen Filter hinzufügen, um den Verbrauch eines bestimmten Unterkontos abzurufen.

Beispiele


GET /metrics/consumption HTTP/1.1
Host: api.smsfactor.com
Accept: application/json
Authorization: Bearer your.token
      
    

Ergebnisformat


{
    "status": 1,
    "message": "OK",
    "data": {
        "total": 100,
        "by_country": {
            "FR": 50,
            "CH": 30,
            "IT": 20,
        },
        "my_account": {
            "account_id": 1,
            "company": "My company",
            "conso": {
                "total": 80,
                "by_country": {
                    "FR": 50,
                    "CH": 30,
                }
            }
        },
        "by_sub_accounts": [
            {
                "account_id": 2,
                "company": "My sub account company",
                "conso": {
                    "total": 20,
                    "by_country": [
                        "IT" : 20
                    ]
                }
            }
        ]
    }
}
          
        

<?xml version="1.0" encoding="UTF-8" ?>
<response>
  <status>1</status>
  <message>OK</message>
  <data>
    <total>100</total>
    <by_country>
        <FR>50</FR>
        <CH>30</CH>
        <IT>20</IT>
    </by_country>
    <my_account>
        <account_id>1</account_id>
        <company>My company</company>
        <conso>
            <total>80</total>
            <by_country>
                <FR>50</FR>
                <CH>30</CH>
            </by_country>
        </conso>
    </my_account>
    <by_sub_accounts>
        <account_id>2</account_id>
        <company>My sub account company</company>
        <conso>
            <total>20</total>
            <by_country>
                <IT>20</IT>
            </by_country>
        </conso>
    </by_sub_accounts>
  </data>
</response>