OpenSocialDocumentação

analytics_list

Consultar snapshots de métricas, unidade e período.

REST · POST /api/v1/operations/analytics_list · MCP · analytics_list

Permissão necessária · analytics. Esta operação consulta dados.

Exemplo de entrada

{}

O REST retorna a saída abaixo diretamente. No MCP leia structuredContent.result. Consulte o contrato atual em /api/v1/openapi.json.

Em 401 confira a validade da credencial. Em 403 confira papel, escopos e contas. Em 409 releia o registro antes de tentar novamente.

JSON Schema · Entrada

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "mediaId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "publicationId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "accountId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "projectId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "platform": {
      "type": "string",
      "enum": [
        "youtube",
        "instagram",
        "tiktok",
        "simulated"
      ]
    },
    "from": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "to": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "limit": {
      "default": 100,
      "type": "integer",
      "minimum": 1,
      "maximum": 200
    },
    "offset": {
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  },
  "additionalProperties": false
}

JSON Schema · Saída

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "publication_id": {
        "type": "string"
      },
      "account_id": {
        "type": "string"
      },
      "media_id": {
        "type": "string"
      },
      "platform": {
        "type": "string"
      },
      "metric": {
        "type": [
          "string",
          "null"
        ]
      },
      "value": {
        "type": [
          "number",
          "null"
        ]
      },
      "unit": {
        "type": [
          "string",
          "null"
        ]
      },
      "availability": {
        "type": "string",
        "enum": [
          "available",
          "pending",
          "unavailable"
        ]
      },
      "period": {
        "type": [
          "string",
          "null"
        ]
      },
      "observed_at": {
        "type": [
          "string",
          "null"
        ]
      }
    },
    "required": [
      "publication_id",
      "account_id",
      "media_id",
      "platform",
      "metric",
      "value",
      "unit",
      "availability",
      "period",
      "observed_at"
    ],
    "additionalProperties": {}
  }
}