To manage this requirement in the dtmapi
package, a new
function, set_subscription_key()
, is introduced. Calling it
without arguments prompts the user to enter their subscription key,
which will make the key available for a given R session through the
environment variable DTM_SUBSCRIPTION_KEY
.
The functions which make API calls (such as
get_idp_admin1_data()
) have been changed to make the
subscription key that is assigned to the environment variable part of
the API request, since a valid key is a requirement for the API.
dtmapi
package, but it may technically be used
by users to conveniently return the currently available subscription
key. HOWEVER, beware that the string it returns is plain text and is
more easily exposed, e.g. exposed to anyone visually observing your
machine.