BUG - SDK Client pin creation fails but endpoint is working
@dfana01 がすでに取り組んでいます。
2025年3月20日 から。
評価
この issue はまだ評価されていません。
説明
Describe the bug
I'm able to create pins using the python requests package and endpoint provided in the Pinterest API docs but when I try using the SDK I get permissions error.
To Reproduce
Unsuccessful using SDK:
from pinterest.client import PinterestSDKClient
from pinterest.organic.pins import Pin
PinterestSDKClient.set_default_access_token(<token>)
params = {
"board_id": <board_id>,
"ad_account_id": <ad_account>,
"description": <description>,
"link": <link>,
"title": <title>,
"media_source":{
'source_type':'image_base64',
'data': <image>,
'content_type':"image/png"
}
Pin.create(**params)
The above returns the following error:
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Content-Length': '38', 'pinterest-version': 'c7fe355', 'x-content-type-options': 'nosniff', 'x-frame-options': 'DENY', 'Access-Control-Allow-Credentials': 'true', 'p3p': 'CP="Pinterest does not have a P3P policy. You can find our privacy policy at https://www.pinterest.com/_/_/policy/privacy-policy."', 'x-envoy-upstream-service-time': '83', 'pinterest-generated-by': 'tpp-api-canary-0a0308c3', 'X-RateLimit-Limit': '100, 100;w=1, 1000;w=60', 'X-RateLimit-Remaining': '99', 'X-RateLimit-Reset': '1', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'x-pinterest-rid': '6639680265060241', 'Date': 'Tue, 14 May 2024 16:13:42 GMT', 'Alt-Svc': 'h3=":443"; ma=600', 'Connection': 'keep-alive', 'Set-Cookie': '_ir=0; Max-Age=1800; HttpOnly; Path=/; Secure', 'AKAMAI-GRN': '0.de6533b8.1715703222.1e8acbde', 'X-CDN': 'akamai'})
HTTP response body: {"code":50,"message":"Pin not found."}
The following python request works
import requests
params = {
"board_id": <board_id>,
"ad_account_id": <ad_account>,
"description": <description>,
"link": <link>,
"title": <title>,
"media_source":{
'source_type':'image_base64',
'data': <image>,
'content_type':"image/png"
}
auth = {'Authorization': 'Bearer {}'.format(<token>)}
auth["Content-Type"] = "application/json"
pin = requests.post('https://api.pinterest.com/v5/pins', json=params, headers=self.auth).json()
Screenshot of response using above method:
Additional Details:
- MacOS Sonoma 14.3 M1 chip
- pinterest-api-sdk==0.2.1
- 主要言語
- Python
- スター
- 84
- フォーク
- 41
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pinterest/pinterest-python-sdk のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
-
BUG - <AdGroup for Retargeting Campaign Throws Value Error on init>再び着手できるかも @dfana01 が 582 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
pinterest/pinterest-python-sdk#144 · 担当者 1 名 ·
-
AttributeError: 'BoardSection' object has no attribute '_generated_api_get_fn_args'再び着手できるかも @dfana01 が 582 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
pinterest/pinterest-python-sdk#130 · 担当者 1 名 ·
pinterest/pinterest-python-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
MISP/misp-workbench#496 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
fossasia/visdom-dev#69 ·
メンテナーはふだん 3 日以内に返信
-
[Bug] Parameters named like a property break to_xcal()対応中かも @atharvasalunke1267 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
collective/icalendar#2018 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信