Learn R Programming

onemapsgapi (version 1.1.0)

get_token: Extract API token from OneMap.Sg

Description

This function is a wrapper for the OneMap Authentication Service API. It allows users to generate a API token from OneMap.Sg. Using the API requires that users have a registered email address with Onemap.Sg. Users can register themselves using OneMap.Sg's form.

Usage

get_token(email, password, hide_message = FALSE)

Value

API token, or NULL if an error occurs. If error occurs, a warning message will be printed with the error code.

Arguments

email

User's registered email address.

password

User's password.

hide_message

Default = FALSE. Whether to hide message telling user when the token expires.

Examples

Run this code
if (FALSE) get_token("user@example.com",  "password")

Run the code above in your browser using DataLab