Add group
curl --request POST \
--url https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"Name of the group": "Group Name",
"parentId": "parentGroupId"
}
'import requests
url = "https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group"
payload = {
"Name of the group": "Group Name",
"parentId": "parentGroupId"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({'Name of the group': 'Group Name', parentId: 'parentGroupId'})
};
fetch('https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group', 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://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Name of the group' => 'Group Name',
'parentId' => 'parentGroupId'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group"
payload := strings.NewReader("{\n \"Name of the group\": \"Group Name\",\n \"parentId\": \"parentGroupId\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"Name of the group\": \"Group Name\",\n \"parentId\": \"parentGroupId\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"Name of the group\": \"Group Name\",\n \"parentId\": \"parentGroupId\"\n}"
response = http.request(request)
puts response.read_body{
"id": "groupID",
"name": "group-name",
"parentId": "rootGroupId",
"path": "rootGroupId.groupID",
"vehicleIds": [
"[\"vehicleID1\",\"vehicleID2\"]"
],
"personIds": [
"[\"personID1\",\"personID2\"]"
]
}[
{
"errorCode": 123,
"errorMessage": "<string>",
"offendingFields": [
"<string>"
]
}
]/group
Add group
POST request to add a new group. The identifier for the newly added group is included in the JSON object returned as the response. The request will fail when the group name contains illegal characters.
POST
/
public
/
v1
/
customer
/
{customerId}
/
group
Add group
curl --request POST \
--url https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"Name of the group": "Group Name",
"parentId": "parentGroupId"
}
'import requests
url = "https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group"
payload = {
"Name of the group": "Group Name",
"parentId": "parentGroupId"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({'Name of the group': 'Group Name', parentId: 'parentGroupId'})
};
fetch('https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group', 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://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Name of the group' => 'Group Name',
'parentId' => 'parentGroupId'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group"
payload := strings.NewReader("{\n \"Name of the group\": \"Group Name\",\n \"parentId\": \"parentGroupId\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"Name of the group\": \"Group Name\",\n \"parentId\": \"parentGroupId\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.connectedfleet.michelin.com/fleet-management/public/v1/customer/{customerId}/group")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"Name of the group\": \"Group Name\",\n \"parentId\": \"parentGroupId\"\n}"
response = http.request(request)
puts response.read_body{
"id": "groupID",
"name": "group-name",
"parentId": "rootGroupId",
"path": "rootGroupId.groupID",
"vehicleIds": [
"[\"vehicleID1\",\"vehicleID2\"]"
],
"personIds": [
"[\"personID1\",\"personID2\"]"
]
}[
{
"errorCode": 123,
"errorMessage": "<string>",
"offendingFields": [
"<string>"
]
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json;charset=UTF-8
Response
Newly created group
ID of group
Required string length:
1 - 24Pattern:
^[a-z0-9]+$Example:
"groupID"
Group name
Maximum string length:
255Example:
"group-name"
ID of parent group, in case for changing the hierarchy
Example:
"rootGroupId"
Hierarchy path from root group
Example:
"rootGroupId.groupID"
List of Vehicle IDs to assign for concrete group
List of Person IDs to assign for concrete group
Was this page helpful?
⌘I
