a b/docs/api-reference/openapi.json
1
{
2
  "openapi": "3.1.0",
3
  "info": {
4
    "title": "AItrika API",
5
    "description": "AItrika API",
6
    "version": "0.1.0"
7
  },
8
  "paths": {
9
    "/associations": {
10
      "post": {
11
        "summary": "Get associations from a PubMed article",
12
        "description": "Extracts associations from a PubMed article based on its ID.\n\nArgs:\n    request (PubMedRequest): An object containing the PubMed ID.\n\nReturns:\n    dict: A dictionary containing the extracted associations.\n\nRaises:\n    HTTPException: If the PubMed ID is invalid or the article is not found.",
13
        "operationId": "get_associations_associations_post",
14
        "requestBody": {
15
          "content": {
16
            "application/json": {
17
              "schema": {
18
                "$ref": "#/components/schemas/PubMedRequest"
19
              }
20
            }
21
          },
22
          "required": true
23
        },
24
        "responses": {
25
          "200": {
26
            "description": "Associations retrieved successfully",
27
            "content": {
28
              "application/json": {
29
                "schema": {}
30
              }
31
            }
32
          },
33
          "422": {
34
            "description": "Invalid PubMed ID provided"
35
          }
36
        }
37
      }
38
    },
39
    "/abstract": {
40
      "post": {
41
        "summary": "Get abstract of a PubMed article",
42
        "description": "Retrieves the abstract of a PubMed article based on its ID.\n\nArgs:\n    request (PubMedRequest): An object containing the PubMed ID.\n\nReturns:\n    dict: A dictionary containing the abstract of the article.\n\nRaises:\n    HTTPException: If the PubMed ID is invalid or the article is not found.",
43
        "operationId": "get_abstract_abstract_post",
44
        "requestBody": {
45
          "content": {
46
            "application/json": {
47
              "schema": {
48
                "$ref": "#/components/schemas/PubMedRequest"
49
              }
50
            }
51
          },
52
          "required": true
53
        },
54
        "responses": {
55
          "200": {
56
            "description": "Abstract retrieved successfully",
57
            "content": {
58
              "application/json": {
59
                "schema": {}
60
              }
61
            }
62
          },
63
          "422": {
64
            "description": "Invalid PubMed ID provided"
65
          }
66
        }
67
      }
68
    },
69
    "/query": {
70
      "post": {
71
        "summary": "Query a PubMed article",
72
        "description": "Queries a PubMed article with a user-provided question.\n\nArgs:\n    request (QueryRequest): An object containing the PubMed ID and the query.\n\nReturns:\n    dict: A dictionary containing the result of the query.\n\nRaises:\n    HTTPException: If the PubMed ID is invalid, the article is not found, or the query fails.",
73
        "operationId": "query_document_query_post",
74
        "requestBody": {
75
          "content": {
76
            "application/json": {
77
              "schema": {
78
                "$ref": "#/components/schemas/QueryRequest"
79
              }
80
            }
81
          },
82
          "required": true
83
        },
84
        "responses": {
85
          "200": {
86
            "description": "Query result retrieved successfully",
87
            "content": {
88
              "application/json": {
89
                "schema": {}
90
              }
91
            }
92
          },
93
          "422": {
94
            "description": "Invalid PubMed ID or query provided"
95
          }
96
        }
97
      }
98
    },
99
    "/results": {
100
      "post": {
101
        "summary": "Get results from a PubMed article",
102
        "description": "Extracts results from a PubMed article based on its ID.\n\nArgs:\n    request (PubMedRequest): An object containing the PubMed ID.\n\nReturns:\n    dict: A dictionary containing the extracted results.\n\nRaises:\n    HTTPException: If the PubMed ID is invalid or the article is not found.",
103
        "operationId": "get_results_results_post",
104
        "requestBody": {
105
          "content": {
106
            "application/json": {
107
              "schema": {
108
                "$ref": "#/components/schemas/PubMedRequest"
109
              }
110
            }
111
          },
112
          "required": true
113
        },
114
        "responses": {
115
          "200": {
116
            "description": "Results retrieved successfully",
117
            "content": {
118
              "application/json": {
119
                "schema": {}
120
              }
121
            }
122
          },
123
          "422": {
124
            "description": "Invalid PubMed ID provided"
125
          }
126
        }
127
      }
128
    },
129
    "/participants": {
130
      "post": {
131
        "summary": "Get number of participants from a PubMed article",
132
        "description": "Extracts the number of participants from a PubMed article based on its ID.\n\nArgs:\n    request (PubMedRequest): An object containing the PubMed ID.\n\nReturns:\n    dict: A dictionary containing the number of participants.\n\nRaises:\n    HTTPException: If the PubMed ID is invalid or the article is not found.",
133
        "operationId": "get_number_of_participants_participants_post",
134
        "requestBody": {
135
          "content": {
136
            "application/json": {
137
              "schema": {
138
                "$ref": "#/components/schemas/PubMedRequest"
139
              }
140
            }
141
          },
142
          "required": true
143
        },
144
        "responses": {
145
          "200": {
146
            "description": "Number of participants retrieved successfully",
147
            "content": {
148
              "application/json": {
149
                "schema": {}
150
              }
151
            }
152
          },
153
          "422": {
154
            "description": "Invalid PubMed ID provided"
155
          }
156
        }
157
      }
158
    },
159
    "/outcomes": {
160
      "post": {
161
        "summary": "Get outcomes from a PubMed article",
162
        "description": "Extracts outcomes from a PubMed article based on its ID.\n\nArgs:\n    request (PubMedRequest): An object containing the PubMed ID.\n\nReturns:\n    dict: A dictionary containing the extracted outcomes.\n\nRaises:\n    HTTPException: If the PubMed ID is invalid or the article is not found.",
163
        "operationId": "get_outcomes_outcomes_post",
164
        "requestBody": {
165
          "content": {
166
            "application/json": {
167
              "schema": {
168
                "$ref": "#/components/schemas/PubMedRequest"
169
              }
170
            }
171
          },
172
          "required": true
173
        },
174
        "responses": {
175
          "200": {
176
            "description": "Outcomes retrieved successfully",
177
            "content": {
178
              "application/json": {
179
                "schema": {}
180
              }
181
            }
182
          },
183
          "422": {
184
            "description": "Invalid PubMed ID provided"
185
          }
186
        }
187
      }
188
    }
189
  },
190
  "components": {
191
    "schemas": {
192
      "PubMedRequest": {
193
        "properties": {
194
          "pubmed_id": {
195
            "type": "integer",
196
            "title": "Pubmed Id"
197
          }
198
        },
199
        "type": "object",
200
        "required": [
201
          "pubmed_id"
202
        ],
203
        "title": "PubMedRequest"
204
      },
205
      "QueryRequest": {
206
        "properties": {
207
          "pubmed_id": {
208
            "type": "integer",
209
            "title": "Pubmed Id"
210
          },
211
          "query": {
212
            "type": "string",
213
            "title": "Query"
214
          }
215
        },
216
        "type": "object",
217
        "required": [
218
          "pubmed_id",
219
          "query"
220
        ],
221
        "title": "QueryRequest"
222
      }
223
    }
224
  }
225
}