Issue with RingCentral Fax API using MBS Plugin – JSON Response Received, but Fax Not Processed

I'm using the MBS Plugin to make a call to the RingCentral Fax API. While I am getting a valid JSON response back, the fax is not being processed by RingCentral.

However, when I run the same API call through Terminal or via a script (without using the MBS Plugin), the fax gets processed successfully.

Has anyone experienced a similar issue with the MBS Plugin when interacting with RingCentral? Any suggestions on what could be causing this or how to troubleshoot?

Can you log the call with Terminal with headers for inspection?
And also get debug messages from our plugin to compare?

Probably some little header setting is missing.

Call with terminal:

curl -X POST
"https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/fax"
-H "Authorization: Bearer U0pDMDFQMDdQQVMwMHxBQUN0TGd6WDZIZFRja19UcHNJenFLQ1ROSDZWRnA5dV83QjBiT0FOOHd0MVAyY2FPd0pnR0NtR1RfdGJxZjBDNkRoZ1c1Vk5jZm9wM0RtNWdkdzcwTzU0cGVIcTAyUTE3LWk2N1VDa2dWak9ubnFFSXhyMTNTNkxnR1BUZ0dMRU1VSjViaUVZV1FreEp5X3doaUQwYzFIY21yRnZRX0FNSy1vUVF1VENZb0owV0hHbFJIT0p1Sk9PMklnQkstYzhOaE55Z09ZbDI3NTdLMmVsaGhFbHhMcTF8WUp2aWhnfGhMdHJMVzFBTlRRVXVsX3F0VlJ1THd8QVF8QUF8QUFBQUFOT3k2UlE"
-H "Content-Type: multipart/form-data"
-F "to=+16502413764"
-F "faxResolution=High"
-F "coverPageText=Please see the attached document."

{
"uri" : "https://platform.ringcentral.com/restapi/v1.0/account/290613016/extension/290613016/message-store/2775834792016",
"id" : 2775834792016,
"to" : [ {
"recipientId" : "5296243489016",
"phoneNumber" : "+16502413764",
"location" : "Redwood City, CA",
"messageStatus" : "Queued"
} ],
"from" : {
"phoneNumber" : "+12101201022",
"location" : "Dallas, TX"
},
"type" : "Fax",
"creationTime" : "2024-10-18T13:57:33.000Z",
"readStatus" : "Unread",
"priority" : "Normal",
"attachments" : [ {
"id" : 2775834792016,
"uri" : "https://media.ringcentral.com/restapi/v1.0/account/290613016/extension/290613016/message-store/2775834792016/content/2775834792016",
"type" : "RenderedDocument",
"contentType" : "application/pdf"
} ],
"direction" : "Outbound",
"availability" : "Alive",
"messageStatus" : "Queued",
"faxResolution" : "High",
"faxPageCount" : 0,
"lastModifiedTime" : "2024-10-18T13:57:33.580Z",
"coverIndex" : 7,
"coverPageText" : "Please see the attached document."
}%

filemaker debug MBS Plugin 13.3.0.08 with CURL 8.1.2 in FileMaker Pro Advanced 20.3 on macOS.

