{
  "openapi": "3.0.3",
  "info": {
    "contact": {
      "email": "api@factset.com",
      "name": "FactSet Research Systems",
      "url": "https://developer.factset.com/contact"
    },
    "description": "Service for refreshing models with refreshable FactSet objects (e.g., =FDS codes)",
    "license": {
      "name": "Apache License, Version 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "Investment Banking Office Refresh API",
    "version": "1.0.0"
  },
  "externalDocs": {
    "description": "API Documentation",
    "url": "https://developer.factset.com/api-catalog/"
  },
  "servers": [
    {
      "url": "https://api.factset.com/office-refresh/v1"
    }
  ],
  "security": [
    {
      "FactSetApiKey": []
    },
    {
      "FactSetOAuth2": []
    }
  ],
  "tags": [
    {
      "description": "Endpoints that have to do with refreshing a recieving a file",
      "name": "Refresh Operations"
    },
    {
      "description": "Endpoints that deal with viewing and cancelling active jobs",
      "name": "Job Management"
    }
  ],
  "paths": {
    "/refresh/calculate": {
      "post": {
        "description": "Start refreshing a spreadsheet file (in the Open Office XML format).",
        "operationId": "postWorkbook",
        "parameters": [
          {
            "description": "Return \\#VALUE for =FDS codes dependent on NOW(). Default is true. For more information on volatile code handling, see Online Assistant https://my.apps.factset.com/oa/pages/16118.",
            "explode": true,
            "in": "query",
            "name": "nowHandlingEnabled",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "style": "form"
          },
          {
            "description": "Option to refresh =FDS codes within autofilters.  Codes that are filtered out will not be refreshed, unless this option is set to true.  Default is true.  For more information, see Online Assistant https://my.apps.factset.com/oa/pages/21084#fds",
            "explode": true,
            "in": "query",
            "name": "refreshAutoFilters",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "style": "form"
          },
          {
            "description": "Option to allow automatic array-resizing, which allows you to return a time series of data without manually setting an array.  Default is true.  For more information, see Online Assistant https://my.apps.factset.com/oa/pages/21084#fds",
            "explode": true,
            "in": "query",
            "name": "resizeArrays",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "style": "form"
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
              "schema": {
                "$ref": "#/components/schemas/SpreadsheetFile"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatus"
                }
              }
            },
            "description": "Accepted",
            "headers": {
              "Location": {
                "description": "Relative URL to check status of the request.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              },
              "X-Concurrent-Limit": {
                "$ref": "#/components/headers/X-Concurrent-Limit"
              },
              "X-Concurrent-Limit-Remaining": {
                "$ref": "#/components/headers/X-Concurrent-Limit-Remaining"
              },
              "X-Weekly-Limit": {
                "$ref": "#/components/headers/X-Weekly-Limit"
              },
              "X-Weekly-Limit-Remaining": {
                "$ref": "#/components/headers/X-Weekly-Limit-Remaining"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Forbidden. The user's subscription is missing required CACCESS."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "File Too Large.  Currently only accepting files up to 50MB."
          },
          "429": {
            "description": "Limit Exceeded",
            "headers": {
              "X-FactSet-Api-RateLimit-Limit": {
                "description": "Number of allowed requests for the time window.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              },
              "X-FactSet-Api-RateLimit-Limit-Remaining": {
                "description": "Number of requests left for the time window.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              },
              "X-FactSet-Api-RateLimit-Limit-Reset": {
                "description": "Number of seconds remaining till rate limit resets.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "Refresh a spreadsheet file",
        "tags": [
          "Refresh Operations"
        ],
        "x-contentType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "x-accepts": "application/json"
      }
    },
    "/refresh/{id}/status": {
      "get": {
        "description": "Check the status of the given job by the resource ID",
        "operationId": "getStatusById",
        "parameters": [
          {
            "description": "Unique identifier for the job (resource ID returned from FactSet).",
            "explode": false,
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatus"
                }
              }
            },
            "description": "Created (the calculated workbook is ready to be retrieved)",
            "headers": {
              "Location": {
                "description": "Relative URL to the calculated file",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              }
            }
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatus"
                }
              }
            },
            "description": "Accepted (resource not ready yet)",
            "headers": {
              "Location": {
                "description": "Relative URL to check status of the request.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Failed to refresh file"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "Get the status of the refresh job with the given resource ID",
        "tags": [
          "Refresh Operations"
        ],
        "x-accepts": "application/json"
      }
    },
    "/refresh/{id}": {
      "get": {
        "description": "If the requested job is complete, the calculated file will be returned.",
        "operationId": "getFileById",
        "parameters": [
          {
            "description": "Unique identifier for the job (resource ID returned from FactSet).",
            "explode": false,
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            },
            "style": "simple"
          },
          {
            "description": "Delete the file from FactSet servers after completing the request.",
            "explode": true,
            "in": "query",
            "name": "deleteFile",
            "required": false,
            "schema": {
              "default": true,
              "type": "boolean"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "$ref": "#/components/schemas/SpreadsheetFile"
                }
              }
            },
            "description": "Expected response; body will contain calculated file",
            "headers": {
              "Content-Disposition": {
                "description": "Standard HTTP header. Content is expected to be displayed as an attachment.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              },
              "Content-Type": {
                "description": "Standard HTTP header. The file format type.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              },
              "Transfer-Encoding": {
                "description": "Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              }
            }
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatus"
                }
              }
            },
            "description": "Accepted (resource not ready yet)",
            "headers": {
              "Location": {
                "description": "Relative URL to check status of the request.",
                "explode": false,
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Failed to refresh file"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "Retrieve a calculated file by resource ID.",
        "tags": [
          "Refresh Operations"
        ],
        "x-factset-different-success-responses": true,
        "x-accepts": "application/json"
      }
    },
    "/jobs": {
      "delete": {
        "description": "Cancel all active (on_hold, queued, executing) jobs",
        "operationId": "cancelAllActiveJobs",
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "Cancel all active jobs",
        "tags": [
          "Job Management"
        ],
        "x-accepts": "application/json"
      },
      "get": {
        "description": "Get the ids and status of all active jobs",
        "operationId": "getJobs",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveJobStatusList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "X-Concurrent-Limit": {
                "$ref": "#/components/headers/X-Concurrent-Limit"
              },
              "X-Concurrent-Limit-Remaining": {
                "$ref": "#/components/headers/X-Concurrent-Limit-Remaining"
              },
              "X-Weekly-Limit": {
                "$ref": "#/components/headers/X-Weekly-Limit"
              },
              "X-Weekly-Limit-Remaining": {
                "$ref": "#/components/headers/X-Weekly-Limit-Remaining"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "Get information on all active jobs",
        "tags": [
          "Job Management"
        ],
        "x-accepts": "application/json"
      }
    },
    "/jobs/{id}": {
      "delete": {
        "description": "Cancel a specific job by the resource ID",
        "operationId": "cancelActiveJob",
        "parameters": [
          {
            "description": "Unique identifier for the job (resource ID returned from FactSet).",
            "explode": false,
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "Cancel a job with the given resource ID",
        "tags": [
          "Job Management"
        ],
        "x-accepts": "application/json"
      }
    }
  },
  "components": {
    "headers": {
      "X-Concurrent-Limit": {
        "description": "Number of concurrent jobs running",
        "explode": false,
        "schema": {
          "type": "string"
        },
        "style": "simple"
      },
      "X-Concurrent-Limit-Remaining": {
        "description": "Number of concurrent jobs remaining",
        "explode": false,
        "schema": {
          "type": "string"
        },
        "style": "simple"
      },
      "X-Weekly-Limit": {
        "description": "Number of jobs run this week",
        "explode": false,
        "schema": {
          "type": "string"
        },
        "style": "simple"
      },
      "X-Weekly-Limit-Remaining": {
        "description": "Number of jobs remaining this week",
        "explode": false,
        "schema": {
          "type": "string"
        },
        "style": "simple"
      }
    },
    "parameters": {
      "ResourceId": {
        "description": "Unique identifier for the job (resource ID returned from FactSet).",
        "explode": false,
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        },
        "style": "simple"
      }
    },
    "responses": {
      "429": {
        "description": "Limit Exceeded",
        "headers": {
          "X-FactSet-Api-RateLimit-Limit": {
            "description": "Number of allowed requests for the time window.",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          },
          "X-FactSet-Api-RateLimit-Limit-Remaining": {
            "description": "Number of requests left for the time window.",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          },
          "X-FactSet-Api-RateLimit-Limit-Reset": {
            "description": "Number of seconds remaining till rate limit resets.",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        }
      }
    },
    "schemas": {
      "SpreadsheetFile": {
        "description": "An Open Office XML spreadsheet file.",
        "format": "binary",
        "type": "string"
      },
      "ErrorCode": {
        "description": "Factset API specific error codes",
        "enum": [
          "notAuthenticated",
          "notAuthorized",
          "notFound",
          "parameterError",
          "requestBodyInvalid",
          "endpointNotFound",
          "genericServerError",
          "quantityLimitsExceeded"
        ],
        "type": "string"
      },
      "Error": {
        "description": "The response returned for an unsuccessful request.",
        "example": {
          "id": "id",
          "title": "title"
        },
        "properties": {
          "id": {
            "description": "A unique ID for the occurrence of the error. It is advised to log this code and include it if you contact FactSet support desk.",
            "type": "string"
          },
          "code": {
            "$ref": "#/components/schemas/ErrorCode"
          },
          "title": {
            "description": "a description of the error",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Errors": {
        "description": "A list of errors",
        "properties": {
          "errors": {
            "items": {
              "$ref": "#/components/schemas/Error"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "JobStatus": {
        "description": "Status information about a job",
        "example": {
          "data": {
            "id": "id",
            "error": {
              "id": "id",
              "title": "title"
            },
            "status": "queued"
          }
        },
        "properties": {
          "data": {
            "$ref": "#/components/schemas/JobStatus_data"
          }
        },
        "type": "object"
      },
      "ActiveJobStatus": {
        "description": "Status information about an active job",
        "example": {
          "id": "id",
          "error": {
            "id": "id",
            "title": "title"
          },
          "status": "queued"
        },
        "properties": {
          "id": {
            "description": "Unique identifier for the job (resource ID returned from FactSet).",
            "type": "string"
          },
          "status": {
            "description": "The status of the job",
            "enum": [
              "queued",
              "executing"
            ],
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        },
        "type": "object"
      },
      "ActiveJobStatusList": {
        "description": "List of active job status information",
        "example": {
          "data": [
            {
              "id": "id",
              "error": {
                "id": "id",
                "title": "title"
              },
              "status": "queued"
            },
            {
              "id": "id",
              "error": {
                "id": "id",
                "title": "title"
              },
              "status": "queued"
            }
          ]
        },
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ActiveJobStatus"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "JobStatus_data": {
        "example": {
          "id": "id",
          "error": {
            "id": "id",
            "title": "title"
          },
          "status": "queued"
        },
        "properties": {
          "id": {
            "description": "Unique identifier for the job (resource ID returned from FactSet).",
            "type": "string"
          },
          "status": {
            "description": "The status of the job",
            "enum": [
              "queued",
              "executing",
              "created",
              "failed",
              "cancelled"
            ],
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "FactSetOAuth2": {
        "flows": {
          "clientCredentials": {
            "scopes": {},
            "tokenUrl": "https://auth.factset.com/as/token.oauth2"
          }
        },
        "type": "oauth2"
      },
      "FactSetApiKey": {
        "scheme": "basic",
        "type": "http"
      }
    }
  }
}