question

alan-kimelman-md8019 avatar image
alan-kimelman-md8019 asked Phong Vu answered

How do I name an attached pdf document with a name differing from its file path name, using a curl script?

How do I name an attached pdf document with a name differing from its file path name, using a curl script?

A curl example formulated at https://developers.ringcentral.com/api-reference/Fax/createFaxMessage yields the following data string:

--data '{
   "attachment":"data:application/pdf;name=A%20different%20name.pdf;base64,<<base64>>","to":["1234567890"] }'.


I created a curl data post, which delivered a fully rendered pdf, but without a new name using the following string:

"-F \"attachment=@$PDF_Container_Field;name=A%20different%20name.pdf;type=application/pdf\" -F \"to=" & $toRecipientTenDigit & "\" "


As an aside, regarding my not using base64 encoding, my script is executed via FilemakerPro via "insert from url" with curl options. I guess that base64 encoding occurs when a curl option -F is streamed via Filemaker's "insert from url" command, as the script delivers a fully rendered pdf.

Question:

What might be correct curl syntax possibilities to simulate the syntax found in the curl command generated at developers.ringcentral.com/api-reference/Fax/createFaxMessage?


rest api
1 |1500 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.

1 Answer

Phong Vu avatar image
Phong Vu answered

What is the reason you want to change the file name? Is it the big impact for your project? As for sending Fax using curl, check out the discussion on this thread.

1 |1500 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.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys