Pinterest API - Authorisation Code - Error Code '2'
Asked Answered
P

1

8

We're getting the following error when attempting to get an authentication code when the user is not already logged into Pinterest:

{"status": "failure", "message": "Authentication failed.", "code": 2, "data": null}

Example of url we are using to authenticate:

https://api.pinterest.com/oauth/?client_id=1234567891011121314&redirect_uri=https://www.foobar.com/app/influencers/channels/callback/pinterest&scope=read_relationships,read_public&response_type=code&state=cc0c4fbbf2c5058df1932cb561e4494baaef595a

This URL works fine if the user is already logged into Pinterest, it displays the app confirmation and returns a code as expected. However it responds with an error if the user isn't logged in.

The documentation we are following is here:

https://developers.pinterest.com/docs/api/overview/?

Pedestrian answered 12/7, 2017 at 10:9 Comment(2)
We started seeing a huge spike of this two days ago. Same response body, all 401's to various endpoints like /boards/<id>/pins and /me/followers Would love to know what's up.Spindling
We also saw this error rate spike starting December 9th around 5pm PST, and has stayed high since. It appears that something changed/broke on the Pinterest side...Maximilien
F
3

I was experiencing this issue with a few accounts on my app. Turns out they had an old set of permissions associated with their account that needed to be flushed. I did the following:

  1. I went into the "problematic accounts" on Pinterest and went to the settings.
  2. From there, I went to the bottom section where "Apps" are listed and revoked access to my app.
  3. Once I tried to re-auth, everything worked fine from there on.

Hopefully, this is similar to your situation and can resolve it.

Facer answered 18/12, 2017 at 17:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.