1

调用 RingCentral Create Custom Greeting API 时:

POST /restapi/v1.0/account/{accountId}/extension/{extensionId}/greeting

对于较大的文件 MP3 和 WAV 媒体文件,我有时会收到以下错误。有官方尺寸限制吗?

HTTP/1.1 413 Request Entity Too Large

{
    "errorCode": "AGW-413",
    "message": "Request entity too large",
    "errors": [

    ]
}

API 参考或博客文章中没有指定限制:

API参考:

https://developers.ringcentral.com/api-docs/latest/index.html#!#RefCreateUserCustomGreeting

我正在使用带有以下代码的ringcentral_sdkgem :

req = RingCentralSdk::REST::Request::Multipart.new(
  method: 'post',
  url: 'account/~/extension/~/greeting'
).
add_json({type: 'Voicemail', answeringRule: {id: '11111111'}}).
add_file(file)

res = client.send_request req

puts res.status
puts MultiJson.encode(res.body, pretty: true)

更多内容在这篇博客文章中:

https://medium.com/ringcentral-developers/updating-ringcentral-user-extension-greetings-using-the-rest-api-and-ruby-db325022c6ee

4

2 回答 2

1

我被告知此 API 目前有 1MB 的文件大小限制。

我在这里用 0.4MB 和 2.5MB WAV 文件对此进行了测试,并确认较小的文件有效,而较大的文件导致了此错误。

其他有用的测试文件似乎在这里可用:

于 2018-03-30T00:22:31.853 回答
1

我写了一个 Python 示例:https ://github.com/tylerlong/ringcentral-python/blob/master/test/test_multipart_mixed.py

我还确认,如果音频文件太大,操作将失败,您将收到消息Request entity too large

于 2018-04-02T01:47:17.257 回答