api {sevenbridges2} | R Documentation |
Core HTTP logic for Seven Bridges API
Description
Used for advanced users and the core method for higher level API in this package.
Usage
api(
token = NULL,
path = NULL,
method = c("GET", "POST", "PUT", "DELETE", "PATCH"),
query = NULL,
body = list(),
encode = c("json", "form", "multipart"),
limit = getOption("sevenbridges2")$limit,
offset = getOption("sevenbridges2")$offset,
advance_access = getOption("sevenbridges2")$advance_access,
authorization = FALSE,
fields = "_all",
base_url = NULL,
url = NULL,
...
)
Arguments
token |
API authentication token or |
path |
Path connected with |
method |
One of |
query |
Query parameters passed to httr package GET/POST call. |
body |
Body content passed to httr package GET/POST/PUT/DELETE/PATCH call. |
encode |
If the body is a named list, how should it be
encoded? Can be one of |
limit |
The maximum number of collection items to return
for a single request. Minimum value is |
offset |
The zero-based starting index in the entire collection
of the first item to return. The default value is |
advance_access |
Enable advance access features?
Default is |
authorization |
Is the |
fields |
Selector specifying a subset of fields to include in the
response. All API calls take this optional query parameter.
This parameter enables you to specify the fields you want to be returned
when listing resources (e.g. all your projects) or getting details of a
specific resource (e.g. a given project). |
base_url |
Platform URL, default is NULL. |
url |
Full url of the resource. If |
... |
Other arguments passed to GET/POST/PUT/DELETE/PATCH call. |
Value
Response in form of a list.
References
https://docs.sevenbridges.com/page/api
Examples
token <- "your_token"
# list projects
## Not run:
api(token = token, path = "projects", method = "GET")
## End(Not run)