Update partially user
curl --request PATCH \
--url https://apiweb.mile.app/api/v3/user \
--header 'Content-Type: application/json' \
--data '
{
"name": "your update name"
}
'import requests
url = "https://apiweb.mile.app/api/v3/user"
payload = { "name": "your update name" }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'your update name'})
};
fetch('https://apiweb.mile.app/api/v3/user', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/user",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'your update name'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/user"
payload := strings.NewReader("{\n \"name\": \"your update name\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://apiweb.mile.app/api/v3/user")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"your update name\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"your update name\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Data has been updated successfully.",
"property": {
"_id": "65c1f4eeca7c4816d94587b7",
"name": "Example",
"email": "example@mile.app",
"provider": "web",
"hubId": [],
"organizationId": "65c1f4eeca7c4816d94587b2",
"status": "active",
"lastLogin": "2024-06-18T03:54:47+00:00",
"roleId": "65c1f4eeca7c4816d94587b3",
"activationCode": "5dc25a36e280ba34ef6dfe1f54dcb5d6",
"onboardingStep": [],
"teamId": [],
"updatedTime": "2024-06-18T04:42:04+00:00",
"createdTime": "2024-02-06T08:59:26+00:00",
"phoneNumber": null,
"dynamicVisitTime": []
}
}{
"status": false,
"message": "Deleted data failed",
"userId": 400
}User
Update partially user
This endpoint allows you to update the details of a specific user in the system. and the data to be updated is provided in the request body
PATCH
/
user
Update partially user
curl --request PATCH \
--url https://apiweb.mile.app/api/v3/user \
--header 'Content-Type: application/json' \
--data '
{
"name": "your update name"
}
'import requests
url = "https://apiweb.mile.app/api/v3/user"
payload = { "name": "your update name" }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'your update name'})
};
fetch('https://apiweb.mile.app/api/v3/user', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/user",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'your update name'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/user"
payload := strings.NewReader("{\n \"name\": \"your update name\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://apiweb.mile.app/api/v3/user")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"your update name\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"your update name\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Data has been updated successfully.",
"property": {
"_id": "65c1f4eeca7c4816d94587b7",
"name": "Example",
"email": "example@mile.app",
"provider": "web",
"hubId": [],
"organizationId": "65c1f4eeca7c4816d94587b2",
"status": "active",
"lastLogin": "2024-06-18T03:54:47+00:00",
"roleId": "65c1f4eeca7c4816d94587b3",
"activationCode": "5dc25a36e280ba34ef6dfe1f54dcb5d6",
"onboardingStep": [],
"teamId": [],
"updatedTime": "2024-06-18T04:42:04+00:00",
"createdTime": "2024-02-06T08:59:26+00:00",
"phoneNumber": null,
"dynamicVisitTime": []
}
}{
"status": false,
"message": "Deleted data failed",
"userId": 400
}⌘I