API Request Error


#1

Hi All,

I am facing this issue while fetching the data from Adobe Analytics using R Studio.
Here is the error which i am getting

Error in ApiRequest(body = report.description, func.name = “Report.Validate”) : **
** ERROR: Bad Request - The specified created timestamp (‘2018-03-02T11:12:31Z’) has expired or is in the future

Can anyone help me to solve this issue as soon as possible?

Thanks,
Sushant


#2

You should post a reprex ( https://www.jessemaegan.com/post/so-you-ve-been-asked-to-make-a-reprex/ ) so we can see the code run that is causing this problem. Without seeing the code that caused the error message it will be hard to determine what is causing it.

Also when you get an error message that doesn’t give you the information you need to fix it you should search the web for the literal text of the error message. For example if you search the web for “Error in ApiRequest” you will find a number of messages from others who have run into a problem that may be similar to yours.


#3

Hi Danr,

Thanks for the quick reply.
I am not able to post the code on reprex.

Here is it,

library(plyr)
library(RSiteCatalyst)
library(stringr)


# User Inputs
inputdir = "C:\\Users\\s.shivaji.desai\\Desktop\\Scripts\\Scripts\\AT"


# reading INPUT data per work type /queue

setwd(inputdir) # working directory 
SCAuth("**********", "**********") 
report_suites <- GetReportSuites()


# change the month
from.date = "2018-02-01"
to.date   = "2018-02-28"


# change the suite as
rsid <-"fcae.lancia.austria"
    #Lancia

# Page conversion_leads
Rpt_Output_Lead <-       QueueTrended(rsid ,from.date, to.date,
                                      c("event2","event1","event76","visits","visitors"),
                                      c("page"),top = 30, 
                                      date.granularity="month",
                                      #segment.id = "588f3013e4b0483bc4b8d6e0", segment.inline = "5893734be4b0799ee117edf9",
                                      segment.id=c("588f3013e4b0483bc4b8d6e0","5893734be4b0799ee117edf9"),
                                      max.attempts=1000)


# Download Page conversion_Lead
write.table(x=Rpt_Output_Lead, file = "Lancia_Desktop_Lead.xls", append = FALSE, sep = "\t", quote = TRUE, na = "NA",   row.names = FALSE, col.names = TRUE, dec =  ".", eol = "\n") 

# Download Page_name_with_URL

write.table(x=Rpt_Output_page_anme_with_URL, file = "FiatPro_Desktop_page_name_with_URL.xls", append = FALSE, sep = "\t", quote = TRUE, na = "NA",   row.names = FALSE, col.names = TRUE, dec =  ".", eol = "\n")

#4

One of the keys to a reprex (short for minimal reproducible example) is that it be self-contained. Since we don’t have access to your hard drive, no one else can see the data you’re using— making it hard to troubleshoot.

The reprex dos and don’ts are really useful when it comes to making it possible for others to help you!


#5

inputdir = “C:…” is just the place where i want my files to be saved after downloading the data through Rstudio API.

what should i do to get it resolved!!:frowning: i am in big trouble because of this issue.


#6

What is the issue you are running into making a reprex?

The web search for “Error in ApiRequest” turns up a number messages that discuss a problem using RSiteCatalyst that looks very similar to what you are running into. Have you checked those out to see if their fixes would work for you or give you a better idea of what the underlying problem is?