faxringcentral

How to test RingCentral Fax API without sending to real fax machine?


Is it possible to test sending a fax with the RingCentral Fax API without sending a fax to a real fax machine?


Solution

  • The RingCentral sandbox account let's you set up multiple phone numbers and users, like a production account. If you want to test sending a fax in the sandbox without sending to a real fax number, you can simply create two sandbox fax numbers and send from one number to the other.

    A user can have multiple numbers but, for testing purposes, I like to use different users so it better simulates sending from one user to another.

    Creating a User and Phone Number

    You can create a user in RingCentral by following the instructions here for the Sandbox Online Account Portal (https://service.devtest.ringcentral.com). You will also be prompted to select a phone number for this user. For a phone, selecting the free soft phone is useful for testing purposes.

    https://success.ringcentral.com/articles/RC_Knowledge_Article/5-10-Adding-Extensions-via-Web

    Verifying the User and Phone Number

    After this, you will see this user and phone number in the Online Account Portal. You can also verify numbers via the API. When you call the account extension endpoint, you should see at least 2 extensions (the original one and your new one).

    GET https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension
    

    You can then login as the new user and verify the fax numbers by calling the endpoint below:

    GET https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/phone-number
    

    The phone number array will include a list of numbers with the following JSON property:

    "type": "VoiceFax",
    

    Sending the Fax

    When you have two extensions, one of which can be your super user extension, you can send from one number to the other. Simply login as one user and send to the the VoiceFax number of the other user:

    POST /restapi/v1.0/account/~/extension/~/fax HTTP/1.1
    Content-Type: multipart/mixed; boundary=Boundary_1_14413901_1361871080888
    
    --Boundary_1_14413901_1361871080888
    Content-Type: application/json
    
    {"to":[{"phoneNumber":"+16505550100"}],
     "faxResolution":"High",
     "country" : {
        "isoCode" : "IE"
      },
     "sendTime":"2013-02-26T09:31:20.882Z"}
    
    --Boundary_1_14413901_1361871080888
    Content-Disposition: attachment; filename="fax.txt"
    
    Hello, World!
    
    --Boundary_1_14413901_1361871080888--
    

    Verifying the Fax

    You can verify receipt of the fax via the API, Online Account Portal or Softphone application.