K
K
Kislyy2020-01-06 00:09:10
Steam
Kislyy, 2020-01-06 00:09:10

Steam API - GetFriendList, how to write received data to an array?

In general, I want to get a list of friends using the Steam API, I managed to give a request, but as I understand it, friendlist should be in the array "The user's friends list, as an array of friends. Nothing will be returned if the profile is private.", added List <> but I don't know how to use it correctly, help
Program.cs :
using RestEase;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Test_steam_friends
{
class Program
{
private static Iinterface client;
static async Task Main(string[] args)
{
string url = " api.steampowered.com/ISteamUser/GetFriendList/v0001 ";
client = RestClient.For(url);
string key = "XXXXXXXXXXXXXXXXXXXXXXXX"; //hid my api
await Get(key);
Console.ReadKey();
}
private static async Task> Get(string key)
{
string steamid = "76561198068038882";
string relationship = "friend";
var friendlist = new List();
friendlist = await client.GetFriendList(key,steamid,relationship);
return friendlist;
}
}
}
===========================================
Iinterface .cs :
using RestEase;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Test_steam_friends
{
public interface Iinterface
{
[Get]
Task> GetFriendList([Query("Key")]string Key,string steamid,string relationship);
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question