Code Samples #
Copy
curl --request PUT \
--url '/api/v3/user/{username}' \
--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/{username}', {
method: 'PUT',
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.put("/api/v3/user/{username}", headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => '/api/v3/user/{username}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
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("PUT"), "/api/v3/user/{username}");
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/{username}"))
.header("Content-Type", "application/json")
.method("PUT", 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());
This can only be done by the logged in user.
Path Parameters #
| Name | Type | Required | Description |
|---|---|---|---|
username | string | Required | name that need to be deleted |
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
}