Skip to main content

{StatusCode: 500, ReasonPhrase: 'Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  X-XSS-Protection: 1; mode=block
  Request-Context: appId=cid-v1:e996501c-e721-4ac1-97ff-dc6887b85e8c
  Date: Wed, 24 Sep 2025 18:39:51 GMT
  Content-Length: 0
}}

 

what is the fixed

Unless you say what you want to achieve, no one will know or understand the error and assist you. Are you trying to create an api user?

       1. Generate UUID from this site https://fusionauth.io/dev-tools/uuid-generator 

  1. Apply that reference id also known as the app reference and apply to the headers.
  2. Fetch the subscription id from your account and apply to the headers.

here is my code below that is giving me the error message

 

using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args) // <-- async Task instead of void
    {
        var url = "https://sandbox.momodeveloper.mtn.com/v1_0/apiuser"; 
        var requestBody = "{ \"example\": \"value\" }"; 

        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("X-Reference-Id", "d7791f6c-e620-47b5-b813-21836c42221a");
            client.DefaultRequestHeaders.Add("Cache-Control", "no-cache");
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "xxxxxxxxxxxxxxx");

            var content = new StringContent(requestBody, Encoding.UTF8, "application/json");

            var response = await client.PostAsync(url, content);
            string result = await response.Content.ReadAsStringAsync();

            Console.WriteLine($"Status Code: {response.StatusCode}");
            Console.WriteLine("Response:");
            Console.WriteLine(result);
        }
    }
}
 

what is wrong with this code? Help


Request body should contain the call back URL like so
```

{
    "providerCallbackHost": “http://devhost.webhook-testing.tr3nn3.com”
}

```
instead of where you put an object into a string so in effect your request body is a string instead of an object
```
"{ \"example\": \"value\" }"
```