View source: R/flywire-fetch.R
flywire_fetch | R Documentation |
GET/POST from flywire (graphene) servers with appropriate authorisation token
flywire_fetch(
url,
body = NULL,
config = NULL,
token = NULL,
return = c("parsed", "text", "response"),
cache = FALSE,
retry = 0L,
include_headers = FALSE,
simplifyVector = TRUE,
...
)
url |
Full URL for brainmaps API endpoint |
body |
an R list with parameters that will be converted with
|
config |
(optional) curl options, see |
token |
Optional chunkedgraph token (otherwise the default one for the
current segmentation will be used). Use |
return |
One of "parsed", "text" (for raw JSON), or "response" |
cache |
Whether or not to cache responses (default |
retry |
The number of times to retry the operation (default 0,
|
include_headers |
Whether to include basic headers from the http request
as attributes on the parsed JSON object (default |
simplifyVector |
Whether to use |
... |
additional arguments passed to the |
Either an R object based on parsing returned JSON, a character vector
containing the raw JSON or a httr::response
object,
depending on the value of return
.
Your authorisation will be based on a chunked graph
token normally stored at
~/.cloudvolume/secrets/cave-secret.json
. See
https://github.com/seung-lab/cloud-volume#cave-secretjson for
the format. You will need to generate the token as advised by the FlyWire
team. Search or ask for help #help_software
in the FlyWire slack if
you can't find the information. For more details see article on
accessing-graphene-server.
# convert a flywire state URL into a parsed neuroglancer scene information
# but see also flywire_expandurl
json=flywire_fetch("https://globalv1.flywire-daf.com/nglstate/5747205470158848",
return="text")
ngl_segments(ngl_decode_scene(json), as_character = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.