質問編集履歴

1

def get_account_info を追記

2021/05/24 01:06

投稿

Yuta25jp
Yuta25jp

スコア13

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  PythonのフレームワークDjangoを用いてウェブアプリを開発しています。
6
6
 
7
- そこで、json_dataとbusiness_discoveryを並べているソースコード6行目に関して該当のエラーがでました。
7
+ そこで、json_dataとbusiness_discoveryを並べている、def getの6行目に関して該当のエラーがでました。
8
8
 
9
9
  エラーで記述している、オーバーロードに関するリファレンスが少なく、苦戦しております。
10
10
 
@@ -29,6 +29,38 @@
29
29
 
30
30
 
31
31
  ```Python
32
+
33
+
34
+
35
+
36
+
37
+ def get_account_info(params):
38
+
39
+ # エンドポイント
40
+
41
+ # https://graph.facebook.com/{graph-api-version}/{ig-user-id}?fields={fields}&access_token={access-token}
42
+
43
+
44
+
45
+ endpoint_params = {}
46
+
47
+ # ユーザ名、プロフィール画像、フォロワー数、フォロー数、投稿数、メディア情報取得
48
+
49
+ endpoint_params['fields'] = 'business_discovery.username(' + params['ig_username'] + '){\
50
+
51
+ username,profile_picture_url,follows_count,followers_count,media_count,\
52
+
53
+ media.limit(10){comments_count,like_count,caption,media_url,permalink,timestamp,media_type,\
54
+
55
+ children{media_url,media_type}}}'
56
+
57
+ endpoint_params['access_token'] = params['access_token']
58
+
59
+ url = params['endpoint_base'] + params['instagram_account_id']
60
+
61
+ return [call_api(url, endpoint_params)]
62
+
63
+
32
64
 
33
65
  def get(self, request, *args, **kwargs):
34
66