© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2mo ago•
8 replies
DignifiedSwine

"No query parameters in this request" in a parameterless query

edge functionsPostgREST
Ok I don't know if I am being gaslit by my server or not at this point...

I am trying to use a Stored Procedure:
DECLARE
    new_uuid uuid;
    new_name text;
BEGIN
    -- Generate a unique username with prefix 'Survivalist' and a random suffix
    new_name := LEFT('Survivalist' || to_char(floor(random() * 1000), 'FM000'), 20); -- Adjust length as needed

    -- Insert into user_Details, get the UUID
    INSERT INTO public."user_Details"(email)
    VALUES ('')
    RETURNING "userID" INTO new_uuid;

    -- Insert into user_Accounts
    INSERT INTO public."user_Accounts"("userID", "AccountID", "name", "server")
    VALUES (new_uuid, 1, new_name, 1);

    -- Return the new UUID
    RETURN new_uuid;
END;
DECLARE
    new_uuid uuid;
    new_name text;
BEGIN
    -- Generate a unique username with prefix 'Survivalist' and a random suffix
    new_name := LEFT('Survivalist' || to_char(floor(random() * 1000), 'FM000'), 20); -- Adjust length as needed

    -- Insert into user_Details, get the UUID
    INSERT INTO public."user_Details"(email)
    VALUES ('')
    RETURNING "userID" INTO new_uuid;

    -- Insert into user_Accounts
    INSERT INTO public."user_Accounts"("userID", "AccountID", "name", "server")
    VALUES (new_uuid, 1, new_name, 1);

    -- Return the new UUID
    RETURN new_uuid;
END;


The code I am using to trigger this procedure is C# (Unity):
  string url = $"{apiUrl}/rest/v1/rpc/create_newuser";

  // Create JSON body
  string jsonBody = "{}";

  // Create UnityWebRequest
  UnityWebRequest request = new UnityWebRequest(url, "POST");
  byte[] bodyRaw = System.Text.Encoding.UTF8.GetBytes(jsonBody);
  request.uploadHandler = new UploadHandlerRaw(bodyRaw);
  request.downloadHandler = new DownloadHandlerBuffer();
  request.SetRequestHeader("apikey", apiKey);
  request.SetRequestHeader("Authorization", $"Bearer {apiKey}");
  request.SetRequestHeader("Content-Type", "application/json");

  Debug.Log("Request payload: " + jsonBody);

  // Send request and wait for response
  await request.SendWebRequestAsync();
  string url = $"{apiUrl}/rest/v1/rpc/create_newuser";

  // Create JSON body
  string jsonBody = "{}";

  // Create UnityWebRequest
  UnityWebRequest request = new UnityWebRequest(url, "POST");
  byte[] bodyRaw = System.Text.Encoding.UTF8.GetBytes(jsonBody);
  request.uploadHandler = new UploadHandlerRaw(bodyRaw);
  request.downloadHandler = new DownloadHandlerBuffer();
  request.SetRequestHeader("apikey", apiKey);
  request.SetRequestHeader("Authorization", $"Bearer {apiKey}");
  request.SetRequestHeader("Content-Type", "application/json");

  Debug.Log("Request payload: " + jsonBody);

  // Send request and wait for response
  await request.SendWebRequestAsync();


However, this just keeps telling me 'no' and I have no idea why.
Can anyone help before I throw my PC out the window?

For confirmation, I have enabled anon for both tables, to insert and update data. I have tested the procedure on the server and it works fine. The issue seems to be something to do with the byte[].
I am using Unity, so this is in C#.

Once I have this sorted out, I do plan to have the server ID added. so the jsonBody is required.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

No API key found in request.
SupabaseSSupabase / help-and-questions
2mo ago
401 'No API key found in request'
SupabaseSSupabase / help-and-questions
2mo ago
Twitter provider - No API key found in request
SupabaseSSupabase / help-and-questions
4y ago
Can this query be written in Supabase?
SupabaseSSupabase / help-and-questions
4y ago