本文中的信息适用于付费 Dropbox Fax 套餐的客户。
注意:Dropbox Fax 端点已从 v1 更改为 v3。我们将不再维护 v1 端点。详细了解如何迁移到新的 v3 端点,以及这对开发人员有何好处。
本文介绍了如何使用 v1 端点设置 Dropbox Fax API、确保其正常运行以及如何在需要时购买其他传真线路。
如需开始使用 v1 端点:
curl -u "[your username]:[your password]" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]"
curl -u "myemail@hellofax.com:fakepassword" "https://api.hellofax.com/v1/Accounts/15da1c48b10c96a903eb1bac3d592fbed24ebc35"
curl "https://myemail%40hellofax.com:fakepassword%40api.hellofax.com/v1/Accounts/15da1c48b10c96a903eb1bac3d592fbed24ebc35"
响应将为您帐户设置的 JSON 形式。
curl -u"[your username]:[your password]" \ -d "DefaultInboundFaxCallbackUrl=https://www.example.com/inboundFax" \ -d "DefaultOutboundFaxCallbackUrl=https://www.example.com/outboundFax" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]"
注意:传入的传真将通过 POST 发送到您的回调 URL,因此您不需要单独检索。
curl -u "[your username]:[your password]" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]/FaxLines"
响应包括您在订阅高级套餐时选择的 FaxLine。
curl -u "[your username]:[your password]" \ "https://api.hellofax.com/v1/AreaCodes?StateCode=CA"
curl -u "[your username]:[your password]" \ -d "AreaCode=[area code from step 7]" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]/FaxLines"
curl -u "[your username]:[your password]" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]/Transmissions?To=[destination phone number]" \ -F "file=@myfile.pdf"
此操作将开始传真发送流程。收到 200 HTTP 响应并不能保证传真成功发送,此过程可能会出现文件转换错误。但是,传真 StatusCode 变为 E(错误)或 S(成功)时,您将通过第 4 步中提供的回调 URL 收到一个 POST。了解有关回调事件的更多信息。
可能的 StatusCode 值:
可能的 ErrorCode 值(仅在 StatusCode 设置为 E 时参考):
注意:
curl -u "[your username]:[your password]" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]/Transmissions?To=[destination phone number]&From=[your fax line phone number]" \ -F file=@myfile.pdf`
有关 "From" 值的格式,请参阅通过调用/FaxLines 返回的 "Number" 字段(请参阅上述第 5 步)。
curl -u "[your username]:[your password]" \ -F file[]="@1.pdf" -F file[]="@2.txt" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]/Transmissions?To=[phone number in all digits]"
curl -X POST https://[your username]:[your password]@api.hellofax.com/v1/Accounts/[Your Account GUID]/Transmissions -F 'file[0]=@file1.pdf' \ -F 'file[1]=@file2.pdf' \ -F 'To[0]=[destination fax number 0]' \ -F 'To[1]=[destination fax number 1]'
Error sending fax. Status: 429; Message: Please wait. You already have at least 200 transmissions that are currently pending or transmitting.
curl -u "[your username]:[your password]" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]/Transmissions/[Transmission GUID]"
curl -u "[your username]:[your password]" \ "https://api.hellofax.com/v1/Accounts/[Your Account GUID]/Transmissions"
如果服务器或网络问题导致 POST 回调不成功,Dropbox 将按以下时间间隔重试:
在每个间隔期内,如果未收到 200 响应代码,Dropbox 可能会多次尝试 POST。
curl -u "[your username]:[your password]" \ "https://api.hellofax.com/v1/Accounts/[Account GUID]/FaxLines"
curl -u "[your username]:[your password]" -X DELETE "https://api.hellofax.com/v1/Accounts/[Account GUID]/FaxLines/2132935579"
注意:此处存在一个已知错误,回调中的 JSON 包含 "Transaction" 而不是 "Transmission"。我们将在下一个版本的 API 中更正拼写错误。
有用,谢谢!
没什么用
请告诉我们为什么它没有帮助:
感谢您告诉我们!
谢谢您的意见!