Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't post a new pin #175

Open
KristyAnon opened this issue May 10, 2022 · 3 comments
Open

Can't post a new pin #175

KristyAnon opened this issue May 10, 2022 · 3 comments

Comments

@KristyAnon
Copy link

Hi, I just updated my code to the version 1.3.0, and now I can't post a new pin.
This is my code:
pin_response = pinterest.pin(board_id='', section_id=None, image_url='https://dummyimage.com/200x200/000/fff.jpg&text=testing', description='testing', link='https://dummyimage.com/200x200/000/fff.jpg&text=testing' )

And this is the error that I'm getting
Traceback (most recent call last): File "I:\myPInt\python\py3-pinterest-master.vCN\zz_testing.py", line 108, in <module> pin_response = pinterest.pin(board_id='', File "I:\myPInt\python\py3-pinterest-master.vCN\py3pin\Pinterest.py", line 595, in pin return self.post(url=PIN_RESOURCE_CREATE, data=data) File "I:\myPInt\python\py3-pinterest-master.vCN\py3pin\Pinterest.py", line 170, in post return self.request( File "I:\myPInt\python\py3-pinterest-master.vCN\py3pin\Pinterest.py", line 162, in request response.raise_for_status() File "C:\Python\lib\site-packages\requests\models.py", line 960, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://www.pinterest.com/resource/PinResource/create/

Any idea how to resolve it?

Thanks,
Kristy

2022-05-10 203719

@bstoilov
Copy link
Owner

This happens if the board id is wrong. I just tested locally and it seems to be working

@benx13
Copy link

benx13 commented Aug 14, 2022

@KristyAnon did you fix it I'm getting the same issue

@Humenuik
Copy link

Humenuik commented Feb 9, 2023

Saw that there wasn't an answer as to getting the board_id correct. To get the correct board_id:

import pprint

pprint.pprint(pin.boards(username=username))

This will print out the JSON in an easily readable format. Look for id: value for the board with name: board you want. Use the id value for the id.

If you are trying to make this scale, you can probably just make a function to loop through all current boards looking for the one you want to add to, if it finds the name, it stores the id value to upload the pin to. If it doesn't find the name, it creates the board and stores the id to upload the PIN. Hope this helps anyone who gets stuck.

quick edit: Don't use the ID under owner. That is your JSON ID value, not the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants