Report (Trader API v1)
  • 26 Jun 2023
  • 2 Minutes to read
  • Dark
    Light

Report (Trader API v1)

  • Dark
    Light

Article summary

Report

The JSON Schema definition for a report is the following:

{
  "id": "Report",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Report's identifier"
    },
    "public_id": {
      "type": "string",
      "description": "Report's public identifier"
    },
    "status": {
      "type": "string",
      "enum": ["scheduled","running","completed","deleted","error","expired"],
      "description": "Report's status"
    },
    "urls": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Report's result public download urls"
    },
    "secure_urls": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Report's result public download urls over HTTPS"
    },
    "created_at": {
      "type": "string",
      "description": "Report's creation date, in ISO 8601 format"
    },
    "updated_at": {
      "type": "string",
      "description": "Report's last status change date, in ISO 8601 format"
    },
    "deleted_at": {
      "type": "string",
      "description": "Report's deletion date, in ISO 8601 format"
    },
    "completed_at": {
      "type": "string",
      "description": "Report's completion date, in ISO 8601 format"
    },
    "expires_on": {
      "type": "string",
      "description": "Report's expiration date, in ISO 8601 format"
    },
    "error_code": {
      "type": "integer",
      "description": "error code if status is 'error'"
    }
    "error_message": {
      "type": "string",
      "description": "human error message if status is 'error'"
    },
    "author_id": {
      "type": "integer",
      "description": "Author's identifier"
    },
    "author_name": {
      "type": "string",
      "max": 255,
      "description": "Author's name"
    },
    "title": {
      "type": "string",
      "max": 255,
      "description": "Report's title"
    },
    "metadata": {
      "type": "string",
      "max": 4096,
      "description": "User provided metadata that the reporting service will store.
       This is usually used to store escaped json"
    },
    "query": {
      "type": "Query",
      "description": "A query model object that should be executed."
    },
    "notification": {
      "type": "Notification",
      "description": "A Notification model object that will be called on success."
    },
    "output_formats": {
      "type": "array",
      "items": { "type": "OutputFormat" },
      "description": "A list of OutputFormat model objects."
    },
    "template_name": {
      "type": "string",
      "max": 255,
      "description": "Reports Template Name. It is used as sheet name when generating excel report"         
    }   
     
  },
  "required": ["title","query"],
  "provided": ["id","public_id","urls","secure_urls","created_at","updated_at","deleted_at",
               "completed_at","expires_on","error_message"]
}

The JSON Schema definition of a Notification is the following:

{
  "id": "Notification",
  "properties": {
    "emails": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Email addresses to be notified on completion (successful or not)"
    },
    "http_callbacks": {
      "type": "array",
      "items": { "type": "string" },
      "description": "URLs to post the notification object to on completion (successful or not).
       An HTTP/HTTPS POST of Content-Type: 'application/json' is sent to the specified URL
       with a message body containing the Report info in JSON format"
    }
  }
}

The JSON Schema definition of an OutputFormat is the following:

{
  "id": "OutputFormat",
  "properties": {
    "format" : {
      "type": "string",
      "enum": ["csv","tsv","json","xlsx"],
      "description": "Output format type"
    },
    "compression" {
      "type": "string",
      "enum": ["zip","gzip","none"],
      "description": "Output compression type"
    }
  }
}

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.