Comments (22)
Does the exception contain any message about what is going wrong? Like "expired access token" or something?
from pinsharp.
When I catch the exception, the message is only "Authorization Failed".
I looked at the app and the status says...
In development
You're almost ready! You still need at least 1 collaborator to authorize your app before you can submit. Also, in order to review your app, we require a fully testable implementation and instructions for how to authenticate with your service.
Does this matter?
Under Plateforms...
Site URL is: https://www.spygearco.net
Redirect URIs is greyed out and says... https://localhost/
from pinsharp.
Also, can you briefly explain how to (or better yet a short screen cast) create a Pinterest App so that your Api can successfully connect to it and use the functions?
I'm assuming you have to create a Pinterest App for every site you want to use your Api with, correct?
Thanks, Glenn
from pinsharp.
Looks like you are creating the client with your App Secret - you need to get an Access Token.
var authUrl = PinSharpAuthClient.BuildAuthorizationUrl(AppId, RedirectUrl, PinSharp.Api.Scopes.ReadPublic);
Go to that authUrl
and approve that the app can access your stuff. It will then redirect you to your RedirectUrl
with a query string appended like ?state=xxxxxx&code=89c0dc7470c05faa
.
Use the value of the code query string to get an access token:
var code = "89c0dc7470c05faa";
var accessToken = PinSharpAuthClient.GetAccessTokenAsync(AppId, AppSecret, code);
Then create the PinSharpClient
using that access token:
var client = new PinSharpClient(accessToken);
from pinsharp.
Thanks... I don't know what you mean by "Go to that authUrl and approve that the app can access your stuff." Can you please explain?
-Glenn
from pinsharp.
authUrl
will look like this:
https://api.pinterest.com/oauth/?response_type=code&client_id=5465468465134153&redirect_uri=https://www.google.dk&scope=read_public&state=a18e845450
Open that in a browser.
from pinsharp.
Forgive me, I'm a total novice at this...
All I have is my Site URL https://www.spygearco.net
What do I use for the client_id and redirect_uri? Is the client_id the same as the App ID ?
from pinsharp.
var authUrl = PinSharpAuthClient.BuildAuthorizationUrl(AppId, RedirectUrl, PinSharp.Api.Scopes.ReadPublic);
// authUrl will be something like this:
// https://api.pinterest.com/oauth/?response_type=code&client_id=5465468465134153&redirect_uri=https://www.google.dk&scope=read_public&state=a18e845450
Open the return authUrl
in your browser (log in to Pinterest if not already logged in) and approve your app.
Your browser will then be redirected to the RedirectUrl
you used earlier (the same have configured in your App settings). At the end of the URL will be a query string appended like ?state=xxxxxx&code=89c0dc7470c05faa
.
Use the value of the code
parameter to get an access token:
var code = "89c0dc7470c05faa";
var accessToken = await PinSharpAuthClient.GetAccessTokenAsync(AppId, AppSecret, code);
Then create the PinSharpClient
using that access token:
var client = new PinSharpClient(accessToken);
from pinsharp.
The redirect URL is configured here in your App settings:
You can enter several URLs if you want. I have set mine to https://www.google.dk
.
from pinsharp.
I'm getting this compiler error for var client = new PinSharpClient(accessToken);
Argument 1: cannot convert from 'System.Threading.Tasks.Task' to 'string'
Also, how does the Pinterest App created relate to the pinterest account?
from pinsharp.
Sorry, I forgot an await
in there.
var accessToken = await PinSharpAuthClient.GetAccessTokenAsync(AppId, AppSecret, code);
from pinsharp.
The app doesn't relate to the pinterest account. The access token you get is bound to the account you are logged in with, when you visit the authUrl
and approves that the app can access your information.
from pinsharp.
I double checked the code below and put the RedirectURL in the App.
var code = "93bb84390bc55590";
var accessToken = await PinSharpAuthClient.GetAccessTokenAsync("4961064019864599783", "2e12f14e1ff2074c9df2428cabfb5f0cf421a2241855418af915cb1c00c815b5", code);
OK. Now I get this error message...
"Response status code does not indicate success: 401 (Unauthorized)."
- Please advise
from pinsharp.
Well I got it to work once. Then tried my code again and now get this error message.
"Response status code does not indicate success: 429 (Too Many Requests)."
What does this mean?
Also, do you execute this URL code https://api.pinterest.com/oauth only once to get the code value?
Also, can the same Pinterest App work for multiple Pinterest accounts?
from pinsharp.
I installed this program PostMan and it's a lot easier to create an Access Token to use your API.
Do you recommend using a new Pinterest App for each Pinterest account that is created in order to pin to various boards?
from pinsharp.
Also, do you execute this URL code api.pinterest.com/oauth only once to get the code value?
When you have the Access Token you can re-use that until it expires. You should an error when it does, then just repeat the steps you did before to get a new Access Token.
Also, can the same Pinterest App work for multiple Pinterest accounts?
Do you recommend using a new Pinterest App for each Pinterest account that is created in order to pin to various boards?
You can use the same App for many users. If you want to test, just log into another account before you visit the authUrl
.
You will need to create an Access Token for each user and use that one, when pinning to boards that they own.
from pinsharp.
I need your input. I got your API working on my end and submitted my App to pinterest and they rejected it. What are the proper steps to get the App accepted by pinterest to allow for the maximum rate limit of calls?
from pinsharp.
from pinsharp.
Thanks again,
Would you happen to know of an API for C# that can pin to a pinterest account using just the account eMail, Password and Optional Proxy IP? Using an App and trying to get it approved for maximum pinning seems like a real hassle.
-Glenn
from pinsharp.
I don't I'm sorry.
from pinsharp.
Hi Again,
Do I need to have my App approved by Pinterest to use your API? What is the advantages of getting the App approved?
from pinsharp.
Please, read Pinterest's developer documentation or ask them. I'm not in any way affiliated with Pinterest. My library just lets you call their API.
Effective April 16 2018, all unapproved apps are allowed 10 calls per hour for each unique user token.
After you successfully submit an app for approval, each app (with a unique app ID) is allowed 1000 calls per hour for each unique user token.
In both cases, the 60-minute window is a sliding window based on when you make your first request. If you hit your rate limit, you’ll have to wait a minimum of 1 hour to get a few more requests.
from pinsharp.
Related Issues (20)
- Cannot access a disposed object HOT 2
- Can't find a way to get users pins HOT 2
- Create pin from local file HOT 4
- 403 error after 45+ GetPinsAsync HOT 3
- Does pinterest access toke take down? HOT 1
- I used postman to generate an access token and not works !
- Is code Works on 2019? HOT 1
- Access Token ? HOT 1
- Getting App Approved? HOT 3
- Board Not Found HOT 2
- Using with Desktop client (Winform/WPF) HOT 1
- Create Board & Change Title? HOT 1
- Can I sign in by mail and password? HOT 1
- Invalid Parameters HOT 10
- Create pin api is failing HOT 2
- Functions Not Working HOT 1
- Pinterest Api V5 HOT 3
- Token v5 Not Working - Always Null HOT 1
- Question: Pinning limits HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinsharp.