Read permissions
curl --request GET \
--url https://apiweb.mile.app/api/v3/permissions \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v3/permissions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v3/permissions', 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/permissions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/permissions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v3/permissions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"data": [
{
"_id": "6156d6475320c9679e337eba",
"name": "view/task",
"displayName": "View Task",
"menu": "Task",
"module": "mileTask",
"type": "string",
"organizationId": "system",
"orderIndex": 1,
"isDeleted": false,
"updatedTime": "2021-10-01T08:00:00.000000Z",
"createdTime": "2021-10-01T08:00:00.000000Z"
},
{
"_id": "615ac4ab5c3c0b3d3e83dfc1",
"name": "add/task",
"displayName": "Create Task",
"menu": "Task",
"module": "mileTask",
"type": "string",
"organizationId": "system",
"orderIndex": 2,
"isDeleted": false,
"updatedTime": "2021-10-04T09:00:00.000000Z",
"createdTime": "2021-10-04T09:00:00.000000Z"
}
],
"dataVersion": "1760593200"
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Permission
Read permissions
Lists every permission key that can be given to a role in your organization: the standard ones plus the ones created for your own custom modules. Use the _id values in a role’s permissionList.
Labels follow the signed-in user’s language (or the organization’s).
Any signed-in user can call it.
GET
/
permissions
Read permissions
curl --request GET \
--url https://apiweb.mile.app/api/v3/permissions \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v3/permissions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v3/permissions', 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/permissions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/permissions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v3/permissions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"data": [
{
"_id": "6156d6475320c9679e337eba",
"name": "view/task",
"displayName": "View Task",
"menu": "Task",
"module": "mileTask",
"type": "string",
"organizationId": "system",
"orderIndex": 1,
"isDeleted": false,
"updatedTime": "2021-10-01T08:00:00.000000Z",
"createdTime": "2021-10-01T08:00:00.000000Z"
},
{
"_id": "615ac4ab5c3c0b3d3e83dfc1",
"name": "add/task",
"displayName": "Create Task",
"menu": "Task",
"module": "mileTask",
"type": "string",
"organizationId": "system",
"orderIndex": 2,
"isDeleted": false,
"updatedTime": "2021-10-04T09:00:00.000000Z",
"createdTime": "2021-10-04T09:00:00.000000Z"
}
],
"dataVersion": "1760593200"
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Authorizations
Use a valid Bearer token to authenticate.
Query Parameters
Field to sort by, one of the permission fields.
Default: orderIndex
Sort direction.
Default: ASC
Available options:
ASC, DESC