{"id":20989266,"url":"https://github.com/assemblyai-community/csharp-webhooks-demo","last_synced_at":"2025-12-29T23:14:00.689Z","repository":{"id":253146921,"uuid":"822733542","full_name":"AssemblyAI-Community/csharp-webhooks-demo","owner":"AssemblyAI-Community","description":"How to use AssemblyAI's Async API in C# with Webhooks.","archived":false,"fork":false,"pushed_at":"2024-08-16T16:50:13.000Z","size":1229,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-20T07:46:14.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AssemblyAI-Community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-01T17:54:32.000Z","updated_at":"2024-08-16T16:50:15.000Z","dependencies_parsed_at":"2024-11-19T06:40:31.560Z","dependency_job_id":null,"html_url":"https://github.com/AssemblyAI-Community/csharp-webhooks-demo","commit_stats":null,"previous_names":["assemblyai-community/csharp-webhooks-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI-Community%2Fcsharp-webhooks-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI-Community%2Fcsharp-webhooks-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI-Community%2Fcsharp-webhooks-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI-Community%2Fcsharp-webhooks-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AssemblyAI-Community","download_url":"https://codeload.github.com/AssemblyAI-Community/csharp-webhooks-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243401487,"owners_count":20285052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T06:24:18.804Z","updated_at":"2025-12-29T23:14:00.649Z","avatar_url":"https://github.com/AssemblyAI-Community.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AssemblyAI Webhooks C# Demo\n\n## Setting up the Project\n\nThis project requires the [ngrok](https://formulae.brew.sh/cask/ngrok) library to be installed for creating a publicly-accessible webhook URL that forwards to your local machine. You'll also need to ensure you have the [dotnet](https://formulae.brew.sh/cask/dotnet) library installed, or another version of the .NET 8 CLI available to build and run this project.\n\n## Running ngrok\n\nTo start, you'll need to create a publicly-accessible Webhook URL that our API can reach. Normally this would be your own Webhook server, but for the purposes of this demo, we're using Ngrok to set up forwarding to our `localhost` domain. Once you've installed `ngrok`, simply run `ngrok http 8000` to start up an ngrok server that points to your machine on port 8000. \n\nYou can verify that this is the case by looking at the \"Forwarding\" section of the output in your terminal window. You should see `http://localhost:8000` on the right side of the arrow, while the URL on the left of the arrow is the URL you're going to need for later. Copy that now and have it ready to use.\n\n## Important Variables\n\nFirst, you need to configure the AssemblyAI API key for both projects. \nBoth projects are configured to look for the `AssemblyAI:ApiKey` key in the environment variables and user-secrets.\n\nTo set the API key in the user-secrets, run the commands below in the terminal, replacing `\u003cYOUR_API_KEY\u003e` with your AssemblyAI API key, which can be located on your [account dashboard](https://www.assemblyai.com/app/account).\n```bash\ndotnet user-secrets --project TranscriptionSubmitter set AssemblyAI:ApiKey \"\u003cYOUR_API_KEY\u003e\"\ndotnet user-secrets --project WebhookReceiver set AssemblyAI:ApiKey \"\u003cYOUR_API_KEY\u003e\"\n```\n\nNext you'll want to replace the 2 variables `fileName` and `webhookUrl` under `TranscriptionSubmitter/Program.cs` with your audio file name/path and Ngrok URL from earlier, respectively. Make sure to retain the `/api/webhook` ending to your Ngrok URL, as otherwise you'll encounter a 404 error when Webhook responses are received.\n\nFor instance, your ngrok URL should be something like `https://09e2-2600-6c52-427f-a41f-1923-ce-c982-3f01.ngrok-free.app/api/webhook`. Now you're ready to run these two programs!\n\n## Running the Webhook Server\n\nIn another terminal window (ensure that your ngrok program from before is still running), navigate into the `TranscriptionSubmitter` folder. Then run `dotnet run`. Now you'll see in the terminal output that your Webhook server is listening on port 8000, which is where your Webhook calls will be forwarded to.\n\n## Running the TranscriptionSubmitter\n\nIn a third terminal window, navigate into the `WebhookReceiver` folder. Then run `dotnet run`. This will submit the file you specified under `fileName` to our API using your Ngrok URL as your Webhook URL. You'll get back a transcript ID to confirm that your file was successfully uploaded and provided to our API.\n\n## Accepting the Webhook Response\n\nAfter the file finishes processing, your Webhook server will be called with a payload containing the status of the transcript. If it's `completed`, we'll make a GET request to fetch the full transcript text and write it to a file named `transcripts/[id].txt`. If it's `error`, we'll log an error message to the terminal letting you know that the transcript failed.\n\nCongrats! You've now transcribed a file with the AssemblyAI API using Webhooks in C#.\n\n## Further Help\n\nIf anything happens to go wrong, or you have any questions on this project, please feel free to reach out to support@assemblyai.com. Happy coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemblyai-community%2Fcsharp-webhooks-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassemblyai-community%2Fcsharp-webhooks-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemblyai-community%2Fcsharp-webhooks-demo/lists"}