{
  "openapi": "3.0.1",
  "info": {
    "title": "Medrio BulkUploadApi v.42.14.0.102",
    "description": "Medrio BulkUploadApi v.42.14.0.102",
    "contact": {
      "name": "Medrio Inc.",
      "email": ""
    },
    "version": "v1"
  },
  "paths": {
    "/api/v1/study/{studyId}/job/bulkupload/uploadFile": {
      "post": {
        "tags": [
          "BulkUpload"
        ],
        "summary": "Upload study data stored in file",
        "operationId": "PostUploadFile",
        "parameters": [
          {
            "name": "studyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "DataFile",
                  "OverwriteBehavior",
                  "ReasonForChange"
                ],
                "type": "object",
                "properties": {
                  "MapId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "OverwriteBehavior": {
                    "$ref": "#/components/schemas/OverwriteBehavior"
                  },
                  "DataFile": {
                    "type": "string",
                    "format": "binary"
                  },
                  "ReasonForChange": {
                    "type": "string"
                  },
                  "ProgressNotificationEmail": {
                    "type": "string",
                    "nullable": true
                  },
                  "ProgressUpdateOptions": {
                    "$ref": "#/components/schemas/ProgressUpdateOptions"
                  }
                }
              },
              "encoding": {
                "MapId": {
                  "style": "form"
                },
                "OverwriteBehavior": {
                  "style": "form"
                },
                "DataFile": {
                  "style": "form"
                },
                "ReasonForChange": {
                  "style": "form"
                },
                "ProgressNotificationEmail": {
                  "style": "form"
                },
                "ProgressUpdateOptions": {
                  "style": "form"
                }
              }
            },
            "application/xml": {
              "schema": {
                "required": [
                  "DataFile",
                  "OverwriteBehavior",
                  "ReasonForChange"
                ],
                "type": "object",
                "properties": {
                  "MapId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "OverwriteBehavior": {
                    "$ref": "#/components/schemas/OverwriteBehavior"
                  },
                  "DataFile": {
                    "type": "string",
                    "format": "binary"
                  },
                  "ReasonForChange": {
                    "type": "string"
                  },
                  "ProgressNotificationEmail": {
                    "type": "string",
                    "nullable": true
                  },
                  "ProgressUpdateOptions": {
                    "$ref": "#/components/schemas/ProgressUpdateOptions"
                  }
                }
              },
              "encoding": {
                "MapId": {
                  "style": "form"
                },
                "OverwriteBehavior": {
                  "style": "form"
                },
                "DataFile": {
                  "style": "form"
                },
                "ReasonForChange": {
                  "style": "form"
                },
                "ProgressNotificationEmail": {
                  "style": "form"
                },
                "ProgressUpdateOptions": {
                  "style": "form"
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "required": [
                  "DataFile",
                  "OverwriteBehavior",
                  "ReasonForChange"
                ],
                "type": "object",
                "properties": {
                  "MapId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "OverwriteBehavior": {
                    "$ref": "#/components/schemas/OverwriteBehavior"
                  },
                  "DataFile": {
                    "type": "string",
                    "format": "binary"
                  },
                  "ReasonForChange": {
                    "type": "string"
                  },
                  "ProgressNotificationEmail": {
                    "type": "string",
                    "nullable": true
                  },
                  "ProgressUpdateOptions": {
                    "$ref": "#/components/schemas/ProgressUpdateOptions"
                  }
                }
              },
              "encoding": {
                "MapId": {
                  "style": "form"
                },
                "OverwriteBehavior": {
                  "style": "form"
                },
                "DataFile": {
                  "style": "form"
                },
                "ReasonForChange": {
                  "style": "form"
                },
                "ProgressNotificationEmail": {
                  "style": "form"
                },
                "ProgressUpdateOptions": {
                  "style": "form"
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "required": [
                  "DataFile",
                  "OverwriteBehavior",
                  "ReasonForChange"
                ],
                "type": "object",
                "properties": {
                  "MapId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "OverwriteBehavior": {
                    "$ref": "#/components/schemas/OverwriteBehavior"
                  },
                  "DataFile": {
                    "type": "string",
                    "format": "binary"
                  },
                  "ReasonForChange": {
                    "type": "string"
                  },
                  "ProgressNotificationEmail": {
                    "type": "string",
                    "nullable": true
                  },
                  "ProgressUpdateOptions": {
                    "$ref": "#/components/schemas/ProgressUpdateOptions"
                  }
                }
              },
              "encoding": {
                "MapId": {
                  "style": "form"
                },
                "OverwriteBehavior": {
                  "style": "form"
                },
                "DataFile": {
                  "style": "form"
                },
                "ReasonForChange": {
                  "style": "form"
                },
                "ProgressNotificationEmail": {
                  "style": "form"
                },
                "ProgressUpdateOptions": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success"
          }
        }
      },
      "get": {
        "tags": [
          "BulkUpload"
        ],
        "summary": "Get bulk upload job details",
        "operationId": "GetBulkUploadJobsDetails",
        "parameters": [
          {
            "name": "studyId",
            "in": "path",
            "description": "Study identifier",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Study identifier",
              "format": "uuid"
            }
          },
          {
            "name": "jobIds",
            "in": "query",
            "description": "comma separate list of bulk upload job Ids",
            "schema": {
              "type": "string",
              "description": "comma separate list of bulk upload job Ids",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUploadJobDetailsInfoResponseIEnumerableEventResultWithResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUploadJobDetailsInfoResponseIEnumerableEventResultWithResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/study/{studyId}/job/bulkupload/map": {
      "get": {
        "tags": [
          "BulkUpload"
        ],
        "summary": "Get bulk upload mappings associated with study.",
        "operationId": "GetMaps",
        "parameters": [
          {
            "name": "studyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUploadMapResponseIEnumerableEventResultWithResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUploadMapResponseIEnumerableEventResultWithResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/study/{studyId}/job": {
      "get": {
        "tags": [
          "Job"
        ],
        "summary": "Get information for jobs associated with study.",
        "operationId": "GetJobsById",
        "parameters": [
          {
            "name": "studyId",
            "in": "path",
            "description": "Study identifier",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Study identifier",
              "format": "uuid"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "comma separate list of job Ids (optional query parameter to filter results)",
            "schema": {
              "type": "string",
              "description": "comma separate list of job Ids (optional query parameter to filter results)",
              "nullable": true
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "page number of dataset>",
            "schema": {
              "type": "integer",
              "description": "page number of dataset>",
              "format": "int32",
              "nullable": true
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "page size i.e. total number of jobs",
            "schema": {
              "type": "integer",
              "description": "page size i.e. total number of jobs",
              "format": "int32",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobInfoResponseEventResultWithResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/JobInfoResponseEventResultWithResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Oauth/token": {
      "post": {
        "tags": [
          "Oauth"
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "UserName": {
                    "type": "string",
                    "format": "string",
                    "nullable": true
                  },
                  "Password": {
                    "type": "string",
                    "format": "password",
                    "nullable": true
                  },
                  "GrantType": {
                    "type": "string",
                    "format": "string",
                    "nullable": true
                  },
                  "RefreshToken": {
                    "type": "string",
                    "format": "string",
                    "nullable": true
                  },
                  "CustomerApiKey": {
                    "type": "string",
                    "format": "string",
                    "nullable": true
                  }
                }
              },
              "encoding": {
                "UserName": {
                  "style": "form"
                },
                "Password": {
                  "style": "form"
                },
                "GrantType": {
                  "style": "form"
                },
                "RefreshToken": {
                  "style": "form"
                },
                "CustomerApiKey": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorResponseModel"
                }
              }
            }
          },
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthResponseModel"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "OverwriteBehavior": {
        "enum": [
          1,
          2,
          3
        ],
        "type": "integer",
        "format": "int32"
      },
      "ProgressUpdateOptions": {
        "enum": [
          1,
          2,
          3,
          4
        ],
        "type": "integer",
        "format": "int32"
      },
      "ValidationErrorResult": {
        "type": "object",
        "properties": {
          "rowId": {
            "type": "integer",
            "format": "int32"
          },
          "columnId": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BulkUploadJobDetailsInfoResponse": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "uploadTime": {
            "type": "string",
            "format": "date-time"
          },
          "userName": {
            "type": "string",
            "nullable": true
          },
          "mapName": {
            "type": "string",
            "nullable": true
          },
          "subjectSuccessCount": {
            "type": "integer",
            "format": "int32"
          },
          "subjectsAllCount": {
            "type": "integer",
            "format": "int32"
          },
          "errorCount": {
            "type": "integer",
            "format": "int32"
          },
          "isArchived": {
            "type": "boolean"
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "bulkUploadErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationErrorResult"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BulkUploadJobDetailsInfoResponseIEnumerableEventResultWithResponse": {
        "type": "object",
        "properties": {
          "processedSuccessfully": {
            "type": "boolean"
          },
          "processMessage": {
            "type": "string",
            "nullable": true
          },
          "response": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkUploadJobDetailsInfoResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BulkUploadMapResponse": {
        "type": "object",
        "properties": {
          "bulkUploadMapId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "fileType": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "formId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "formName": {
            "type": "string",
            "nullable": true
          },
          "hasFixedValues": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "BulkUploadMapResponseIEnumerableEventResultWithResponse": {
        "type": "object",
        "properties": {
          "processedSuccessfully": {
            "type": "boolean"
          },
          "processMessage": {
            "type": "string",
            "nullable": true
          },
          "response": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkUploadMapResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "JobInfo": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "alternateJobId": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "statusName": {
            "type": "string",
            "nullable": true
          },
          "jobType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "JobInfoResponse": {
        "type": "object",
        "properties": {
          "jobInfos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobInfo"
            },
            "nullable": true
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "JobInfoResponseEventResultWithResponse": {
        "type": "object",
        "properties": {
          "processedSuccessfully": {
            "type": "boolean"
          },
          "processMessage": {
            "type": "string",
            "nullable": true
          },
          "response": {
            "$ref": "#/components/schemas/JobInfoResponse"
          }
        },
        "additionalProperties": false
      },
      "OAuthErrorResponseModel": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "nullable": true
          },
          "traceId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "OAuthResponseModel": {
        "required": [
          "accessToken",
          "expiresIn",
          "tokenType",
          "userId",
          "userName"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "expiresIn": {
            "type": "integer",
            "format": "int32"
          },
          "tokenType": {
            "type": "string"
          },
          "refreshToken": {
            "type": "string",
            "nullable": true
          },
          "userName": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "isTFAEnabled": {
            "type": "boolean"
          },
          "expiresUtc": {
            "type": "string",
            "format": "date-time"
          },
          "issuedUtc": {
            "type": "string",
            "format": "date-time"
          },
          "internalServiceName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "OAuthRequestModel": {
        "type": "object",
        "properties": {
          "userName": {
            "type": "string",
            "format": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "format": "password",
            "nullable": true
          },
          "grantType": {
            "type": "string",
            "format": "string",
            "nullable": true
          },
          "refreshToken": {
            "type": "string",
            "format": "string",
            "nullable": true
          },
          "customerApiKey": {
            "type": "string",
            "format": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "description": "Bearer Authorization header using the Bearer scheme. </br>\r\n                                    Enter 'Bearer' [space] and then your token in the text input below </br>\r\n                                    Example: 'Bearer 72209b783224d467e608867241a89cf6'",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}