plotly_POST deprecated; api_create not working in R

I had previously used this code to post to plotly:

g<-ggplotly(g)
temp<-plotly_POST(g,filename=“x”)

where g is a ggplot object. After updating ggplot, I got an error saying this function is deprecated and to use api_create instead. So, I changed my code to:

g<-ggplotly(g)
temp<-api_create(g,filename=“SelfSignup_Marketing/update_time”,sharing=“public”)

and I get this error:

Error: Client error: (401) Unauthorized
No such user

When I test plotly:::verify(“username”) and plotly:::verify(“api_key”), I get the correct responses. I installed the development version (devtools::install_github(“ropensci/plotly”)) and this did not fix the error. What is going on here and how do I fix it?.. Thanks!

devtools::session_info()
Session info -----------------------------------------------------------------------
setting value
version R version 3.3.2 (2016-10-31)
system x86_64, darwin13.4.0
ui RStudio (1.0.136)
language (EN)
collate en_US.UTF-8
tz America/Los_Angeles
date 2017-05-19

Packages ---------------------------------------------------------------------------
package * version date source
acepack 1.4.1 2016-10-29 CRAN (R 3.3.0)
assertthat 0.2.0 2017-04-11 CRAN (R 3.3.2)
backports 1.0.5 2017-01-18 CRAN (R 3.3.2)
base * 3.3.2 2016-10-31 local
base64enc 0.1-3 2015-07-28 CRAN (R 3.3.0)
checkmate 1.8.2 2016-11-02 CRAN (R 3.3.0)
chron 2.3-50 2017-02-20 CRAN (R 3.3.2)
cluster 2.0.6 2017-03-16 CRAN (R 3.3.2)
colorspace 1.3-2 2016-12-14 CRAN (R 3.3.2)
crosstalk 1.0.0 2016-12-21 cran (@1.0.0)
curl 2.6 2017-04-27 CRAN (R 3.3.2)
data.table * 1.10.4 2017-02-01 CRAN (R 3.3.2)
datasets * 3.3.2 2016-10-31 local
DBI * 0.6-1 2017-04-01 CRAN (R 3.3.2)
devtools 1.13.1 2017-05-13 CRAN (R 3.3.2)
digest 0.6.12 2017-01-27 cran (@0.6.12)
dplyr * 0.5.0 2016-06-24 CRAN (R 3.3.0)
dtplyr * 0.0.2 2017-04-21 CRAN (R 3.3.2)
foreign 0.8-68 2017-04-24 CRAN (R 3.3.2)
Formula * 1.2-1 2015-04-07 CRAN (R 3.3.0)
ggplot2 * 2.2.1.9000 2017-05-20 Github (hadley/ggplot2@f4398b6)
git2r 0.18.0 2017-01-01 CRAN (R 3.3.2)
graphics * 3.3.2 2016-10-31 local
grDevices * 3.3.2 2016-10-31 local
grid 3.3.2 2016-10-31 local
gridExtra * 2.2.1 2016-02-29 CRAN (R 3.3.0)
gsubfn * 0.6-6 2014-08-27 CRAN (R 3.3.0)
gtable 0.2.0 2016-02-26 CRAN (R 3.3.0)
Hmisc * 4.0-3 2017-05-02 CRAN (R 3.3.2)
hms 0.3 2016-11-22 CRAN (R 3.3.2)
htmlTable 1.9 2017-01-26 CRAN (R 3.3.2)
htmltools 0.3.6 2017-04-28 CRAN (R 3.3.2)
htmlwidgets 0.8 2016-11-09 CRAN (R 3.3.2)
httpuv 1.3.3 2015-08-04 CRAN (R 3.3.0)
httr * 1.2.1 2016-07-03 CRAN (R 3.3.0)
jsonlite 1.4 2017-04-08 CRAN (R 3.3.2)
knitr 1.15.1 2016-11-22 CRAN (R 3.3.2)
labeling 0.3 2014-08-23 CRAN (R 3.3.0)
lattice * 0.20-35 2017-03-25 CRAN (R 3.3.2)
latticeExtra 0.6-28 2016-02-09 CRAN (R 3.3.0)
lazyeval 0.2.0 2016-06-12 CRAN (R 3.3.0)
lubridate * 1.6.0 2016-09-13 CRAN (R 3.3.0)
magrittr 1.5 2014-11-22 CRAN (R 3.3.0)
Matrix 1.2-10 2017-04-28 CRAN (R 3.3.2)
memoise 1.1.0 2017-04-21 CRAN (R 3.3.2)
methods * 3.3.2 2016-10-31 local
mime 0.5 2016-07-07 CRAN (R 3.3.0)
munsell 0.4.3 2016-02-13 CRAN (R 3.3.0)
nnet 7.3-12 2016-02-02 CRAN (R 3.3.2)
plotly * 4.7.0 2017-05-20 Github (ropensci/plotly@270506e)
plyr 1.8.4 2016-06-08 CRAN (R 3.3.0)
proto * 1.0.0 2016-10-29 CRAN (R 3.3.0)
purrr 0.2.2.2 2017-05-11 CRAN (R 3.3.2)
R6 2.2.1 2017-05-10 CRAN (R 3.3.2)
RColorBrewer * 1.1-2 2014-12-07 CRAN (R 3.3.0)
Rcpp 0.12.10 2017-03-19 CRAN (R 3.3.2)
readr * 1.1.1 2017-05-16 CRAN (R 3.3.2)
reshape2 * 1.4.2 2016-10-22 CRAN (R 3.3.0)
rlang 0.1 2017-05-06 CRAN (R 3.3.2)
rpart 4.1-11 2017-04-21 CRAN (R 3.3.2)
RPostgreSQL * 0.4-1 2016-05-08 CRAN (R 3.3.0)
RSQLite * 1.1-2 2017-01-08 CRAN (R 3.3.2)
scales * 0.4.1 2016-11-09 CRAN (R 3.3.2)
shiny 1.0.3 2017-04-26 CRAN (R 3.3.2)
splines 3.3.2 2016-10-31 local
sqldf * 0.4-10 2014-11-07 CRAN (R 3.3.0)
stats * 3.3.2 2016-10-31 local
stringi 1.1.5 2017-04-07 CRAN (R 3.3.2)
stringr * 1.2.0 2017-02-18 CRAN (R 3.3.2)
survival * 2.41-3 2017-04-04 CRAN (R 3.3.2)
tcltk 3.3.2 2016-10-31 local
tibble 1.3.1 2017-05-17 CRAN (R 3.3.2)
tidyr * 0.6.3 2017-05-15 CRAN (R 3.3.2)
tools 3.3.2 2016-10-31 local
utils * 3.3.2 2016-10-31 local
viridisLite 0.2.0 2017-03-24 CRAN (R 3.3.2)
withr 1.0.2 2016-06-20 CRAN (R 3.3.0)
xtable * 1.8-2 2016-02-05 CRAN (R 3.3.0)

Hi @annes72, what’s your username?

I’m using an on-premise plotly so not sure my user name would be useful here. …

Hi there,
For help with your Plotly On-premise account please contact your On-premise representative (the instructions will likely be different than general community questions, for example you must complete the Special Instructions for On-Prem getting started step).
Thanks!