{
  "swagger": "2.0",
  "info": {
    "version": "V1",
    "title": "Scale-up Data Service Api Reference",
    "description": "API definition for the creation of web services to be consumed by Scale-up Suite (Reaction Lab and Catalist)<br/>This reference implementation uses an example service returning time zone information, but Data Services can return any data<p>Use apikey <code>test-key-1</code> to get results. Use other keys or none to test api key validation</p>",
    "x-swagger-net-version": "8.4.14.001"
  },
  "host": "apidocs.scale-up.com",
  "schemes": [
    "https"
  ],
  "paths": {
    "/v1/search": {
      "post": {
        "tags": [
          "DataService"
        ],
        "summary": "Search for items by text input",
        "operationId": "DataService_Search",
        "consumes": [
          "application/json",
          "text/json"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "parameters",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SearchParameters"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/SearchResult"
            }
          }
        },
        "security": [
          {
            "API_KEY": []
          }
        ]
      }
    },
    "/v1/fetch": {
      "post": {
        "tags": [
          "DataService"
        ],
        "summary": "Get items by ID",
        "operationId": "DataService_Fetch",
        "consumes": [
          "application/json",
          "text/json"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "parameters",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/FetchParameters"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/FetchResult"
            }
          }
        },
        "security": [
          {
            "API_KEY": []
          }
        ]
      }
    }
  },
  "definitions": {
    "SearchParameters": {
      "required": [
        "searchString",
        "userName",
        "buildNumber",
        "applicationId",
        "clientId",
        "serviceIdentifier",
        "serviceVersionNumber"
      ],
      "properties": {
        "searchString": {
          "description": "Text to be searched",
          "example": "Dublin",
          "type": "string"
        },
        "userName": {
          "description": "The user name/email address of the Scale-up Account of the user making the request",
          "example": "user@example.com",
          "type": "string"
        },
        "buildNumber": {
          "description": "Build Number of the Scale-up Suite or Numero client making the request",
          "example": "1.3.1b345",
          "type": "string"
        },
        "applicationId": {
          "description": "Executable name of the application from which the request is made (ReactionLab | EXCEL | WINWORD | POWERPOINT | OUTLOOK)",
          "example": "Excel",
          "type": "string"
        },
        "clientId": {
          "description": "Client context from which the request is made (Materials Search | Catalist)",
          "example": "Catalist",
          "type": "string"
        },
        "serviceIdentifier": {
          "description": "The service identifier as defined in the Scale-up Data Service listing. Can be used to make servcie distinctions in case the same endpoint is used for several data sets.",
          "example": "Example-Data-Service-123456",
          "type": "string"
        },
        "serviceVersionNumber": {
          "description": "The version number as defined in the Scale-up Data Service listing.",
          "example": "1.0",
          "type": "number",
          "format": "double"
        },
        "dataServiceId": {
          "type": "integer",
          "format": "int32"
        },
        "dataServiceIdentifier": {
          "type": "string"
        }
      },
      "xml": {
        "name": "SearchParameters"
      },
      "type": "object"
    },
    "SearchResult": {
      "required": [
        "results"
      ],
      "properties": {
        "results": {
          "description": "List of search results",
          "items": {
            "$ref": "#/definitions/SearchHeaderInfo"
          },
          "xml": {
            "name": "SearchHeaderInfo",
            "wrapped": true
          },
          "type": "array"
        },
        "headerName1": {
          "description": "Column 1 header name for search result (CAS Number for Materials services, can be null or empty)",
          "type": "string"
        },
        "headerName2": {
          "description": "Column 2 header name for search result (Name for Materials services, can be null or empty)",
          "type": "string"
        },
        "headerName3": {
          "description": "Column 3 header name  for search result (Formula for Materials services, can be null or empty)",
          "type": "string"
        },
        "headerName4": {
          "description": "Column 4 header name  for search result (Long Name for Materials services, can be null or empty)",
          "type": "string"
        },
        "errorMessage": {
          "description": "Error information, result will be treated as error if not null or empty",
          "type": "string"
        }
      },
      "xml": {
        "name": "SearchResult"
      },
      "type": "object"
    },
    "SearchHeaderInfo": {
      "description": "For Data Services of type \"Materials\" the Value properties must contain CAS Number, Name, Formula and Long Name in that order",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "description": "Data Item Id, to be used for Fetch calls",
          "type": "string"
        },
        "structure": {
          "description": "Chemical structure to be displayed as thumb nail. Expected: base64 string, can be null or empty",
          "type": "string",
          "format": "byte"
        },
        "image": {
          "description": "Thumbnail image to be shown if no checmical structure is provided. Expected: base64 string, can be null or empty",
          "type": "string",
          "format": "byte"
        },
        "value1": {
          "description": "Column 1 value for search result (CAS Number for Materials services, can be null or empty)",
          "type": "string"
        },
        "value2": {
          "description": "Column 2 value for search result (Name for Materials services, can be null or empty)",
          "type": "string"
        },
        "value3": {
          "description": "Column 3 value for search result (Formula for Materials services, can be null or empty)",
          "type": "string"
        },
        "value4": {
          "description": "Column 4 value for search result (Long Name for Materials services, can be null or empty)",
          "type": "string"
        }
      },
      "xml": {
        "name": "SearchHeaderInfo"
      },
      "type": "object"
    },
    "FetchParameters": {
      "required": [
        "ids",
        "userName",
        "buildNumber",
        "applicationId",
        "clientId",
        "serviceIdentifier",
        "serviceVersionNumber"
      ],
      "properties": {
        "ids": {
          "description": "IDs ofthe items to be retrieved",
          "items": {
            "type": "string"
          },
          "example": [
            "GMT Standard Time",
            "Easter Island Standard Time"
          ],
          "type": "array"
        },
        "userName": {
          "description": "The user name/email address of the Scale-up Account of the user making the request",
          "example": "user@example.com",
          "type": "string"
        },
        "buildNumber": {
          "description": "Build Number of the Scale-up Suite or Numero client making the request",
          "example": "1.3.1b345",
          "type": "string"
        },
        "applicationId": {
          "description": "Executable name of the application from which the request is made (ReactionLab | EXCEL | WINWORD | POWERPOINT | OUTLOOK)",
          "example": "Excel",
          "type": "string"
        },
        "clientId": {
          "description": "Client context from which the request is made (Materials Search | Catalist)",
          "example": "Catalist",
          "type": "string"
        },
        "serviceIdentifier": {
          "description": "The service identifier as defined in the Scale-up Data Service listing. Can be used to make servcie distinctions in case the same endpoint is used for several data sets.",
          "example": "Example-Data-Service-123456",
          "type": "string"
        },
        "serviceVersionNumber": {
          "description": "The version number as defined in the Scale-up Data Service listing.",
          "example": "1.0",
          "type": "number",
          "format": "double"
        },
        "dataServiceId": {
          "type": "integer",
          "format": "int32"
        },
        "dataServiceIdentifier": {
          "type": "string"
        }
      },
      "xml": {
        "name": "FetchParameters"
      },
      "type": "object"
    },
    "FetchResult": {
      "required": [
        "items"
      ],
      "properties": {
        "items": {
          "description": "List of  items",
          "items": {
            "$ref": "#/definitions/ItemInfo"
          },
          "xml": {
            "name": "ItemInfo",
            "wrapped": true
          },
          "type": "array"
        },
        "errorMessage": {
          "description": "Error information, result will be treated as error if not null or empty",
          "type": "string"
        }
      },
      "xml": {
        "name": "FetchResult"
      },
      "type": "object"
    },
    "ItemInfo": {
      "required": [
        "id",
        "properties"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "properties": {
          "description": "List of property names and values",
          "items": {
            "$ref": "#/definitions/ItemProperty"
          },
          "xml": {
            "name": "ItemProperty",
            "wrapped": true
          },
          "type": "array"
        }
      },
      "xml": {
        "name": "ItemInfo"
      },
      "type": "object"
    },
    "ItemProperty": {
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "description": "Property name",
          "type": "string"
        },
        "value": {
          "description": "Property value. Data type can be\r\n- numeric\r\n- bool\r\n- string\r\n- date-time string (internet format, a .NET fromatting string can be sepcified in \"Usage\") \r\n- base64 string representing a bitmap image as byte array (specify \"Image\" in the Usage property)\r\n- base64 string representing a chemcial structure file as byte array (specify \"Structure\" in the Usage property, supported formats: .cdxml, .cdx, .mol, .sdf, .rxn)\r\n- array",
          "type": "object"
        },
        "unit": {
          "description": "Unit of measure to be displayed, can be null or empty",
          "type": "string"
        },
        "usage": {
          "description": "Possible values (case sensitive):\r\n- null - The Value property will be treated as a simple value\r\n- \"Image\" - use for base64 strings that should be treated as general bitmap image\r\n- \"Structure\" - use for base64 strings that should be treated as chemical structure bitmap image\r\n- .NET date-time format - for date-time strings (e.g. (\"d\" for shortdate, \"D\" for long date etc.)",
          "type": "string"
        }
      },
      "xml": {
        "name": "ItemProperty"
      },
      "type": "object"
    }
  },
  "securityDefinitions": {
    "API_KEY": {
      "type": "apiKey",
      "description": "API Key Authentication",
      "name": "API_KEY",
      "in": "header"
    }
  },
  "tags": [
    {
      "name": "DataService"
    }
  ]
}