- language:javascript - language:python - language:csharp - language:php - language:ruby - sdk:compatibility - product:fax # Sending and Receiving Fax Its easy to start sending and receiving Fax using SignalWires APIs! You will need at least one number to send and receive faxes, so if you dont have one already, please follow the instructions below. ## Obtaining and configuring a number [Log in](https://signalwire.com/signin) to your SignalWire Space. From the Phone Numbers section, you can [buy a new phone number](guides/numbers-api/getting-started/buying-a-phone-number/index.mdx). ## Receiving your first fax There are two parts to receiving a fax: 1. A SignalWire Phone Number; 2. The instructions to actually receive the Fax. After you have acquired a number, or in case you have one already, open its settings by clicking on Edit Settings. Scroll down until you reach Voice and Fax Settings, as shown in the next figure, and configure it to: - ACCEPT INCOMING CALLS AS -> Fax - HANDLE FAXES USING -> LaML Webhooks ### Setting up the instructions to receive faxes #### Using CXML Applications CXML Applications (also called LaML Bins) allow you to tell SignalWire how to handle calls, messages, or faxes by using instructions called Verbs. You can learn more about CXML Applications on [this article](guides/numbers-api/guides/general/creating-and-using-cxml-applications/index.mdx), but essentially we need to create a new Bin in the LaML section of the Dashboard with the following instructions: xml Lastly, we need to connect the phone number with the instructions to receive the fax, so we copy the Bins URL from the CXML Applications section of the Dashboard and paste it in the phone numbers WHEN A FAX COMES IN field, like this: Thats it! You can now start receiving faxes on your phone number, and they will appear under LaML -> Faxes in your Dashboard: #### Using Compatibility SDKs If you wish to avoid using SignalWires CXML Applications, you can use our SDKs and host the instructions yourself. Please see our [ Verb instructions](/compatibility-api/cxml/fax/receive#receive-a-fax) for specific code examples. Youll then need to make your code accessible to SignalWire through a Webhook. We have a great [guide on how to do this using ngrok](guides/administration/guides/technical-troubleshooting/how-to-test-webhooks-with-ngrok/index.mdx)! ## Sending your first fax There are three parts to sending a fax: 1. A SignalWire Phone Number; 2. The destination number; 3. The publicly available media to be sent, such as a PDF file. ### Using our REST API Using our [Send a Fax endpoint](/rest/compatibility-api/endpoints/send-fax) you can make a POST request to https://.signalwire.com/api/laml/2010-04-01/Accounts//Faxes with the following body parameters: - From - To - MediaUrl ### Using Compatibility SDKs You can send faxes using [our SDKs Send a Fax function](https://docs.signalwire.com/reference/compatibility-sdks/v3/?javascript#api-reference-faxes-send-a-fax), in multiple languages: import Tabs from @theme/Tabs; import TabItem from @theme/TabItem; javascript const { RestClient } = require(@signalwire/compatibility-api) const client = RestClient(YourProjectID, YourAuthToken, { signalwireSpaceUrl: example.signalwire.com }) client.fax.faxes.create({ from: +13103383454, to: +13104456789, mediaUrl: https://example.com/fax.pdf }) .then(fax => console.log(fax.sid)) .done(); python from signalwire.rest import Client as signalwire_client client = signalwire_client(YourProjectID, YourAuthToken, signalwire_space_url = example.signalwire.com) fax = client.fax.faxes \ .create( from_=+13103383454, to=+13104456789, media_url=https://example.com/fax.pdf ) print(fax.sid) csharp using System; using System.Collections.Generic; using Twilio; using Twilio.Rest.Fax.V1; class Program { static void Main(string[] args) { TwilioClient.Init(YourProjectID, YourAuthToken, new Dictionary { [signalwireSpaceUrl] = .signalwire.com }); var fax = FaxResource.Create( from: +13103383454, to: +13104456789, mediaUrl: new Uri(https://example.com/fax.pdf) ); Console.WriteLine(fax.Sid); } } php example.signalwire.com)); $fax = $client->fax->v1->faxes ->create(+13104456789, // to https://example.com/fax.pdf, // mediaUrl array(from => +13103383454) ); print($fax->sid); ?> ruby require signalwire/sdk @client = Signalwire::REST::Client.new YourProjectID, YourAuthToken, signalwire_space_url: example.signalwire.com fax = @client.fax.faxes .create( from: +13103383454, to: +13104456789, media_url: https://example.com/fax.pdf ) puts fax.sid ## Next steps Congratulations! You can now send and receive faxes using SignalWire. You are now ready to explore the advanced guides in the Fax section from the left menu.