There’s no official R package (yet!) for calling Cognitive Services APIs. But since every Cognitive Service API is just a standard REST API, we can use the httr package to call the API. Input and output is standard JSON, which we can create and extract using the jsonlite package.
This is also useful for other REST APIs for times when there isn’t already a pre-built package to do most of the translation work for you.