external_api_data
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| external_api_data [2023/01/26 10:53] – angelos | external_api_data [2023/11/21 16:12] (current) – chris | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Oftentimes you have external data coming from a REST HTTP API and want access to it through the Pathomation software platform for digital pathology and virtual microscopy. Importing the data as Pathomation form data may not always make sense for a variety of reasons. | Oftentimes you have external data coming from a REST HTTP API and want access to it through the Pathomation software platform for digital pathology and virtual microscopy. Importing the data as Pathomation form data may not always make sense for a variety of reasons. | ||
| - | PMA.core allows you to link external rest APIs and use them as regular form data. This works by invoking a user defined command line application, that must exist in the system that hosts PMA.core. Such applications can be: | + | PMA.core allows you to link external rest APIs and use them as regular form data. This works by invoking a user-defined command line application |
| * curl | * curl | ||
| * python | * python | ||
| Line 22: | Line 22: | ||
| * Fields: Field names to expect in the JSON output, once the command is executed | * Fields: Field names to expect in the JSON output, once the command is executed | ||
| - | {{ :: | + | {{:add-external-api-data-connection.png?direct&600|}} |
| - | ==== Configure queries ==== | + | === Arguments |
| - | After creating | + | In the arguments field you can specify any number of command line arguments that are required for the correct execution of the command. For example, if you want to run a python script, |
| - | === SQL query === | + | Additionally, |
| - | {{ :: | + | - [path]: Gets replaced with the path of the image for which the external |
| - | Even though | + | |
| - | | + | |
| - | | + | |
| - | * Display name: A name for this query, just to distinguish between this and other queries | + | |
| - | * Fields to include: This is a list of all fields in the table. It is **automatically** populated after selecting the //Table Name// | + | |
| - | | + | |
| - | * Regular expression: This is an // | + | |
| - | | + | |
| - | | + | |
| - | As stated an above the **# | + | For example, |
| - | Before your query is ready you need to test that it works as expected | + | * Command: curl |
| + | * Arguments: -G -X GET --header " | ||
| + | |||
| + | === Fields === | ||
| + | |||
| + | PMA.core can read top level field values from a JSON response. You can specify a list of fields | ||
| === Testing === | === Testing === | ||
| - | To test your query for errors and validating its results you can use the Test query field. | + | You can test the result of the command |
| - | {{ :test_query.jpg?400 |}} | + | |
| + | {{:external-api-data-raw-command.png?direct&400|}} | ||
| - | Clicking on the Execute button will execute the query on the server. Any errors in syntax will be reported immediately bellow the execute button. If no errors occur a popup will appear that will show the results of the query. | ||
| - | {{ :: | ||
| ==== Consumption and applications ==== | ==== Consumption and applications ==== | ||
| - | After creating the queries | + | After creating the connection |
| - | This is the same API that is used to provide external data in downstream | + | This is the same API that is used to provide external data in downstream |
| {{ :: | {{ :: | ||
| - | |||
| - | ==== More background ==== | ||
| - | |||
| - | See [[https:// | ||
external_api_data.1674726803.txt.gz · Last modified: by angelos
