question

dat-le avatar image
dat-le asked ·

Get an error when trying to resend a fax through API

Can't resend a fax.  I get the below message in the ErrorResponseBody

{
  "errorCode" : "InvalidParameter",
  "message" : "Parameter [originalMessageId] value is invalid",
  "errors" : [ {
    "errorCode" : "CMN-101",
    "message" : "Parameter [originalMessageId] value is invalid",
    "parameterName" : "originalMessageId"
  } ],
  "parameterName" : "originalMessageId"
}

topic-default
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.

Tyler Liu avatar image
Tyler Liu answered ·
Which API endpoint are you invoking? Could you please post some code?
4 comments 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.

I am using the ringcentral-csharp-client SDK.

Here is the code that fails upon trying to resend a fax. I already get the token for the RestClient prior to calling this method

       private async Task<MessageInfo> ResendFax(RestClient rc, string messageId)
        {
            var extension = rc.Restapi().Account().Extension();
            
            return await extension.Fax()
                .Post(new FaxPath.PostParameters()
                {
                    originalMessageId = messageId
                }, new List<Attachment>());
        }

It is a valid message id as I can get the call log for it via

                var extension = _restClient.Restapi().Account().Extension();
                return extension.MessageStore(requestId).Get().Result;


0 Likes 0 · ·
Frankly speaking, I have never tried resending fax. Let me take a look.
0 Likes 0 · ·
It turns out that send fax is multipart/mixed while resend fax is application/json. So you cannot reuse the send fax code to resend fax.

Please try the following:

var messageInfo = rc.Post<MessageInfo>(Restapi().Account().Extension().Fax().Endpoint(), new { originalMessageId = messageId });



0 Likes 0 · ·
Thanks! That worked for me, with the exception of small change

rc.Post<MessageInfo>( rc.Restapi().Account().Extension().Fax().Endpoint(),
                new {originalMessageId = messageId});

0 Likes 0 · ·
Ramakrishna Reddy G avatar image
Ramakrishna Reddy G answered ·

How can we get messageId in Fax call?.

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

This is the response after you send a fax message:

HTTP 200 OK

{
  "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/691748004/extension/691748004/message-store/1277646004",
  "id" : 1277646004,
  "to" : [ {
    "phoneNumber" : "+18774880001",
    "messageStatus" : "Queued"
  }, {
    "phoneNumber" : "+18004778345",
    "messageStatus" : "Queued"
  } ],
  "type" : "Fax",
  "creationTime" : "2016-06-14T13:38:06.000Z",
  "readStatus" : "Unread",
...

The id is the messageId you are looking for. See more from the API reference


0 Likes 0 · ·

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.