freshdesk_api: Calls Freshdesk API

Description Usage Arguments Details Value Examples

Description

freshdesk_api queries the Freshdesk API and returns a result.

Usage

1
freshdesk_api(client, path, query = NULL, per_page = NULL, pages = Inf)

Arguments

client

The Freshdesk API client object (see freshdesk_client).

path

The API query path.

query

API query string.

per_page

The number of results per page. The default is 30. Values over 100 will result in an error being raised as it wis not allowed by the Freshdesk API.

pages

By default, all pages will be returned. Specify this value along with the per_page parameter to limit the number of results returned.

Details

This function queries the Freshdesk API based on a path and returns a freshdesk_api object containing the http responses, the parsed content, and the API rate limit status. If the results are paginated, all of the results will be returned up to the number of pages specified (all pages by default). If the results span multiple pages, a list of http responses and the rate limit information from the final call is returned in the freshdesk_api object along with all the data combined.

Value

An S3 object contaitning the following attributes:

Examples

1
2
3
4
5
6
## Not run: 
fc <- freshdesk_client("foo", "MyAPIKey")
apidata <- freshdesk_api(fc, "/api/v2/tickets/3")
apidata$rate_limit_remaining

## End(Not run)

jjanuszczak/freshdeskr documentation built on May 29, 2019, 11:05 p.m.