Navigation menus
Update a website navigation menu
Updates a storefront website navigation menu.
PATCH
/
api
/
menus
/
{id}
Update a website navigation menu
curl --request PATCH \
--url https://api.fluid.app/api/menus/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lang": "<string>",
"menu": {
"title": "<string>",
"active": true,
"country_ids": [
123
],
"menu_items_attributes": [
{
"linkable_type": "<string>",
"linkable_id": 123,
"title": "<string>",
"order": 123,
"parent_id": 123,
"id": 123,
"_destroy": true
}
]
}
}
'import requests
url = "https://api.fluid.app/api/menus/{id}"
payload = {
"lang": "<string>",
"menu": {
"title": "<string>",
"active": True,
"country_ids": [123],
"menu_items_attributes": [
{
"linkable_type": "<string>",
"linkable_id": 123,
"title": "<string>",
"order": 123,
"parent_id": 123,
"id": 123,
"_destroy": True
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lang: '<string>',
menu: {
title: '<string>',
active: true,
country_ids: [123],
menu_items_attributes: [
{
linkable_type: '<string>',
linkable_id: 123,
title: '<string>',
order: 123,
parent_id: 123,
id: 123,
_destroy: true
}
]
}
})
};
fetch('https://api.fluid.app/api/menus/{id}', 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.fluid.app/api/menus/{id}",
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([
'lang' => '<string>',
'menu' => [
'title' => '<string>',
'active' => true,
'country_ids' => [
123
],
'menu_items_attributes' => [
[
'linkable_type' => '<string>',
'linkable_id' => 123,
'title' => '<string>',
'order' => 123,
'parent_id' => 123,
'id' => 123,
'_destroy' => true
]
]
]
]),
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://api.fluid.app/api/menus/{id}"
payload := strings.NewReader("{\n \"lang\": \"<string>\",\n \"menu\": {\n \"title\": \"<string>\",\n \"active\": true,\n \"country_ids\": [\n 123\n ],\n \"menu_items_attributes\": [\n {\n \"linkable_type\": \"<string>\",\n \"linkable_id\": 123,\n \"title\": \"<string>\",\n \"order\": 123,\n \"parent_id\": 123,\n \"id\": 123,\n \"_destroy\": true\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.fluid.app/api/menus/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lang\": \"<string>\",\n \"menu\": {\n \"title\": \"<string>\",\n \"active\": true,\n \"country_ids\": [\n 123\n ],\n \"menu_items_attributes\": [\n {\n \"linkable_type\": \"<string>\",\n \"linkable_id\": 123,\n \"title\": \"<string>\",\n \"order\": 123,\n \"parent_id\": 123,\n \"id\": 123,\n \"_destroy\": true\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/menus/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lang\": \"<string>\",\n \"menu\": {\n \"title\": \"<string>\",\n \"active\": true,\n \"country_ids\": [\n 123\n ],\n \"menu_items_attributes\": [\n {\n \"linkable_type\": \"<string>\",\n \"linkable_id\": 123,\n \"title\": \"<string>\",\n \"order\": 123,\n \"parent_id\": 123,\n \"id\": 123,\n \"_destroy\": true\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"menu": {
"id": 123,
"company_id": 123,
"title": "<string>",
"active": true,
"slug": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"country_ids": [
123
],
"menu_items": [
{
"id": 123,
"title": "<string>",
"linkable_id": 123,
"linkable_type": "<string>",
"url": "<string>",
"order": 123,
"parent_id": 123,
"linkable": {
"id": 123,
"type": "<string>",
"title": "<string>",
"image_url": "<string>"
},
"sub_menu_items": [
{
"id": 123,
"title": "<string>",
"url": "<string>",
"linkable_id": 123,
"linkable_type": "<string>",
"order": 123,
"parent_id": 123,
"sub_menu_items": [
{
"id": 123,
"title": "<string>",
"linkable_id": 123,
"linkable_type": "<string>",
"order": 123,
"parent_id": 123
}
],
"linkable": {
"id": 123,
"type": "<string>",
"title": "<string>",
"image_url": "<string>"
}
}
]
}
]
},
"meta": {
"request_id": "<string>",
"timestamp": "<string>"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer token authentication
Path Parameters
Menu ID
Body
application/json
⌘I
Update a website navigation menu
curl --request PATCH \
--url https://api.fluid.app/api/menus/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lang": "<string>",
"menu": {
"title": "<string>",
"active": true,
"country_ids": [
123
],
"menu_items_attributes": [
{
"linkable_type": "<string>",
"linkable_id": 123,
"title": "<string>",
"order": 123,
"parent_id": 123,
"id": 123,
"_destroy": true
}
]
}
}
'import requests
url = "https://api.fluid.app/api/menus/{id}"
payload = {
"lang": "<string>",
"menu": {
"title": "<string>",
"active": True,
"country_ids": [123],
"menu_items_attributes": [
{
"linkable_type": "<string>",
"linkable_id": 123,
"title": "<string>",
"order": 123,
"parent_id": 123,
"id": 123,
"_destroy": True
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lang: '<string>',
menu: {
title: '<string>',
active: true,
country_ids: [123],
menu_items_attributes: [
{
linkable_type: '<string>',
linkable_id: 123,
title: '<string>',
order: 123,
parent_id: 123,
id: 123,
_destroy: true
}
]
}
})
};
fetch('https://api.fluid.app/api/menus/{id}', 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.fluid.app/api/menus/{id}",
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([
'lang' => '<string>',
'menu' => [
'title' => '<string>',
'active' => true,
'country_ids' => [
123
],
'menu_items_attributes' => [
[
'linkable_type' => '<string>',
'linkable_id' => 123,
'title' => '<string>',
'order' => 123,
'parent_id' => 123,
'id' => 123,
'_destroy' => true
]
]
]
]),
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://api.fluid.app/api/menus/{id}"
payload := strings.NewReader("{\n \"lang\": \"<string>\",\n \"menu\": {\n \"title\": \"<string>\",\n \"active\": true,\n \"country_ids\": [\n 123\n ],\n \"menu_items_attributes\": [\n {\n \"linkable_type\": \"<string>\",\n \"linkable_id\": 123,\n \"title\": \"<string>\",\n \"order\": 123,\n \"parent_id\": 123,\n \"id\": 123,\n \"_destroy\": true\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.fluid.app/api/menus/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lang\": \"<string>\",\n \"menu\": {\n \"title\": \"<string>\",\n \"active\": true,\n \"country_ids\": [\n 123\n ],\n \"menu_items_attributes\": [\n {\n \"linkable_type\": \"<string>\",\n \"linkable_id\": 123,\n \"title\": \"<string>\",\n \"order\": 123,\n \"parent_id\": 123,\n \"id\": 123,\n \"_destroy\": true\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/menus/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lang\": \"<string>\",\n \"menu\": {\n \"title\": \"<string>\",\n \"active\": true,\n \"country_ids\": [\n 123\n ],\n \"menu_items_attributes\": [\n {\n \"linkable_type\": \"<string>\",\n \"linkable_id\": 123,\n \"title\": \"<string>\",\n \"order\": 123,\n \"parent_id\": 123,\n \"id\": 123,\n \"_destroy\": true\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"menu": {
"id": 123,
"company_id": 123,
"title": "<string>",
"active": true,
"slug": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"country_ids": [
123
],
"menu_items": [
{
"id": 123,
"title": "<string>",
"linkable_id": 123,
"linkable_type": "<string>",
"url": "<string>",
"order": 123,
"parent_id": 123,
"linkable": {
"id": 123,
"type": "<string>",
"title": "<string>",
"image_url": "<string>"
},
"sub_menu_items": [
{
"id": 123,
"title": "<string>",
"url": "<string>",
"linkable_id": 123,
"linkable_type": "<string>",
"order": 123,
"parent_id": 123,
"sub_menu_items": [
{
"id": 123,
"title": "<string>",
"linkable_id": 123,
"linkable_type": "<string>",
"order": 123,
"parent_id": 123
}
],
"linkable": {
"id": 123,
"type": "<string>",
"title": "<string>",
"image_url": "<string>"
}
}
]
}
]
},
"meta": {
"request_id": "<string>",
"timestamp": "<string>"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}