curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/menu_items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"menu_item": {
"name": "T-Shirts",
"code": "MEN-TS",
"subtitle": "Shop men'\''s T-Shirts",
"destination": "https://getvendo.com",
"menu_id": 1,
"new_window": true,
"item_type": "Link",
"linked_resource_type": "URL",
"linked_resource_id": 1
}
}'
{
"data": {
"id": "44",
"type": "menu_item",
"attributes": {
"name": "Menu Item One",
"subtitle": null,
"destination": null,
"new_window": false,
"item_type": "Link",
"linked_resource_type": "Spree::Linkable::Uri",
"code": null,
"lft": 8,
"rgt": 9,
"depth": 1,
"created_at": "2022-11-08T19:34:25.609Z",
"updated_at": "2022-11-08T19:34:25.857Z",
"link": null,
"is_container": false,
"is_root": false,
"is_child": true,
"is_leaf": true
},
"relationships": {
"icon": {
"data": {
"id": "47",
"type": "icon"
}
},
"menu": {
"data": {
"id": "8",
"type": "menu"
}
},
"parent": {
"data": {
"id": "40",
"type": "menu_item"
}
},
"linked_resource": {
"data": null
},
"children": {
"data": []
}
}
}
}
Updates a Menu Item
curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/menu_items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"menu_item": {
"name": "T-Shirts",
"code": "MEN-TS",
"subtitle": "Shop men'\''s T-Shirts",
"destination": "https://getvendo.com",
"menu_id": 1,
"new_window": true,
"item_type": "Link",
"linked_resource_type": "URL",
"linked_resource_id": 1
}
}'
{
"data": {
"id": "44",
"type": "menu_item",
"attributes": {
"name": "Menu Item One",
"subtitle": null,
"destination": null,
"new_window": false,
"item_type": "Link",
"linked_resource_type": "Spree::Linkable::Uri",
"code": null,
"lft": 8,
"rgt": 9,
"depth": 1,
"created_at": "2022-11-08T19:34:25.609Z",
"updated_at": "2022-11-08T19:34:25.857Z",
"link": null,
"is_container": false,
"is_root": false,
"is_child": true,
"is_leaf": true
},
"relationships": {
"icon": {
"data": {
"id": "47",
"type": "icon"
}
},
"menu": {
"data": {
"id": "8",
"type": "menu"
}
},
"parent": {
"data": {
"id": "40",
"type": "menu_item"
}
},
"linked_resource": {
"data": null
},
"children": {
"data": []
}
}
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Select which associated resources you would like to fetch, see: <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
Record updated
The response is of type object
.
Was this page helpful?