orionOAuth: orionAuthenticate

Description Usage Arguments Details Author(s) Examples

View source: R/orion_auth.R

Description

Authenticate the Orion API.

Usage

1
2
orionOAuth(client.id, client.secret, grant.type = "client_credentials",
  save = FALSE)

Arguments

client.id

Your client_id

client.secret

Your client_secret

grant.type

Currently only supports client_credentials (default)

save

If TRUE will save the token for future sessions, default to FALSE

Details

Please see the official documentation to apply for the API and get your client_id and client_secret: api.ori.cmcm.com/doc/#api-Auth-access_token. If the token is stored (save = TRUE) then orionOAuth does not need to be run in future sessions, see example.

Author(s)

John Coene [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# authenticate
orionOAuth(client.id = 0000,
           client.secret = "0x00000000x00x0x000xxx0000x0xx0")
           
# test
camp_oauth <- listCampaigns()
           
# authenticate and save
orionOAuth(client.id = 0000,
           client.secret = "0x00000000x00x0x000xxx0000x0xx0", 
           save = TRUE)
           
# detach and unload package
detach("package:oRion", unload = TRUE)

# no oauth
library(oRion)
camp_noauth <- listCampaigns()

identical(camp_oauth, camp_noauth)

## End(Not run)

JohnCoene/oRion documentation built on Jan. 12, 2019, 10:06 a.m.