forked from AndreasFischer1985/entgeltatlas-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_example.R
18 lines (17 loc) · 867 Bytes
/
api_example.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#----------------
# Simple Example
#----------------
install.packages(c("devtools","rjson","httr"))
devtools::install_github("AndreasFischer1985/qqBaseX")
clientId='c4f0d292-9d0f-4763-87dd-d3f9e78fb006'
clientSecret='566c4dd6-942f-4cda-aad6-8d611c577107'
postData=list( "grant_type"="client_credentials","client_id"=clientId,"client_secret"=clientSecret)
token_request=httr::POST(
url="https://rest.arbeitsagentur.de/oauth/gettoken_cc",
body=postData,encode="form",
config=httr::config(connecttimeout=60))
token=(httr::content(token_request, as='parsed')$access_token)
url="https://rest.arbeitsagentur.de/infosysbub/entgeltatlas/pc/v1/entgelte/84304?l=4&r=1&a=1&b=1"
data_request=httr::GET(url=url, httr::add_headers(.headers=c("OAuthAccessToken"=token)),
config=httr::config(connecttimeout=60))
data=httr::content(data_request)