api
api [get|post|put|patch|delete|head] [url] --data '{ "key": "value" }' --headers '{ "Authorization": "Bearer <token>"}'
Constructs and sends an http request.
arguments:β
method
β
The HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD). (type: string
)
url
β
The url for the request. (type: string
)
examples:β
Queryβ
api get http://api.crul.com/examples
Queryβ
api post http://api.crul.com/examples --data '{"bobby": "billy"}'
Queryβ
api put http://api.crul.com/examples --data '{"bobby": "billy"}'
Queryβ
api patch http://api.crul.com/examples/1 --data '{"bobby": "billy"}'
Queryβ
api delete http://api.crul.com/examples/1
flags:β
--appendStage
β
Used to append the results from a previous stage to the current stage. (provide a label, stage index, or boolean true to append the previous results)
--bearer
β
Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The name βBearer authenticationβ can be understood as βgive access to the bearer of this token.β The bearer token is a cryptic string, usually generated by the server in response to a login request.
--cache
β
A boolean value of true/false that determines whether or not to use the cache. Generally most commands will default to true.
--checkpoint
β
Format: "{CHECKPOINT NAME}:{COLUMN}" Used to store the value of the provided column (in the first row of results) in the provided name for use as a checkpoint in scheduled queries or other stages. Not encrypted. Can be accessed using $CHECKPOINTS.{CHECKPOINT NAME}$
--credentials.aws4
β
Provider reference stored in vault. Contains the provider and auth related information. Signs the HTTP request following the AWS Signature Version 4 specification.
--credentials.oauth
β
Provider reference stored in vault. Contains the provider and auth related information.
--credentials.recordedfuture
β
Provider reference stored in vault. Contains the provider and auth related information. Sets the HTTP request header X-RFToken following the Recorded Future authentication specification.
--data
β
Data to send in the body of the request.
--data.encoding
β
Data encoding format. JSON (default) or raw for direct pass-thru.
--enrich
β
Enriches each result row with the previous row. The previous columns will be appended with a _previous.
--filter
β
A filter to run on the command results before completing the command. If not provided, no filter is run on the results.
--fresh
β
Starts the stage as if it was a fresh query, so will not use any previous result.
--guid
β
Adds a populated random guid column.
--headers
β
Headers to send in the request based --headers.format.
--headers.format
β
Header format. JSON (default) or RFC2068.
--labelStage
β
Used to label a stage with a user provided label.
--maxConcurrent
β
Override for the system max concurrent workers for a stage.
--pagination.argIndex
β
The index of the argument to store the pagination context.
--pagination.argKey
β
The key to store the pagination context in the argument (assumes key value is JSON).
--pagination.done
β
The value of pagination.next thats indicates that pagination is complete.
--pagination.filter
β
Filter the results using a filter expression.
--pagination.flag
β
The flag to store the pagination context.
--pagination.flagKey
β
The key to store the pagination context in the flag (assumes key value is JSON).
--pagination.max
β
Maximum number of pages visited.
--pagination.next
β
The location within the results set describing the location of the next set of results. If not a complete URL, use the --pagination.url to construct the url using a token
--pagination.next.encode
β
Specify one of ["raw" (default)|"urlencode"] to apply specified encoding to pagination.next token.
--pagination.url
β
The url of the next set of results, which can include a token to substitute in the value selected by --pagination.next. If blank, the url is assumed to be contained in the value described by --pagination.next
--params
β
Parameters to send in the query string for the request.
--proxy
β
The URI for a http, https, socks(v5), socks5, socks4, or pac proxy.
--randomizeHash
β
Randomizes the stage hash, even if args and flags are the same.
--redirect
β
Set to manual
to extract redirect headers, error
to reject redirect or follow
.
--request
β
Include request metadata including headers, method, etc...
--response
β
Include response metadata including headers, method, etc...
--serializer
β
The serializer to use on response data. 'auto' (default) - Automatically serialize based on the response content-type.
serializer | content-type/mappping | description |
---|---|---|
json | application/json | JSON parse the response text and serialize the response content as a JSON string. |
xml | application/xml | XML parse the response text and serialize to JSON format. |
csv | text/csv | CSV parse the response text and serialize to JSON format. |
yaml | application/x-yaml | YAML parse the response text and serialize to JSON format. |
text/vnd.yaml | ||
text/yaml | ||
text/x-yaml | ||
text | text/plain | Serialize the response content as a utf8 string assigned to a content attribiute (e.g., { content: <String> }). |
zip | application/zip | List the files/entries inside the zip archive. See the unzip.path flag to read/serialize file contents. |
octetstream | application/octet-stream | A binary file. Serialization is derived from the file extension. |
none | n/a | Skip reading the body stream and skip serialization. This is a fast path for request and response metadata processing. |
--stats
β
Controls if a stats calculation is run on a stage after it completes.
--table
β
A comma separated list of columns to include in the command results. If not provided, all columns will be included.
--token.access_token
β
Sets the bearer authentication header (see --bearer) and propogates the token.access_token value to results.
--type
β
Each command has a default type, either "mapping" or "reducing". Some commands can operate as either, when "reducing" they will operate on all rows at once, when "mapping", they will operate on one row at a time.
--unzip.path
β
Unzip the matching file/entry path and serialize automatically (based on the inferred content-type).
--user
β
Specify the user name and password to use for server authentication split up on the first colon.
--useragent
β
The User-Agent request header is a characteristic string that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent. <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent>
--variable
β
Format: "{VARIABLE NAME}:{COLUMN}" Used to store the value of the provided column (in the first row of results) in the provided name for use as a variable in other stages. Can be accessed using $VARIABLES.{VARIABLE NAME}$. Stored as an encrypted secret. Not stored across queries.
--verifySSL
β
Will skip SSL cert verification if set to false.
--while
β
Will rerun the stage until the provided expression is valid for the first line of results.
supportβ
AMI_ENTERPRISE
AMI_FREE
AMI_PRO
BINARY_ENTERPRISE
BINARY_FREE
BINARY_PRO
DESKTOP_ENTERPRISE
DESKTOP_FREE
DESKTOP_PRO
DOCKER_ENTERPRISE
DOCKER_FREE
DOCKER_PRO