Code Samples #
Copy
curl --request POST \
--url '/api/v3/user/createWithList' \
--header 'Content-Type: application/json' \
--data '[
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
]'
const response = await fetch('/api/v3/user/createWithList', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
])
});
const data = await response.json();
console.log(data);
import requests
headers = {
"Content-Type": "application/json"
}
payload = [
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
]
response = requests.post("/api/v3/user/createWithList", headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => '/api/v3/user/createWithList',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => '[
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
]',
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
using System.Net.Http;
using System.Text;
var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "/api/v3/user/createWithList");
request.Content = new StringContent(@"[
{
""id"": 10,
""username"": ""theUser"",
""firstName"": ""John"",
""lastName"": ""James"",
""email"": ""john@email.com"",
""password"": ""12345"",
""phone"": ""12345"",
""userStatus"": 1
}
]", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("/api/v3/user/createWithList"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
[
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
]
"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Creates list of users with given input array.
Request Body #
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
[].id | integer (int64) | Optional | |
[].username | string | Optional | |
[].firstName | string | Optional | |
[].lastName | string | Optional | |
[].email | string | Optional | |
[].password | string | Optional | |
[].phone | string | Optional | |
[].userStatus | integer (int32) | Optional | User Status |
Example request
Copy
[
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
]
Responses #
200 — Successful operation #
| Field | Type | Required | Description |
|---|---|---|---|
id | integer (int64) | Optional | |
username | string | Optional | |
firstName | string | Optional | |
lastName | string | Optional | |
email | string | Optional | |
password | string | Optional | |
phone | string | Optional | |
userStatus | integer (int32) | Optional | User Status |
Example 200 response
Copy
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
default — Unexpected error #
Response #
200
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}