dw_test_key | R Documentation |
Tests the key by querying the Datawrapper-API for user information.
dw_test_key(api_key = "environment")
api_key |
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:
status |
Returns 'ok' if the API-key used was correct. |
data$user$id |
Returns the internal user id. |
data$user$email |
The users e-mail adress. |
data$user$isAdmin |
Specifies, if the current user is admin in his/her organization. |
data$user$organization$id |
Returns the organization's id or short name. |
data$user$organization$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.
Benedict Witzenberger
## Not run: dw_test_key() # uses the preset key in the .Renviron-file
## Not run: dw_test_key(api_key = "1234ABCD") # uses the specified key
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.