0

我正在尝试使用 StitchData Connect API 为 Zuora 创建连接源。

这段代码有什么问题?

我收到 HTTP 状态码 500

def src_create_zuora_conn(self):
  USER_AGENT = 'myagent/0.0.1'
  url = "https://api.stitchdata.com/v4/sources"
  data = {
   'type': 'platform.zuora',
   'display_name': 'Zuora-Test',
   'properties': {
   'start_date':  '2021-03-01T00:00:00Z',
   'anchor_time': '2021-04-23T00:00:00Z',
   'european': 'false',
   'frequency_in_minutes': '1440',
   'username': 'zuora-integration@some.com',
   'password': 'xxx-xxx-xxx-xxx',
   'sandbox': 'false'
   }
 }

 headers = {
    'User-Agent': USER_AGENT,
    'Authorization': 'Bearer <my-api-key>',
    'Content-Type': 'application/json'
 }

 try:
    r = requests.post(url, data=data, headers=headers)
    print('status_code: ' + str(r.status_code))
 except Exception as e_src_create:
    error_msg = "Failure to create source for Zuora"
    self.handle_error(self.exit_on_fail, error_msg, e_src_create)
 finally:
   pass
4

0 回答 0