In Pinterest_post.py file, do we have to write the main() function?

Do we have to create a constructor to read the access token and board id and also the main function to call the publish_pin() function in the pinterest_post.py file?

You don’t need to create a constructor to read access token.
There are 3 parameters in the def publish_photo_msg(self, message, image_url). The first parameter self has the access token and board id, if you have solved merge conflicts properly and stored access token and board id in access_token.sh file.

Just see the Facebok_post.py for reference understand how the code is written in that file. You will easily solve this module.

But I can’t access the board_id and token from the self?
like self is not showing the id and token.

Okay i will check your code and will try to give you more concrete answer.

I have seen your code. It seems you have done the first part correct. But the second part to make necessary changes in pinterest_post.py is where you are struggling.

  • The best hint I can give you without revealing answer is please study the code present in facebook_post.py. Use it as a reference.

  • Study pinterest api and how to use them. Use the below link to check whether the link that you are generating is correct and the parameter you are adding in your request are correct or not.
    https://developers.pinterest.com/tools/api-explorer/?

  • Study of different HTTP responses.
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

  • Please don’t run the code too often as the recurring API calls will result in pausing the API service for an hour.

how to check whether the request I am giving is correct or wrong in pinterest_post.py?
cause it is running correct in postman and api explorer.

I am able to post a pin from postman and web explorer.

If the response you are getting is 200 then that request is accepted by the server.

but in that request I have to send the id and token but how to access board_id and access_token?

cause self.board_id is not working

tests/test_views.py:210: AssertionError
----------------------------- Captured stdout call -----------------------------
{‘message’: ‘You have exceeded your rate limit. Try again later.’, ‘type’: ‘api’}

Pinterest API: Looks you have hit the per hour API limit

I have got error in the assessment, which means I have to push the code after one hour?

Yes, I already warned you about this. You have two choices now

  1. To wait for an hour and then send the code for assessment.

  2. To create a new access token, paste it in the access_token.sh file and then submit the for assessment.

@Ramesh It’s been 1 day but we haven’t heard any response from you after replying to your query, I;m closing this topic. If you think one the above reply is a solution to your issue, please mark that reply as a solution. If your issue is still not resolved please create a new topic and paste this topic’s link in the description of the new topic.