小编DDu*_*ffy的帖子

无法通过Tableau REST API返回用户收藏夹

我正在通过C#使用Tableau REST API来尝试获取用户收藏夹列表.我知道用户有一些,因为它是我的.我尝试过使用API​​版本2.8,3.0,3.1和3.2几乎没有任何乐趣.2.8和3.0响应:

<?xml version='1.0' encoding='UTF-8'?>
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-2.8.xsd"> //3.0.xsd when using API Version 3.0
     <favorites/> //There should be a plethora of favorites of all varieties in here.
</tsResponse>
Run Code Online (Sandbox Code Playgroud)

3.1和3.2给我一个(404)未找到.

我在c#中的代码是:

public static string QueryFavourites(string APIVersion, string AuthToken, string SiteID, string UserID)
    {
        string result = "";
        try
        {
            string url = $@"{Server}/api/{APIVersion}/sites/{SiteID}/favorites/{UserID}";
            // Create the web request 
            WebRequest request = WebRequest.Create(url) as WebRequest;
            request.PreAuthenticate = true;
            request.Headers.Add($"x-tableau-auth: {AuthToken}");

            // Get response 
            using (WebResponse response = request.GetResponse())
            { …
Run Code Online (Sandbox Code Playgroud)

c# tableau-api tableau-server

9
推荐指数
1
解决办法
329
查看次数

标签 统计

c# ×1

tableau-api ×1

tableau-server ×1