Update organization
curl --request PUT \
--url https://apiweb.mile.app/api/v3/organization \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"companyName": "PT Contoh Logistik",
"language": "id",
"currency": "IDR"
}
'import requests
url = "https://apiweb.mile.app/api/v3/organization"
payload = {
"companyName": "PT Contoh Logistik",
"language": "id",
"currency": "IDR"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({companyName: 'PT Contoh Logistik', language: 'id', currency: 'IDR'})
};
fetch('https://apiweb.mile.app/api/v3/organization', 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/organization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'companyName' => 'PT Contoh Logistik',
'language' => 'id',
'currency' => 'IDR'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/organization"
payload := strings.NewReader("{\n \"companyName\": \"PT Contoh Logistik\",\n \"language\": \"id\",\n \"currency\": \"IDR\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://apiweb.mile.app/api/v3/organization")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"companyName\": \"PT Contoh Logistik\",\n \"language\": \"id\",\n \"currency\": \"IDR\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/organization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyName\": \"PT Contoh Logistik\",\n \"language\": \"id\",\n \"currency\": \"IDR\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"_id": "621dd813eb3ebf16b94d6969",
"name": "Rina Putri",
"email": "[email protected]",
"organizationId": "64d99303be0ad015c461c932",
"organization": {
"_id": "64d99303be0ad015c461c932",
"user": {
"companyName": "PT Contoh Logistik"
},
"language": "id",
"currency": "IDR",
"isDoTask": true
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Organization
Update organization
Updates the signed-in user’s current organization: its company name, default language, currency and the “do task” setting. Returns the signed-in user with the updated organization. Rules:
companyName: required.language: one ofen,id,jp,zh,vi,th,tl,ko.currency: 3-letter ISO 4217 code, stored in upper case.isDoTask: boolean. Requires permissionedit/organization.
PUT
/
organization
Update organization
curl --request PUT \
--url https://apiweb.mile.app/api/v3/organization \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"companyName": "PT Contoh Logistik",
"language": "id",
"currency": "IDR"
}
'import requests
url = "https://apiweb.mile.app/api/v3/organization"
payload = {
"companyName": "PT Contoh Logistik",
"language": "id",
"currency": "IDR"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({companyName: 'PT Contoh Logistik', language: 'id', currency: 'IDR'})
};
fetch('https://apiweb.mile.app/api/v3/organization', 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/organization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'companyName' => 'PT Contoh Logistik',
'language' => 'id',
'currency' => 'IDR'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/organization"
payload := strings.NewReader("{\n \"companyName\": \"PT Contoh Logistik\",\n \"language\": \"id\",\n \"currency\": \"IDR\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://apiweb.mile.app/api/v3/organization")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"companyName\": \"PT Contoh Logistik\",\n \"language\": \"id\",\n \"currency\": \"IDR\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/organization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyName\": \"PT Contoh Logistik\",\n \"language\": \"id\",\n \"currency\": \"IDR\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"_id": "621dd813eb3ebf16b94d6969",
"name": "Rina Putri",
"email": "[email protected]",
"organizationId": "64d99303be0ad015c461c932",
"organization": {
"_id": "64d99303be0ad015c461c932",
"user": {
"companyName": "PT Contoh Logistik"
},
"language": "id",
"currency": "IDR",
"isDoTask": true
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Authorizations
Use a valid Bearer token to authenticate.
Body
application/json
Company name.
Example: PT Contoh Logistik
Default language.
Example: id
Available options:
en, id, jp, zh, vi, th, tl, ko ISO 4217 currency code.
Example: IDR
Required string length:
3Whether the web app shows users the notice that tasks are best done in the mobile app.
Example: true