mm_list_get_reqs()
returns the necessary GET request(s) for
fetching the supplied endpoint and parameters. Multiple GET requests are
sometimes needed for two reasons.
One, Megamation does not support common ways of separating multiple values for a field inside an HTTP URL. These ways include:
using a
,
, e.g.?x=1,2
using a
|
, e.g.?x=1|2
turning each element into its own parameter, e.g.
?x=1&x=2
For Megamation, the first two ways will result in a 404 error. The last way fetches data where x is both 1 and 2 (not 1 or 2). Hence
mm_list_get_reqs()
defines separate GET requests for each value given to a parameter.
Two, the timecard endpoint is unique in that separate GET requests must be
made for separate years of data (e.g. 2022 vs 2023). This is also
automatically handled by mm_list_get_reqs()
.
Arguments
- endpoint
The API endpoint. For example,
"timecard"
for employee transactions, and"workorder"
for work orders. All endpoints are listed at https://apidocs.megamation.com/.- ...
<
dynamic-dots
> Name-value pairs to filter the request. The name should be the lower-case name of a field that is filter-enabled (in Megamation's words, a criteria). These arguments are processed withrlang::quos()
and support unquote via!!
and unquote-splice via!!!
.- allfields
If
TRUE
, return all fields currently available for the endpoint.