MBS Plugin with maintenance expired.
Trying 66.81.247.238:443...
Connected to platform.ringcentral.com (66.81.247.238) port 443 (#0)
ALPN: offers http/1.1
TLSv1.3 (OUT), TLS handshake, Client hello (1):
TLSv1.3 (IN), TLS handshake, Server hello (2):
TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
TLSv1.3 (IN), TLS handshake, Certificate (11):
TLSv1.3 (IN), TLS handshake, CERT verify (15):
TLSv1.3 (IN), TLS handshake, Finished (20):
TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
TLSv1.3 (OUT), TLS handshake, Finished (20):
SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
ALPN: server accepted http/1.1
Server certificate:
subject: CN=*.ringcentral.com
start date: Feb 15 00:00:00 2024 GMT
expire date: Feb 14 23:59:59 2025 GMT
issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=Thawte TLS RSA CA G1
SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
using HTTP/1.1
GET /restapi/v1.0/account/~/extension/~/fax HTTP/1.1
Host: platform.ringcentral.com
Authorization: Bearer U0pDMDFQMDdQQVMwMHxBQUNncml0Q3NkNGFXY3lTLVFPc1VQMnZKOWJpbDBJRGJOb0NrNHUteE9rbTh4Y2NBZ05rYWVXbUVrRnB0c1M1cHNRU0szNUlqdjhyZVVQdzhaRFgzSnE2UzBVR0dQV2J6R2EyVi1GQjZTalhXQ2EzWG9LLWpGdHNXQkVRSDB3bjR5a1Z6NzBjSzg5emYzcHBEZmNXb2lxaUxMSWFLaG1ySUpmREswcGtFeE5DNHFLM2xWYjc3SmhLVHNEYVVnUEdtWEhMZktoZ1dCZE5XUE9uY2cwLXY0bU58WUp2aWhnfHN3eUdvRkszM2FyaHNfZ05NeTN5LWd8QVF8QUF8QUFBQUFFbU1oXzg
Accept: application/json

TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
old SSL session ID is stale, removing
HTTP/1.1 200 OK
Date: Fri, 18 Oct 2024 13:59:47 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
RCRequestId: 3c83df7e-8d59-11ef-916d-0050568ccf8c
RoutingKey: SJC01P07PAS05
Content-Language: en-US
Vary: Accept-Encoding, User-Agent
X-Rate-Limit-Group: light
X-Rate-Limit-Limit: 50
X-Rate-Limit-Remaining: 49
X-Rate-Limit-Window: 60
CF-Cache-Status: DYNAMIC
Set-Cookie: __cf_bm=cdAkc23qMnV5qMP3Pyg3_84EgqGVgqa9jEUsz3UB_g4-1729259987-1.0.1.1-fTESbmxE46UvQDkN2uUbhBFtBmWPtLqybIs1L9kQfYVFz3kuRXu1DYY_MOAt1K6JRgnorzYUjK7ENj6KUdLvOA; path=/; expires=Fri, 18-Oct-24 14:29:47 GMT; domain=.platform.ringcentral.com; HttpOnly; Secure
Server: cloudflare
CF-RAY: 8d490d0be8254868-DFW

Connection #0 to host platform.ringcentral.com left intact
MBS Plugin with maintenance expired.

Well, you do a GET with the plugin. I don't see you use PostFields or form functions.

MBS( "CURL.FormAddKeyValue"; $curl; "to"; "+16502413764" )
MBS( "CURL.FormAddKeyValue"; $curl; "faxResolution"; "High" )
MBS( "CURL.FormAddKeyValue"; $curl; "coverPageText"; "Please see the attached document." )
MBS( "CURL.FormFinish"; $curl )

So you'd use CURL.FormAddKeyValue and CURL.FormFinish functions to build the form values before the CURL.Perform call.

![Screenshot 2024-10-18 at 10.26.27 AM|690x487](upload://xqmab4wwmBEvgBKOa3dpUTK1l15.png

I am trying to get the fax sent over with an attachment but can not seems to make it happen do you have any tips here?

What does CURLDebugMessages say?
Do all functions return OK? Did you do a trace log?

And after CURL.Perform, you could write CURL.GetFormData to a text file and see if the values and the PDF are included.

(And maybe provide me as download to inspect?)

I am not sure what a trace log is.
Thank you for your reply, the CURL.GetFormData is not returning anything. It is blank.

I do not know how to provide a download either. Here is what came out of the Debug script step.

MBS Plugin 13.3.0.08 with CURL 8.1.2 in FileMaker Pro Advanced 20.3 on macOS.

MBS Plugin with maintenance expired.
Trying 66.81.247.238:443...
Connected to platform.ringcentral.com (66.81.247.238) port 443 (#0)
ALPN: offers http/1.1
TLSv1.3 (OUT), TLS handshake, Client hello (1):
TLSv1.3 (IN), TLS handshake, Server hello (2):
TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
TLSv1.3 (IN), TLS handshake, Certificate (11):
TLSv1.3 (IN), TLS handshake, CERT verify (15):
TLSv1.3 (IN), TLS handshake, Finished (20):
TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
TLSv1.3 (OUT), TLS handshake, Finished (20):
SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
ALPN: server accepted http/1.1
Server certificate:
subject: CN=*.ringcentral.com
start date: Feb 15 00:00:00 2024 GMT
expire date: Feb 14 23:59:59 2025 GMT
issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=Thawte TLS RSA CA G1
SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
using HTTP/1.1
POST /restapi/v1.0/account/~/extension/~/fax HTTP/1.1
Host: platform.ringcentral.com
Authorization: Bearer U0pDMDFQMDdQQVMwMHxBQUJIdVJHYXNnXzJpcEhCOUtIOXk1Mm5VM2VRTkZHMTUwdjM1bi1teDRaa0diWm05MEp5RHJFZWRnakxVMUQwNU1LcXduYktjc2J3TFdkWUpsbkdxa0Rvd2paSVlRXzZKZlMzQnpKcHkzWTd4aHd1bkJOdjBmcVNsVGVnZWhJeVNWZjgzTEVqdHpKYTAtRmd6M0IyUldIOHJmLU5RWFE0T0lvZEpwRHRSYnhkNEJ1RWJ5YXo3TzFQTEtKYVREWUJ3SktuMXdDVDVOZVZxbFpFeVZpUE1iay18WUp2aWhnfE9xVk1wdFhqWThtN2dQS21HWWY5bVF8QVF8QUF8QUFBQUFDUmp3UTQ
Accept: application/json
Content-Length: 477
Content-Type: multipart/form-data; boundary=------------------------916ccb929639929d

We are completely uploaded and fine
TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
old SSL session ID is stale, removing
HTTP/1.1 200 OK
Date: Fri, 18 Oct 2024 21:43:59 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
RCRequestId: 1530e1e2-8d9a-11ef-884d-0050568c5028
RoutingKey: SJC01P07PAS05
Content-Language: en-US
Vary: Accept-Encoding, User-Agent
X-Rate-Limit-Group: heavy
X-Rate-Limit-Limit: 10
X-Rate-Limit-Remaining: 9
X-Rate-Limit-Window: 60
CF-Cache-Status: DYNAMIC
Set-Cookie: __cf_bm=GABsVXHo89eS763DoUHeh.5ky0wdP8femFP_YqJ_fqs-1729287839-1.0.1.1-955GVU9HEk4EEU6smYmJJzj_QWP.sJ039A1.VinTHO8ZpnlfcvBPBigSt82V4ANk3p4BPL.UdXlxGcQ6LUom7A; path=/; expires=Fri, 18-Oct-24 22:13:59 GMT; domain=.platform.ringcentral.com; HttpOnly; Secure
Server: cloudflare
CF-RAY: 8d4bb502aebfe82b-DFW

Connection #0 to host platform.ringcentral.com left intact
MBS Plugin with maintenance expired.

Well, you can send me a test database with the script to try here.

Or you Trace function to have it log all calls to a log file.

Content-Length: 477

this may point to the file not being included. e.g. if the fee path is not right.

I usually put in my server URL in

https://www.monkeybreadsoftware.de/filemaker/echo.cgi

which will return what is output.
Also you could of course try a current version of the plugin in case there was a bug last year.

Result #4: "OK"

MBS Plugin call #5 with 1 parameter.
Parameter 0 FunctionName: "Trace.Off"
Result #9: "OK"

MBS Plugin call #10 with 2 parameters.
Parameter 0 FunctionName: "CURL.Cleanup"
Parameter 1 curl: "16006"
Result #10: "OK"

MBS Plugin call #11 with 1 parameter.
Parameter 0 FunctionName: "CURL.New"
Result #11: "16007"

MBS Plugin call #12 with 3 parameters.
Parameter 0 FunctionName: "CURL.SetOptionURL"
Parameter 1 curl: "16007"
Parameter 2 URL: "https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/fax"
Result #12: "OK"

MBS Plugin call #13 with 3 parameters.
Parameter 0 FunctionName: "CURL.SetOptionHTTPHeader"
Parameter 1 curl: "16007"
Parameter 2 Values...: "Authorization: Bearer U0pDMDFQMDdQQVMwMHxBQUJMYWc1NVJMa0RDZnBaQlk5SzU0akp6OVF6QTcxa2lDTzZmc2x3bjVnWTA0UmZvdjIxZjVmUGUtY2dSaWVjcVRCcHNLYkNaZXlQVWk0b0d6blVtQ1g1ME5MeTNvT2xsNFF4YmlrNnU0ZDBuaUNBZDc2bmxpbkQ3QUlnaTFfYmhyZnJSemQ4d3BnUkdDblBnbnQ2ZmYwWXgtWjFISGhTWjJQWW5JcjVDRGZGaWRyQS03SkVoSWxfU0tKV0NBUkhSRGEtTGRTemFKQ1lqd1hQdDJBVWRIeVF8WUp2aWhnfEx2Mm1iV1Q5TjZjYzlJWjBoUmxGbnd8QVF8QUF8QUFBQUFHNUthU1E
Accept: application/json"
Result #13: "OK"

MBS Plugin call #14 with 4 parameters.
Parameter 0 FunctionName: "CURL.FormAddKeyValue"
Parameter 1 curl: "16007"
Parameter 2 Name: "to"
Parameter 3 Value: "+12142202022"
Result #14: "OK"

MBS Plugin call #15 with 4 parameters.
Parameter 0 FunctionName: "CURL.FormAddKeyValue"
Parameter 1 curl: "16007"
Parameter 2 Name: "coverPageText"
Parameter 3 Value: "Hello World -Dev Team"
Result #15: "OK"

MBS Plugin call #16 with 4 parameters.
Parameter 0 FunctionName: "CURL.FormAddKeyValue"
Parameter 1 curl: "16007"
Parameter 2 Name: "faxResolution"
Parameter 3 Value: "Low"
Result #16: "OK"

MBS Plugin call #17 with 4 parameters.
Parameter 0 FunctionName: "CURL.FormAddKeyValue"
Parameter 1 curl: "16007"
Parameter 2 Name: "coverIndex"
Parameter 3 Value: "2"
Result #17: "OK"

MBS Plugin call #18 with 5 parameters.
Parameter 0 FunctionName: "CURL.FormAddFile"
Parameter 1: "16007"
Parameter 2: "attachment"
Parameter 3: Binary Data with 5 streams, 19676 Bytes in total: FNAM "image:DevTest.pdf", MAIN "PDF ", PDF "%PDF-1.3.%Äåòåë§ó ÐÄÆ.3 0 obj.<< /Filter /FlateDecode /Length 2177 >>.stream.x.¥YێÛF.}çWTÞ(`ÌáM¼.A€", PNGf "‰PNG........IHDR...d.........e†û²....sRGB.®Î.é...DeXIfMM.*......‡i................ ........... .....", SIZE 612 x 792
Parameter 4: "application/pdf"
Result #18: "[MBS] Unknown function: CURL.FormAddFile. Did you mean CURL.FormAddKeyFile?"

MBS Plugin call 19 with 2 parameters.
Parameter 0 FunctionName: "CURL.FormFinish"
Parameter 1 curl: "16007"
Result #19: "OK"

MBS Plugin call #20 with 2 parameters.
Parameter 0 FunctionName: "CURL.Perform"
Parameter 1 curl: "16007"
Result #20: "OK"

In Result #18: "[MBS] Unknown function: CURL.FormAddFile. Did you mean CURL.FormAddKeyFile?”

I will try The CURL.FormAddKeyFile and see what happens

Now the fax is not sending ….

CURL.FormAddKeyFile is the right function name.

2 Likes

Thank you so much Christian !!! YOU ARE THE MAN!
CURL.FormAddKeyFile, was the right function!

1 Like