# Graph Statistics (deprecated)

Retrieve information on the evolution of statistics by grouping them by time intervals. You need to specify the time intervals with the Scale query parameter, as well as the overall time period with Period or FromTS and ToTS.

> Note: This is a legacy endpoint. We advise using /statcounters to retrieve information on the evolution of statistics.

Endpoint: GET /v3/REST/graphstatistics
Version: 1.0.0
Security: basicAuth

## Query parameters:

  - `CampaignID` (integer)
    Retrieves stats evolution only for the specified Campaign ID.

  - `ContactID` (integer)
    Retrieves stats evolution only for messages sent to the specified contact ID.

  - `ContactsList` (integer)
    Retrieves stats evolution only for the specified contact list ID.

  - `CustomCampaign` (string)
    Retrieves stats evolution only for the campaign with the specified Custom Value.

  - `From` (string)
    Retrieves stats evolution only for messages sent from the specified Sender Email address.

  - `FromDomain` (string)
    Retrieves stats evolution only for messages sent from the specified domain.

  - `FromID` (integer)
    Retrieves stats evolution only for messages sent from the sender address with the specified ID.

  - `FromTS` (string)
    Retrieves stats evolution only for messages sent after the specified timestamp. Mandatory along with ToTS, unless Period is specified instead. Both Unix timestamp (e.g. 1514764800) and RFC3339 (2018-01-01T00:00:00) formats are accepted.

  - `FromType` (integer)
    Retrieves stats evolution only for a specific type of messages:

- 1 - Transactional
- 2 - Marketing
- 3 - Unknown

  - `IsDeleted` (boolean)
    When true, will retrieve stats evolution only for deleted campaigns. When false, stats for deleted campaigns will be excluded from the response.

  - `IsNewsletterTool` (boolean)
    When true, will retrieve stats evolution only for campaigns created with the Legacy template builder. When false, campaigns created with the Legacy builder will be excluded from the response.

  - `IsStarred` (boolean)
    When true, will retrieve stats evolution only for starred campaigns. When false, starred campaigns will be excluded from the response.

  - `MessageStatus` (integer)
    Retrieves stats evolution only for messages with the specified status:

- 0 (Processed)
- 1 (Queued)
- 2 (Sent)
- 3 (Opened)
- 4 (Clicked)
- 5 (Bounce)
- 6 (Spam)
- 7 (Unsub)
- 8 (Blocked)
- 9 (SoftBounce)
- 10 (HardBounce)
- 11 (Deferred)

  - `Period` (string)
    Retrieves stats evolution only for messages sent between the start of the selected period and the current timestamp. Mandatory, unless FromTS and ToTS are specified instead.

- Day - since the start of the current day
- Week - since the start of the current week
- Month - since the start of the current month
- Year - since the start of the current year
    Example: "Day"

  - `Scale` (string, required)
    Scale of the time intervals for the statistics:

- Hour
- Day
- Week
- Month
- Year
    Example: "Hour"

  - `TimeShift` (integer)
    Timeshift for the RefTimeStamp in seconds. Used to convert the timestamp from its initial value to a different time zone. Submitted as a multiple of 3600 (negative values are accepted).

Example: a TimeShift=7200 will convert a RefTimeStamp from 2018-02-01T00:00:00 to 2018-01-31T22:00:00-2:00

  - `ToTS` (string)
    Retrieves stats evolution only for messages sent before the specified timestamp. Mandatory along with FromTS, unless Period is specified instead. Both Unix timestamp (e.g. 1514764800) and RFC3339 (2018-01-01T00:00:00) formats are accepted.

  - `WorkflowID` (integer)
    Retrieves stats evolution only for messages triggered by the specified automation workflow.

## Response 200 fields (application/json):

  - `Count` (integer)
    Indicates the number of objects in the Data array.

  - `Data` (array)
    A JSON array containing a list of objects returned by this endpoint.

  - `Data.BlockedCount` (integer)
    Number of blocked messages.

  - `Data.BouncedCount` (integer)
    Number of bounced messages.

  - `Data.ClickedCount` (integer)
    Number of registered clicks.

  - `Data.DeferredCount` (integer)
    Number of deferred messages - ones that could not be delivered and the system is retrying to send. If after 3 days the sending is unsuccessful, those messages become soft-bounced.

  - `Data.DeliveredCount` (integer)
    Number of messages delivered to their destination.

  - `Data.HardbouncedCount` (integer)
    Number of hard-bounced messages.

  - `Data.OpenedCount` (integer)
    Number of opened messages.

  - `Data.ProcessedCount` (integer)
    Number of processed messages.

  - `Data.QueuedCount` (integer)
    Number of queued messages.

  - `Data.RefTimestamp` (string)
    Timestamp indicating the start of the time interval for this stats object. The end of the time interval depends on the selected Scale.

  - `Data.SendtimeStart` (integer)
    Unix timestamp indicating the starting time of this interval.

  - `Data.SoftbouncedCount` (integer)
    Number of soft-bounced messages.

  - `Data.SpamcomplaintCount` (integer)
    Number of messages marked as Spam by the recipients.

  - `Data.UnsubscribedCount` (integer)
    Number of registered unsubscribe requests.

  - `Total` (integer)
    Indicates the number of objects in the Data array.


## Response 400 fields

## Response 401 fields

## Response 403 fields

## Response 404 fields

## Response 429 fields

## Response 500 fields
