<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007Xrc5UCAROkta Classic EngineAPI Access ManagementAnswered2022-04-05T08:31:34.000Z2022-03-30T07:00:33.000Z2022-03-31T16:05:47.000Z

JuliusP.94760 (Customer) asked a question.

Getting error E0000003 The request body was not well-formed when calling create user API

Hi Everyone,

 

I'm getting the error {"errorCode":"E0000003","errorSummary":"The request body was not well-formed.","errorLink":"E0000003","errorId":"oaeUy1Uj153QJOkSC5TqsEdyw","errorCauses":[]} when I'm trying to call the create new user API in my .net application. I'm using RestSharp to make the request.

 

I tried to use the same headers and payload in Postman, and it's working perfectly.

 

Below is the snippet of the code.

 

using RestSharp;

 

var client = new RestClient("https://<DEV URL>/api/v1/users?activate=false");

 

var request = new RestRequest{ Method = Method.Post};

request.AddHeader("Accept", "application/json");

request.AddHeader("Content-Type", "application/json");

request.AddHeader("Authorization", "SSWS <TOKEN>");

 

var body = "{\"profile\":{\"login\":\"user1@myco.com\",\"email\":\"user1@myco.com\",\"firstName\":\"User1\",\"lastName\":\"Test\"}}";

request.AddParameter("application/json", body, ParameterType.RequestBody);

var response = client.ExecuteAsync(request);

 

Any help will be greatly appreciated.


This question is closed.
Loading
Getting error E0000003 The request body was not well-formed when calling create user API
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply