キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
523
閲覧回数
0
いいね!
0
返信

Service AppからWebex callingのCDR情報が取得出来ません。

kozaka
Level 1
Level 1

ご質問させて頂きます。
Webex callingのCDR情報をService AppよりAPIを使って取得したいと思っていますが動作しません。
原因究明のため、管理者権限を持ったユーザでWebex for Developersサイトより試すと、こちらは動作しました。

サイト
https://developer.webex.com/docs/api/v1/webex-calling-detailed-call-history/get-detailed-call-history
startTime:2023-07-13T00:00:00.000Z
endTime :2023-07-13T10:00:00.000Z
locations:なし
max :なし

結果
{
"items": [
{
"Answer time": "2023-07-13T04:45:27.508Z",
"Answered": "true",
"Direction": "ORIGINATING",
"Called line ID": "xxxxxxxxxxxxxxx",
"Call ID": "xxxxxxx",
"Calling line ID": "NA",
"Start time": "2023-07-13T04:45:25.563Z",
"Call type": "SIP_ENTERPRISE",
 :

また、PythonよりDevelopersサイトで生成されたURLとアクセストークンを使うと正しく動作します。

url ='https://analytics.webexapis.com/v1/cdr_feed?startTime=2023-07-13T00%3A00%3A00.000Z&endTime=2023-07-13T10%3A00%3A00.000Z'
header = {}
header['Authorization'] = f'Bearer {Developersサイトからトークンをコピペ}'
res = requests.get(url, headers=header, verify=False)

しかし、Service Appで試すと以下のとおり結果が異なります。権限が無いように見えます。

url ='https://analytics.webexapis.com/v1/cdr_feed?startTime=2023-07-13T00%3A00%3A00.000Z&endTime=2023-07-13T10%3A00%3A00.000Z'
header = {}
header['Authorization'] = f'Bearer {サービスAPPで生成したトークン}'
res = requests.get(url, headers=header, verify=False)

エラーメッセージ
status:401
'{"message":"User does not have authorized roles.","errors":[{"errorCode":401}],
 "trackingId":"CdrReports_1f388d57-f1bd-4eaa-a8e5-f992588xxxxxx"}'

Service Appは以下のスコープを付与しています。同じアクセストークンでUser一覧は取得可能です。
※spark-admin:calling_cdr_readがあれば良いと認識しています。

 scopes:
  * spark-admin:calling_cdr_read
  * spark-admin:people_read
  * spark-admin:telephony_config_read
  * spark-admin:telephony_config_write
  * spark:kms

以下、ユーザ一覧を取得のURLです。これは動作します。
url = 'https://webexapis.com/v1/people'
header = {}
header['Authorization'] = f'Bearer {サービスAPPで生成したトークン}'
res = requests.get(url, headers=header, verify=False)

どのような原因が考えられるでしょうか。アドバイス頂きたく宜しくお願いします。

0件の返信0