sstk_auth: Authorize Shutterstock R package

Description Usage Arguments Details Examples

View source: R/connection.R

Description

Authenticate and store user credentials to authorize requests for the Shutterstock API.

Usage

1
sstk_auth(scopes = NULL)

Arguments

scopes

character. The default value is NULL. See details below for more information.

Details

This call starts the OAuth 2.0 authentication process. After successful authentication, an OAuth token will be cached inside the .httr-oauth, which is a file placed in the current working directory. Shutterstock package searches for a token saved in .httr-oauth file in different R sessions. If the token is not found in the directory, the call launches OAuth 2.0 authentication flow. This workflow is mainly followed by the httr package.

The argument scopes accept a list of OAuth scopes defined in the Shutterstock API. The default value is set to NULL but that includes the “user.view” scope which the Shutterstock API grants by default when no additional scopes have been provided. Use “all” keyword to demand all scopes to be included in the OAuth token.

See the full Shutterstock API OAuth scope list here: https://api-reference.shutterstock.com/#authentication-oauth-scopes-h2

Examples

1
2
3
4
5
6
7
8
## Not run: 
# apply collections.view and licenses.view scopes:
sstk_auth(scopes = c("collections.view", "licenses.view"))

# apply all available scopes:
sstk_auth(scopes = "all")

## End(Not run)

shutterstock documentation built on May 1, 2019, 6:57 p.m.