question

Daniel Vu avatar image
Daniel Vu asked ·

Does the Send Fax API accept application/json as the Content-Type?

I'm trying to send a fax using the RingCentral Create Fax REST API. I was able to use Postman to authorize my request and if I use multipart/form-data to send the fax, it works. However, my endgoal is to automate faxes through Salesforce using Apex code. Creating a multipart/form-data HTTP request is rather difficult in Apex, whereas it is trivial to set the body to JSON and send that request.


When I attempt to send an application/json request in Postman, the error that I get is "Invalid Parameter: Parameter [attachment] value is invalid". In my JSON, attachment is listed first; if I change "to" to be above "attachment" in the JSON, it just says parameter "to" is invalid.


I'm wondering if the Create Fax API supports that data format at all or if I'm just misconfiguring Postman.


Thank you,


For reference...

This is the HTTP representation of the request I am trying to make. (Attachment is just a PDF that says "Test Fax", nothing confidential)

POST /restapi/v1.0/account/~/extension/~/fax HTTP/1.1
Host: platform.devtest.ringcentral.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer INSERT_BEARER_TOKEN

{
    "attachment": "data:application/pdf;name=Test%20Fax.pdf;base64,JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGVj70OwjAMhPc8xfFTcAZSJ02UsoJY2Cp5g06RGJA6VHl/iTQVAyPy4PPpdPo8Y8CM9potUgbXyalYbJxf70VYb2zsEPpozn1EmnARhDVelvPOMHMJsFUyoRVxsJAXHqCNxolNB9rq0upBu2pY0L75qkMVAXR8ksYIueMmakH7i8NzNL5S4IeCGq3kXSrLt8MHYJgwsgplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKMTUxCmVuZG9iagoyIDAgb2JqCjw8IC9UeXBlIC9QYWdlIC9QYXJlbnQgMyAwIFIgL1Jlc291cmNlcyA2IDAgUiAvQ29udGVudHMgNCAwIFIgL01lZGlhQm94IFswIDAgNjEyIDc5Ml0KPj4KZW5kb2JqCjYgMCBvYmoKPDwgL1Byb2NTZXQgWyAvUERGIC9UZXh0IF0gL0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wMDI2NiAwMDAwMCBuIAowMDAwMDAzMjM5IDAwMDAwIG4gCjAwMDAwMDAwMjIgMDAwMDAgbiAKMDAwMDAwMDI0NyAwMDAwMCBuIAowMDAwMDAwMzcwIDAwMDAwIG4gCjAwMDAwMDMyMDMgMDAwMDAgbiAKMDAwMDAwMDAwMCAwMDAwMCBuIAowMDAwMDAzMzcyIDAwMDAwIG4gCjAwMDAwMDA0NjcgMDAwMDAgbiAKMDAwMDAwMzE4MiAwMDAwMCBuIAowMDAwMDAzMzIyIDAwMDAwIG4gCjAwMDAwMDM5MzAgMDAwMDAgbiAKMDAwMDAwMzU2MiAwMDAwMCBuIAowMDAwMDAzOTEwIDAwMDAwIG4gCjAwMDAwMDQxNjYgMDAwMDAgbiAKMDAwMDAxMjg3NyAwMDAwMCBuIAowMDAwMDEyODk4IDAwMDAwIG4gCjAwMDAwMTI5NDMgMDAwMDAgbiAKMDAwMDAxMzAxOSAwMDAwMCBuIAowMDAwMDEzMDQyIDAwMDAwIG4gCjAwMDAwMTMwODQgMDAwMDAgbiAKMDAwMDAxMzEwMyAwMDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDI0IC9Sb290IDEyIDAgUiAvSW5mbyAxIDAgUiAvSUQgWyA8ZmU5ZTYwMjMxMDhlMWI3ZmM4YzI2NTgxMGQ5NDk2NTA+CjxmZTllNjAyMzEwOGUxYjdmYzhjMjY1ODEwZDk0OTY1MD4gXSA+PgpzdGFydHhyZWYKMTMyNjcKJSVFT0YK",
    "to": [
        "***********"
    ]
}


faxfax out
1 comment
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

For reference, here are some articles on how to create a multipart/form-data request in Apex. Hopefully people can see some of the complexities and see why it'd be nice if this API supported a JSON body.


https://blog.enree.co/2013/01/salesforce-apex-post-mutipartform-data.html#finalCode_multipart

https://salesforce.stackexchange.com/questions/24108/post-multipart-without-base64-encoding-the-body/33326#33326

http://www.fishofprey.com/2017/04/steps-required-to-support-posting.html

0 Likes 0 · ·

1 Answer

· Write an Answer
Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered ·

First of all in an api, attachment and body are not same.. if you send any data as an attachment, it will not go through body.. it will be attached with the payload as file content.. if you send any data as body it will not consider it as attachment as it's the payload itself.. so in your case, you are sending as json body as json payload which it will not consider as file content attachment

Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.