2012-12-26 24 views
3

我正在使用REST API將Pinterest集成到我的Android應用程序中,但在嘗試訪問類別時出現錯誤。如何在Android應用中正確整合Pinterest?

我的代碼:

String url = "https://api.pinterest.com/"; 
String allCategories = "/v2/boards/categories/"; 
RestClient client = new RestClient(url + allCategories); 
String response = ""; 

    try { 
     client.AddParam("limit", "36"); 

     try { 
      client.Execute(RequestMethod.GET); 
     } catch (Exception e) { 
      e.printStackTrace(); 
     } 
     response = client.getResponse(); 
    } catch (Exception e) { 
     System.out.println(">>> Exception >>> " + e + " >>> Message >>> " 
       + e.getMessage()); 
    } 
    System.out.println(">>> response >>> " + response); 
    Log.d(">> Login response >>> ", response); 

我越來越從端點返回以下錯誤:

{ 
    "message": "Please upgrade your app!", 
    "error": "Authentication failed: Please upgrade your app!" 
} 
+1

查看[此鏈接](http://www.datasprings.com/resources/articles-information/pinterest-api-programming)並查看如何使用Pinterest API身份驗證。 – yorkw

回答

-1

截至目前,Pinterest的API已經被撤下 (看here

與此同時,您可能想要使用此第三方實施的刮板,它的工作原理與API

http://pinterestapi.co.uk/

您可以使用它來獲取用戶的板,喜歡和引腳。

注意:奇怪的是,v1 api的計數仍然爲works。但這又是無證行爲,不依賴於此

0

Pinterest沒有任何官方API,它是非官方API是not working now。所以我不認爲你的代碼會以任何方式工作,除非有人發現任何其他非官方api或Pinterest發佈官方版本。

PS:More Info

+0

只需檢查網址 - https://api.pinterest.com/v2/boards/categories/它會打印您收到的同樣的錯誤消息。 – noob

+0

pinterest的正式答案 - https://help.pinterest.com/entries/21151603-i-m-a-developer-does-pinterest-have-a-public-api – noob

相關問題