I'm trying to find the way to connect to Appannie's API with R using the httr package (have no experience with API connection at all).
The API requires to include the request header
Citation from appannie's site:
Register an App Annie account and generate an API key.
Add this key to your request header as follows:
Authorization: Bearer '' citation over
I wrote the code which looks like this
query <- "http://api.appannie.com/v1/accounts/1000/sales?break_down=application+dat
&start_date=2012-01-01
&end_date=2012-02-01
¤cy=USD
&countries=US
&page_index=1"
getdata<-GET(url=query, add_headers("Authorization: bearer 811b..."))
the command http_status(getdata) shows me "client error: (401) Unauthorized" can someone please help me with it, what do I do wrong?