The Reach API (Application Programming Interface) server provides a built-in, lightweight REST-ful interface to a locally-running Reach system. API services accept HTTP requests to run Reach on the supplied text or NXML inputs and return Reach results in one of several JSON or CSV formats.
| Endpoint | Request Type | Request Arguments | Description |
|---|---|---|---|
| / | GET | Return this API help page. | |
| /version | GET | POST | Return the current version of this application. | |
| /api/text | GET | POST | text=a+string | Run Reach on the given text string and return the results. |
|
The
text argument must be URL-encoded.
By default, results are returned in FRIES JSON format.
The optional form argument
output selects an output format:
indexcard, serial-json, or fries (the default).
curl 'http://localhost:8080/api/text?text=Akt1+phosphorylates+mek1'
curl 'http://localhost:8080/api/text?text=Akt1%20phosphorylates%20mek1'
curl 'http://localhost:8080/api/text?text=Akt1+phosphorylates+mek1&output=serial-json'
curl 'http://localhost:8080/api/text?text=Akt1%20phosphorylates%20mek1&output=fries'
|
|||
| /api/textBody | POST | Run Reach on the text string contained in the POST body and return the results. | |
|
The body argument
text must be URL-encoded.
By default, results are returned in FRIES JSON format.
The optional body argument
output selects an output format:
indexcard, serial-json, or fries (the default).
curl -XPOST -d 'text=Akt1+phosphorylates+mek1' 'http://localhost:8080/api/textBody'
curl -XPOST -d 'text=Akt1%20phosphorylates%20mek1' 'http://localhost:8080/api/textBody'
curl -XPOST -d 'text=akt1+phosphorylates+mek1&output=fries' 'http://localhost:8080/api/textBody'
curl -XPOST -d 'text=akt1+phosphorylates+mek1' -d 'output=fries' 'http://localhost:8080/api/textBody'
curl -XPOST -d 'output=fries' --data 'text=The+inhibition+of+AICAR+suppresses+the+phosphorylation+of+TBC1D1.' 'http://localhost:8080/api/textBody'
curl -XPOST -d 'output=fries' --data-urlencode 'text=The inhibition of AICAR suppresses the phosphorylation of TBC1D1.' 'http://localhost:8080/api/textBody'
curl -XPOST --data-urlencode 'text=TopBP1 promotes the phosphorylation of cyclin-D1 by ATR.' 'http://localhost:8080/api/textBody'
|
|||
| /api/uploadFile | POST | Upload a plain text file or NXML file, process the text with Reach, and return the results in the specified format. | |
|
Accepts a
multipart/form-data
argument which contains the plain text or NXML text to be processed
within the file part.
By default, results are returned in FRIES JSON format.
The optional query argument
output selects an output format:
indexcard, serial-json, or fries (the default).
curl -XPOST -F 'file=@infile.txt' 'http://localhost:8080/api/uploadFile'
curl -XPOST -F 'file=@myFile -F 'output=fries' 'http://localhost:8080/api/uploadFile'
curl -XPOST -F 'file=@some.text' -F 'output=fries' 'http://localhost:8080/api/uploadFile'
curl -XPOST -F 'file=@PMC1240239.nxml' 'http://localhost:8080/api/uploadFile'
curl -XPOST -F 'file=@myFile.xml -F 'output=serial-json' 'http://localhost:8080/api/uploadFile'
curl -XPOST -F 'file=@some.nxml -F 'output=fries' 'http://localhost:8080/api/uploadFile'
curl -XPOST -F 'file=@PMCfake.nxml -F 'output=fries' 'http://localhost:8080/api/uploadFile'
|
|||
| /shutdown | POST | Any POST to this endpoint will shutdown the server. | |