Get all runes with id and name from League of legends API - riot-games-api

When performing requests to the riot API endpoint /lol/match/v4/matches/{matchId} the response contains rune data for each player in the match .e.g
"perk0": 8005,
"perk0Var1": 2107,
"perk0Var2": 1319,
"perk0Var3": 788,
These are only the Id values for the runes. Where can I get the corresponding name for the rune ?
I've tried the following request : https://euw1.api.riotgames.com/lol/static-data/v1/runes , but returns the following response :
{
"status": {
"message": "Forbidden",
"status_code": 403
}
}

I found the resource that stores all the needed data here : http://ddragon.leagueoflegends.com/cdn/10.16.1/data/en_US/runesReforged.json

Related

Youtube Data API v3 nextPageToken not working

So I've just started to use the Youtube Data API to get comments from youtube videos. My program has been working until I tried to use the next page token to get more comments. So it first calls the normal URL without the &pageToken=***and then the next time it loops back it calls it with that but returns an error
{
"error": {
"errors": [
{
"domain": "youtube.parameter",
"reason": "invalidPageToken",
"message": "The request specifies an invalid page token.",
"locationType": "parameter",
"location": "pageToken"
}
],
"code": 400,
"message": "The request specifies an invalid page token."
}
}
My program, when calling the first time would get the key returned and save it in a variable for the next time it calls the new url. Yes, I have verified that my variable holds a key. Any help would be greatly appreciated! Thanks in advance :D
You forget playlistId it's required , example :
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=3&playlistId=PLw6Y5u47CYq47oDw63bMqkq06fjuoK_GJ&pageToken=EAAaBlBUOkNBTQ&key=['api_key']&nextPageToken=EAAaBlBUOkNBTQ
take a look on api documentation

user.messages.get responding invalid ID

when attempting to test out the api explorer for user.messages: get I have been getting an invalid message ID response.
I am getting the message ID from a recent email in my inbox sent to me, and removed the <> from either ends.
response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid id value"
}
],
"code": 400,
"message": "Invalid id value"
}
}
I am a bit confused as I am using the powershell module gshell and noticed that the same messageID worked in my commands but returned invalid id value in the api explorer.
edit: if I do a inbox search for rfc822msgid:[messageID] it returns the correct message
First you have to call the users.messages.list api. It will give a list of messageids. Then we have to call users.message.get api with each messageid to fetch the mail content. You can query the mails with advanced search options provided by Gmail API.
You should not use the rfc822msgid, but the Gmail API message id. Try to list messages and use the id you get from that when getting the message.

Fetch messages filtered by conversationId via Office365 API

I'm having some trouble figuring out how to use the office365 api to fetch messages given a conversationId.
Let's say my conversationId is AAQkADlkOGJmMTFmLTc2NjMtMKL3My04ZDhkLTVmZWNjMzA1ODY0NAAQAB11Xh2opSpBiXifMEJjhow=
I'll make a request like
https://outlook.office.com/api/v1.0/me/Messages?$filter=ConversationId%20eq%20AAQkADlkOGJmMTFmLTc2NjMtMKL3My04ZDhkLTVmZWNjMzA1ODY0NAAQAB11Xh2opSpBiXifMEJjhow=
This results in a 400 response like this:
{
"error": {
"code": "RequestBroker-ParseUri",
"message": "Syntax error at position 98 in 'ConversationId eq AAQkADlkOGJmMTFmLTc2NjMtMKL3My04ZDhkLTVmZWNjMzA1ODY0NAAQAB11Xh2opSpBiXifMEJjhow='."
}
}
I tried other things, such as url encoding the conversationId to AAQkADlkOGJmMTFmLTc2NjMtMKL3My04ZDhkLTVmZWNjMzA1ODY0NAAQAB11Xh2opSpBiXifMEJjhow%3D which results in the same error.
I also tried simply removing the = which seems to be the character that is freaking it out
https://outlook.office.com/api/v1.0/me/Messages?$filter=ConversationId%20eq%20AAQkADlkOGJmMTFmLTc2NjMtMKL3My04ZDhkLTVmZWNjMzA1ODY0NAAQAB11Xh2opSpBiXifMEJjhow
but that results in the following error
{
"error": {
"code": "RequestBroker-ParseUri",
"message": "Could not find a property named 'AAQkADlkOGJmMTFmLTc2NjMtMKL3My04ZDhkLTVmZWNjMzA1ODY0NAAQAB11Xh2opSpBiXifMEJjhow' on type 'Microsoft.OutlookServices.Message'."
}
}
I've also tried messing with the url capitalization and using + signs instead of %20 for the filter string, but I consistently get 400 errors back.
I am able to filter by other fields though. For example
https://outlook.office.com/api/v1.0/me/Messages?$filter=IsRead%20eq%20true
returns messages filtered as I would expect.
Any idea what could be going on with the ConversationId filter?
You need to wrap the ConversationId with single quotes.
This is how I forge my request in C#
string finalUrl = "https://outlook.office.com/api/beta/me/Messages?$filter=" + HttpUtility.UrlEncode(string.Format("ConversationId eq '{0}'", conversationId));

Mailchimp API 2.0 lists/subscribe responding with error 250 List_MergeFieldRequired MMERGE4 is required

I'm attempting to use the lists/subscribe Mailchimp API 2.0 endpoint to subscribe an email to a list, but I keep getting a puzzling error. My request looks like:
{
"apikey":"myapikey-us5",
"id":"listid",
"email":{"email":"my#email.com"},
"double_optin":false,
"send_welcome":true
}
I'm sending this to https://us5.api.mailchimp.com/2.0/lists/subscribe.json and getting this response:
{
"status": "error",
"code": 250,
"name": "List_MergeFieldRequired",
"error": "MMERGE4 must be provided - Please enter a value"
}
And if I specify "merge_vars": {} I still get the same error. What am I missing here?
It means you need to provide a value for MMERGE4 merge field. How you do this depends on what type of merge field MMERGE4 is, but It would be like this:
{
"apikey":"myapikey-us5",
"id":"listid",
"email":{"email":"my#email.com"},
"double_optin":false,
"send_welcome":true,
"merge_vars": {
"MMERGE4": "something"
}
}
But you should look and see what type of data that is, otherwise you might cause issues for whomever set that up as a required field.

403 Forbidden resposnse from a GET request to http://api.espn.com/v1/sports/news/6277112

I have problem with the ESPN API:
I have an API key, and sent a query to the address http://api.espn.com/v1/sports/news/1581816?region=GB, which included my API key in the parameters.
I received 403 forbidden response: with this JSON
{
"status": "error",
"code": 403,
"message" : "Account Inactive"
}
I am looking at http://developer.espn.com/docs/headlines#using-the-api and at the last line it says that i can make a GET request to this url and it should work, but it doesn't.
How can I receive a valid response from the ESPN servers?
I just test it and it works fine. That means your key is invalid, or you are not including it. Replace below and it will work.
http://api.espn.com/v1/sports/news/1581816?region=GB&apikey=<yourKey>
--
{
timestamp: "2013-10-13T15:33:49Z",
resultsOffset: 0,
status: "success",
resultsLimit: 10,
resultsCount: 1,
headlines: [
{ ... }
]
}

Resources