3

I am using the REST API for integrating Pinterest into my Android app, but I'm getting an error when attempting to access categories.

My code:

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);

I'm getting the following error returned from the endpoint:

{
    "message": "Please upgrade your app!", 
    "error": "Authentication failed: Please upgrade your app!"
}
Michael Celey
  • 12,645
  • 6
  • 57
  • 62
Indra KP
  • 169
  • 2
  • 11
  • 1
    Check out [this link](http://www.datasprings.com/resources/articles-information/pinterest-api-programming) and see how to use Pinterest API Authentication. – yorkw Mar 07 '13 at 22:27

2 Answers2

0

Pinterest doesn't have any official api, and it's unofficial api is not working now. So I don't think your code will work any way, unless someone finds any other unofficial api or Pinterest releases the official version.

PS: More Info.

Community
  • 1
  • 1
0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
  • Just check the url - https://api.pinterest.com/v2/boards/categories/ it'll print the same error message you're getting. – 0xC0DED00D Mar 14 '13 at 12:03
  • Official answer from pinterest - https://help.pinterest.com/entries/21151603-i-m-a-developer-does-pinterest-have-a-public-api – 0xC0DED00D Mar 14 '13 at 12:06
-1

As of today, pinterest API has been taken down (look here)

In the meantime you might want to use this 3rd party implemented scraper, which works just like an API

http://pinterestapi.co.uk/

You can use this to get the boards, likes and pins of a user.

Note: Curiously the count for the v1 api still works. But again this is undocumented behaviour and dont rely on this

Ahmed Aeon Axan
  • 2,139
  • 1
  • 17
  • 30