Steps to Setup Pinterest Developer account & token Generation
Prerequisites for API Access
- You Must have a Pinterest Business Account to Create and Apply for a Pinterest Developer account and if don’t create a Pinterest account
- Access to the Pinterest Marketing API requires an approved App. Please follow the steps below to create an App and Apply for access.
Apply for an App
- Log into your Pinterest Business Account with the user ID that you’ll use to manage your developer account’s applications.
- You can skip next step if already have a Pinterest Business Account
Create a Pinterest Business Account
-
- You Must have a business Account if not you get this error, Create a Pinterest Business Account by clicking login in
-
- Click on Create
-
- Enter the Email, Password and Age and click Create Account
-
- Enter the Business Name, Website Address, Country and Language and click Next
-
- Describe your business and click Next
-
- Select the Ads Preference and your Business Account Created
-
- Follow Step 2 for App Creation
- Create a developer Account if you don’t have one
-
- Login to Developer Pinterest with a Business Account
- Click see Terms
-
-
-
-
- Accept the Terms
-
-
Steps Connect/Create an App in Pinterest
- Click on Connect App.
- Fill in the Details and upload the App Icon Image.
- Enter App purpose, Use case and s, Audience and click Submit
- It will take 24 – 48 hours to get App Approved.
- After Approval You Dashboard look Like this
- Once approved, be sure to complete your App profile by providing
-
- Technical Contact email – This will ensure you are Subscribed for updates.
- Redirect URIs – This will ensure you can get started with User Authorization as redirect_uri is a required field for OAuth.
- Go to Manage and Add Redirect URI
-
-
-
-
- Add Redirect URI and click Add
-
-
How to Find App Id and App Secret
- Go to the Dashboard
- Select the Manage
- Click on SHOW App secret key
- Copy the App ID and App Secret
Note: Client id and Client Secret are needed to complete Further Step
Authenticate your account & Token Generation
- Copy the authentication URL below into your browser’s address field.
https://www.pinterest.com/oauth/?client_id=12345678&redirect_uri=https://sprighub.ai/&response_type=code&scope=boards:read,pins:read,ads:read,user_accounts:read,catalogs:read
- client_id with your real App ID.
- callback_placeholder (after redirect_uri=) with your callback URL.
Example:
https://www.pinterest.com/oauth/?client_id=12345678&redirect_uri=https://sprighub.ai/&response_type=code&scope=boards:read,pins:read,ads:read,user_accounts:read,catalogs:read
- Click on Give access
- Copy the Code Part
- Check the browser address bar for the parameter code=XXXXXXXX
Example:
Note: The access code is valid for 10 minutes. Save the code for Step 6
- Open a terminal window and run the command shown below. In this command, replace client_id and client_secret with your real client ID and secret campaigns product. Save the output for Step 6.
echo -n [client_id]:[client_secret] | base64
Get the Client id and Client Secret From here
Example: Encode the String in base64
echo -n db405514becc4a028fc6f008aec0ccef:c1d7cdb2fb7644c0b142e179f315e1a4 | base64
Copy the output
- Run the command shown below to generate an access token. A valid token is required to make API requests
curl –location –request POST ‘https://api.pinterest.com/v5/oauth/token’ \
–header ‘Authorization: Basic MTQ3OTE2NjpkYTVjZTI3NTc3ZGI0OTlhZXXXXXXXXXXX’ \
–header ‘Content-Type: application/x-www-form-urlencoded’ \
–data-urlencode ‘grant_type=authorization_code’ \
–data-urlencode ‘code=abbcc24f99f172bXXXXXXXXXXXXXXXXXXX’ \
–data-urlencode ‘redirect_uri=https://sprighub.ai/’
In this command, replace:
- CODE_FROM_STEP_4 with the code from Step 4.
- BASE64_OUTPUT_FROM_STEP_5 with the code from Step 5.
Example:
curl –location –request POST ‘https://accounts.spotify.com/api/token’ \
–header ‘Authorization: Basic ZGI0MDU1MTRiZWNjNGEwMjhmYzZmMDA4YWVjMGNjZxxxxxxxxxxxxxxxxxxxxxxxxUxYTQ=’ \
–header ‘Content-Type: application/x-www-form-urlencoded’ \
–data-urlencode ‘code=AQCQ1vc2frQMVPwu2GIUUHXsOcZpng1VAeD7MH7XXXXXXXXXXXXXXXXXXXXXXXGtV8Eu2HdsxhLaGQhUZC1OhlFW’ \
–data-urlencode ‘redirect_uri=https://sprighub.ai/’ \
–data-urlencode ‘grant_type=authorization_code’
Response: We will Get a Refresh Token and Access Token in Response
*** Refresh Token is the required Attribute for the ETL Team ***
Leave a Reply