"You must provide a hash." error when using the API to load data (in R)

I would like to extract data from MARVEL DEVELOPER by API code and analyze it (using R).

I got the following URL on the MARVEL website: http://gateway.marvel.com:80/v1/public/characters?apikey=f389fcb49ad574e10ca570867f4bfa43

I used the httr package to collect data:

install.packages("httr") library(httr) > url <- GET("http://gateway.marvel.com:80/v1/public/characters?orderBy=name&limit=100&apikey=f389fcb49ad574e10ca570867f4bfa43") > content(url) $code [1] "MissingParameter" $message [1] "You must provide a hash." 

I want to extract all this data in R. What should I do / read?

Thanks.

+5
source share
1 answer

You must specify ts (timestamp) and a hash parameter. Hash (as per documentation ) = md5 (ts + privateKey + publicKey)

You can calculate md5 with:

 library(digest) hash <- digest(paste0(ts, privateKey, publicKey), algo="md5") 
+6
source

Source: https://habr.com/ru/post/1214241/


All Articles