younifyd
Menu

Get Legacy Statistic

Retrieve a statistic

POST/api/stats/{name}

Use it in a workflow

  1. Add a step and choose the Gorgias connector.
  2. Pick the Get Legacy Statistic action (under Statistics).
  3. Fill in the fields below, then reference the result from later steps as {{getLegacyStatistic.response.data}}.

Request

Path parameters

namestringrequired

The name of the statistic to retrieve.

One ofoverviewtotal-tickets-createdtotal-tickets-repliedtotal-tickets-closedtotal-messages-senttotal-messages-receivedmedian-first-response-timemedian-resolution-timetotal-one-touch-ticketssupport-volumeresolution-timefirst-response-timetickets-created-per-hour-per-weekdaytickets-per-tagtickets-created-per-channeltickets-created-per-channel-per-daytickets-closed-per-agenttickets-closed-per-agent-per-daymessages-sent-per-macrosatisfaction-surveyslatest-satisfaction-surveysintents-occurrenceintents-overviewintents-breakdown-per-dayrevenue-overviewrevenue-per-agentrevenue-per-dayrevenue-per-ticketself-service-volume-per-flowself-service-article-recommendation-performanceself-service-top-reported-issuesself-service-products-with-most-issues-and-return-requestsself-service-workflows-performance

Request body

Enter the body as JSON in the step's Body field.

filtersobjectrequired

Miscellaneous criteria to define the scope of the statistic.

periodobject2 fields

Time period to filter the statistic by.

agentsarray<integer>

ID of users to filter the statistic by.

Default []

channelsarray<string>

Channels to filter the statistic by.

Default []

campaignsarray<string>

Campaigns to filter the statistic by.

Default []

tagsarray<integer>

ID of tags to filter the statistic by.

Default []

integrationsarray<integer>

ID of integrations to filter the statistic by.

Default []

scorearray<integer>

Satisfaction survey scores to filter the statistic by.

Default []

json
{
  "filters": {
    "period": {
      "start_datetime": "2020-06-10T00:00:00-05:00",
      "end_datetime": "2020-06-16T23:59:59-05:00"
    },
    "agents": [
      12345,
      67890
    ],
    "channels": [
      "chat",
      "email"
    ],
    "campaigns": [
      "123",
      "234"
    ],
    "tags": [
      321,
      654,
      987
    ],
    "integrations": [
      555,
      777
    ],
    "score": [
      3,
      4
    ]
  }
}

Response

Returns 201 with an object. Read it in later steps with {{getLegacyStatistic.response.data.<field>}}.

dataobject

The data of the statistic. Data structure varies according to the type of the statistic (e.g. key metric, bar chart, table)

metaobject

Timestamps used to build the statistic.

end_datetimestring (date-time)required

End of the time period.

previous_end_datetimestring (date-time)

End of the previous time period.

previous_start_datetimestring (date-time)

Start of the previous time period.

start_datetimestring (date-time)required

Start of the time period.

json
{
  "data": {
    "data": {
      "axes": {
        "x": [
          1591765200
        ],
        "y": []
      },
      "lines": [
        {
          "data": [
            1829,
            1498,
            1611
          ],
          "name": "created"
        }
      ]
    },
    "label": "Support volume",
    "legend": {
      "axes": {
        "x": "Creation date",
        "y": "Number of tickets"
      }
    }
  },
  "meta": {
    "start_datetime": "2020-06-10T00:00:00-05:00",
    "end_datetime": "2020-06-16T23:59:59-05:00",
    "previous_start_datetime": "2020-06-03T00:00:01-05:00",
    "previous_end_datetime": "2020-06-10T00:00:00-05:00",
    "next_cursor": "WyJuZXh0IiwgZmFsc2UsICJBbGV4IFBsdWdhcnUiLCAyXQ==",
    "prev_cursor": "WyJwcmV2IiwgZmFsc2UsICJCb2IgU21pdGgiLCAzXQ=="
  }
}

Need more? See the Gorgias guide for connection setup and behaviour shared by every action.