auth_signature | R Documentation |
Requests against the last.fm API must be signed using the following algorithm as described in the API documenation.
A short description of the methodology is included here for completeness:
Sort query parameters by key
Create a single string with all parameters formatted as follows
<key><value>
using UTF-8 encoding,
Append the Client Secret value (without a key),
Hash the resulting string using a 32bit md5 hash
The signature is then added as extra parameter named api_sig
.
These functions are not designed to be invoked directly. Requests are signed
by default when using lastfm()
and all other dependent raw and tidy
endpoint functions.
add_signature()
takes a list with request parameters and an auth_client
signs it by adding the api_sig
element.
create_signature()
performs steps 1, 2, and 3
hash_signature()
performs step 4
add_signature(params, auth_client) create_signature(params, auth_client) hash_signature(raw_signature)
params |
Named list of query parameters |
add_signature()
returns a list
create_signature()
and hash_signature()
return strings
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.