RightFax Web API: Test with Postman and PowerShell (RightFax 10.6–21.2)

RightFax – Using Postman to Test Web API Submissions

RightFax – Using Postman to Test Web API Submissions

Applies to: RightFax 10.6, 16.2, 16.4, 16.6, 20.2, 21.2

Summary

The RightFax Web API enables integration with custom web applications. While custom development is outside Customer Support scope, Support can assist in verifying baseline API functionality.

This article explains how to:

  • Upload an attachment with Postman.

  • Submit a test fax with Postman.

  • Troubleshoot common Postman errors.

  • Use PowerShell to test Web API submissions.

Uploading an Attachment with Postman

Note: If an attachment is required, it must be uploaded before fax submission.

Steps:

  1. In Postman, click New.

  2. Select HTTP Request.

  3. Name the request and add it to a collection.

  4. Change the method from GET to POST.

  5. Enter the URL:

    http://<RightFax_Server_Name>/RightFax/API/Attachments
  6. Under Authorization, set Type to Basic Auth.

    • Tip: NTLM can be used if the account is NT-linked.

  7. Enter a valid RightFax User ID and Password.

  8. Under Body, choose form-data.

  9. Set the Key type to File and browse for the file.

  10. Click Send.

Result: A 201 Created response with an Attachment URL. Save this URL for fax submission.


Sending a Test Fax with Postman

Steps:

  1. In Postman, create a new HTTP Request.

  2. Name and save it to a collection.

  3. Change the method to POST.

  4. Enter the URL:

    http://<RightFax_Server_Name>/RightFax/API/SendJobs
  5. Under Authorization, set Type to Basic Auth (or NTLM).

  6. Enter valid credentials.

  7. Under Body, select raw and set format to JSON.

  8. Paste the following JSON:

    { "AttachmentUrls": ["URL for attachment"], "Recipients": [ { "Name": "Test", "Destination": "1234" } ] }
    • To send without attachment, use:

      "AttachmentUrls": []
  9. Click Send.

Result: A 201 Created response with job submission details.


Troubleshooting Postman Errors

  • 401 Unauthorized – Invalid credentials. Try NTLM if needed.

  • 400 Bad Request – Check JSON formatting and Attachment URL.

  • 404 Not Found – Verify server name and endpoint path.

  • 500 Internal Server Error – Check RightFax services and logs.


Using PowerShell to Test RightFax Web API

PowerShell v3.0 or later can also be used.

Example Script:

param( [string]$Server = "RightFaxServerName", [string]$UserID = "RightFaxUser", [string]$Password, [string]$Recipient = "1234", [string]$AttachmentUrl = "" ) $pair = "$UserID:$Password" $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair) $base64 = [System.Convert]::ToBase64String($bytes) $headers = @{ Authorization = "Basic $base64" } $body = @{ AttachmentUrls = if ($AttachmentUrl) { @($AttachmentUrl) } else { @() } Recipients = @(@{ Name = "Test"; Destination = $Recipient }) } | ConvertTo-Json -Depth 3 Invoke-RestMethod -Uri "http://$Server/RightFax/API/SendJobs" -Method Post -Headers $headers -Body $body -ContentType "application/json"

Result: 201 Created with job submission details.


Legacy Information

  • Original Legacy Article ID: KB4715737