Tests the key by querying the Datawrapper-API for user information.
dw_test_key(api_key = "environment")
Required. A Datawrapper-API-key as character string. Defaults to "environment" - tries to automatically retrieve the key that's stored in the .Reviron-file by
A S3-structure of type dw_user with the elements from the Datawrapper-API, and the following fields:
Returns 'ok' if the API-key used was correct.
Returns the internal user id.
The users e-mail adress.
Specifies, if the current user is admin in his/her organization.
Returns the organization's id or short name.
Returns the organization's full name.
This function tests the API key by retrieving information about the current user from the API. If this works, the API-key is set correctly and ready to go.
if (FALSE) dw_test_key() # uses the preset key in the .Renviron-file if (FALSE) dw_test_key(api_key = "1234ABCD") # uses the specified key