Content Collections via API

    How to manage Content Collections via API?

    Last updated on November 27th, 2023

    This article gives an overview on how to manage Content Collections via API.

    If you want to understand what Content Collection is, please read this article first. If you are just starting to work with our API it is advised to read our API documentation first and focus on our locations Endpoints first.

    Content Collections via API

    In order to start managing Content Collections and Content Items via API it is advised to create either manually in our platform. This way you actually will have objects to call and edit via API. Find out more about that here.

    In case you are familiar with our API you can also create your collections and items directly via API.

    Create a Content Collection

    In order to create a Content Collection you will need to perform a POST call on https://uberall.com/api/collections.

    Here you can find the object definition of a collection used as the body for the POST call.

    You will need to specify the following attributes:

    • identifier
    • name
    • type
    • contentLists (aka Sections - at least one)

    Example:

    curl --location --request POST 'https://uberall.com/api/collections/' \
    --header 'privateKey: *** THIS IS YOUR PRIVATE KEY ***' \
    --header 'Content-Type: text/plain' \
    --data-raw '{
                    "identifier": "this_is_a_collection",
                    "name": "Food Menu",
                    "description": This is a collection of our Food Menu,
                    "type": "MENU",
                    "cuisineType": ITALIAN,
                    "locationIds": [
                        3422458,
                        3422468
                    ],
                    "contentLists": [
                        {
                            "title": "Breakfast",
                            "type": "MENU",
                            "description": "This is our Breakfast Menu",
                            "items": []
                        },
                        {
                            "title": "Lunch",
                            "type": "MENU",
                            "description": "This is our Lunch Menu",
                            "items": []
                        }
                    ]
                }'


    The API response for successfully created Content Collection:

    "status": "SUCCESS"
    Delete

    Edit a Content Collection

    To edit a specific Content Collection you'd need to identify its id first. There are two ways to do so:

    1) GET all Content Collections
    https://uberall.com/en/developers/apiDocumentation#_api_collections-GET

    curl --location --request GET 'https://uberall.com/api/collections/' \
    --header 'privateKey: *** THIS IS YOUR PRIVATE KEY ***' \

    All Content Collections available to your API key will be listed and can be digested further to identify the desired collection

    2) GET a specific Location
    https://uberall.com/en/developers/apiDocumentation#_api_locations__id-GET

    curl --location --request GET 'https://uberall.com/api/locations/$id' \
    --header 'privateKey: *** THIS IS YOUR PRIVATE KEY ***' \

    In the response body the Collections the location is assigned to are listed.

    Once the specific Collection (ID) is identified you can update the collection as described here via 

    PATCH https://uberall.com/api/collections/$id

    Example:

    curl --location --request PATCH 'https://uberall.com/api/collections/$id' \
    --header 'privateKey: *** THIS IS YOUR PRIVATE KEY ***' \
    --header 'Content-Type: text/plain' \
    --data-raw '{
                    "identifier": "this_is_a_collection",
                    "name": "Food Menu",
                    "description": This is a collection of our Food Menu,
                    "type": "MENU",
                    "cuisineType": ITALIAN,
                    "locationIds": [
                        3422458,
                        3422468
                    ],
                    "contentLists": [
                        {
                            "title": "Breakfast",
                            "type": "MENU",
                            "description": "This is our Breakfast Menu",
                            "items": []
                        },
                        {
                            "title": "Lunch",
                            "type": "MENU",
                            "description": "This is our Lunch Menu",
                            "items": []
                        }
                    ]
                }'


    The API response for successfully updated Content Collection:

    "status": "SUCCESS"
    Delete

    Delete a Content Collection

    In order to delete a Content Collection you will need to perform a 

    DELETE https://uberall.com/api/collections/$id

    The API response for successfully deleted Content Collection:

    {
        "status": "SUCCESS",
        "message": "Collection has been successfully deleted.",
        "response": {}
    }
    Delete

    Content Items via API

    To fill your Collections with actual content you need to add Content Items to them. You can add a multitude of Content Items of the same time to one collection.

    There are different types of items available:

    • Custom Items - https://uberall.com/api/custom-items
    • Menu Items - https://uberall.com/api/menu-items
    • Persons - https://uberall.com/api/persons
    • Products - https://uberall.com/api/products
    • Service Items - https://uberall.com/api/service-items

    Each type serves a different purpose of content display and therefore also supports different data. Please familiarize yourself with the differences here.

    The logic of managing Content Items and assigning them to a Collection is independent from their type and therefore always the same.

    Create a Content Item

    In order to create a Content Item you will need to perform a POST call on the respective content item type specific endpoint:

    • Custom Items - https://uberall.com/api/custom-items
    • Menu Items - https://uberall.com/api/menu-items
    • Persons - https://uberall.com/api/persons
    • Products - https://uberall.com/api/products
    • Service Items - https://uberall.com/api/service-items

    Following you can find the object definition of the items used in the body for the POST call:

    You will always need to specify the following body attributes:

    • identifier
    • title

    Example:

    curl --location --request POST 'https://uberall.com/api/menu-items' \
    --header 'privateKey: *** THIS IS YOUR PRIVATE KEY ***' \
    --header 'Content-Type: text/plain' \
    --data-raw '{
        "identifier": "MenuItem01",
        "title": "This is a Menu Item",
        "description": "This is our MenuItem01",
        "image": {
            "url": "https://content-images-prod.uberall.com/menu/5518593/medium_Xscmgv2OOE.jpeg",
            "type": "IMAGE"
            },
        "price": 10,
        "currency": "EUR",
        "listName": "Breakfast"
    }'


    The API response for successfully created Content Item (Menu):

    {
        "status": "SUCCESS",
        "message": "MenuItem has been successfully created.",
        "response": {
            "menuItem": {
                "id": 5858166,
                "identifier": "MenuItem01",
                "title": "This is a Menu Item",
                "description": "This is our MenuItem01",
                "category": null,
                "image": {
                    "id": 31631639,
                    "url": "https://content-images-prod.uberall.com/menu/5518593/medium_Xscmgv2OOE.jpeg",
                    "type": "IMAGE",
                    "description": null,
                    "uid": "3331",
                    "publicUrl": "https://content-images-prod.uberall.com/menu/5518593/medium_Xscmgv2OOE.jpeg",
                    "thumbnailUrl": null
                },
                "url": null,
                "price": 0.1,
                "priceMax": null,
                "currency": "EUR",
                "listName": "Breakfast",
                "caloriesLow": null,
                "caloriesHigh": null,
                "allergens": null,
                "dietaryRestrictions": null
            }
        }
    }
    Delete

    Edit a Content Item

    To edit a specific Content Item you'd need to identify its id first. There is two ways to do so:

    1) GET all Content Items of the respective type

    Example:

    curl --location --request GET 'https://uberall.com/api/collections/' \
    --header 'privateKey: *** THIS IS YOUR PRIVATE KEY ***' \

    All Content Items available to your API key will be listed and can be digested further to identify the desired item

    2) GET all Collections

    https://uberall.com/en/developers/apiDocumentation#_api_collections-GET

    curl --location --request GET 'https://uberall.com/api/collections/' \
    --header 'privateKey: *** THIS IS YOUR PRIVATE KEY ***' \

    All Content Collections available to your API key will be listed. They will contain the assigned items inside the contentList (Section).

    Example:

    [
                {
                    "id": 4047,
                    "identifier": "hotel_services",
                    "name": "Hotel Services",
                    "description": null,
                    "type": "SERVICES",
                    "cuisineType": null,
                    "locationIds": [
                        3422458,
                        3422459,
                        3422460,
                        3422461,
                        3422462,
                        3422463,
                        3422464,
                        3422465,
                        3422466,
                        3422467,
                        3422468
                    ],
                    "contentLists": [
                        {
                            "id": 7179684,
                            "title": "Services",
                            "type": "SERVICES",
                            "description": "This is a collection of our services",
                            "items": []
                        },
                        {
                            "id": 7589619,
                            "title": "New Section created via API",
                            "type": "SERVICES",
                            "description": "This is a collection created via API",
                            "items": []
                        }
                    ]
                },
                {
                    "id": 4048,
                    "identifier": "pharmacy_products",
                    "name": "Pharmacy",
                    "description": null,
                    "type": "PRODUCTS",
                    "cuisineType": null,
                    "locationIds": [
                        3424714,
                        3424716,
                        3424717,
                        3424718,
                        3424719,
                        3424720,
                        3424721,
                        3424722,
                        3424723,
                        3424724,
                        3424732
                    ],
                    "contentLists": [
                        {
                            "id": 7183428,
                            "title": "Our products",
                            "type": "PRODUCTS",
                            "description": null,
                            "items": [
                                {
                                    "id": 5009330,
                                    "identifier": "drug_3",
                                    "title": "Covid-19 Self-tests",
                                    "description": "This is a product.",
                                    "category": null,
                                    "video": null,
                                    "url": null,
                                    "price": null,
                                    "priceMax": null,
                                    "currency": null,
                                    "unit": null,
                                    "listName": "Our products",
                                    "image": {
                                        "id": 25594092,
                                        "url": null,
                                        "type": "IMAGE",
                                        "description": null,
                                        "uid": "3331",
                                        "publicUrl": "https://content-images-prod.uberall.com/products/5009330/medium_5NEW8JpEiV.jpg",
                                        "thumbnailUrl": "https://content-images-prod.uberall.com/products/5009330/thumb_5NEW8JpEiV.jpg"
                                    }
                                }
                            ]
                        }
                    ]
                }


    Once the specific Content Item (ID) is identified you can update the item as described in the api documentation:

    Example:

    {
        "identifier": "Pancakes",
        "title": "This is a Menu Item",
        "description": "This is our MenuItem01",
        "image": {
            "url": "https://content-images-prod.uberall.com/menu/5518593/medium_Xscmgv2OOE.jpeg",
            "type": "IMAGE"
            },
        "price": 10,
        "currency": "EUR",
        "listName": "Breakfast"
    }


    The API response for successfully updated Content Item (e.g. Menu):

    {
        "status": "SUCCESS",
        "message": "MenuItem has been successfully updated.",
        "response": {
            "menuItem": {
                "id": 5518593,
                "identifier": "Pancakes",
                "title": "This is a Menu Item",
                "description": "This is our MenuItem01",
                "category": null,
                "image": {
                    "id": 31632404,
                    "url": "https://content-images-prod.uberall.com/menu/5518593/medium_Xscmgv2OOE.jpeg",
                    "type": "IMAGE",
                    "description": null,
                    "uid": "3331",
                    "publicUrl": "https://content-images-prod.uberall.com/menu/5518593/medium_Xscmgv2OOE.jpeg",
                    "thumbnailUrl": null
                },
                "url": null,
                "price": 0.1,
                "priceMax": null,
                "currency": "EUR",
                "listName": "Breakfast",
                "caloriesLow": null,
                "caloriesHigh": null,
                "allergens": [],
                "dietaryRestrictions": []
            }
        }
    }
    Delete

    Delete a Content Item

    In order to delete a specific Content Item you will need to perform a DELETE call to the respective endpoint:

    • Custom Items - https://uberall.com/api/custom-items/$id
    • Menu Items - https://uberall.com/api/menu-items/$id
    • Persons - https://uberall.com/api/persons/$id
    • Products - https://uberall.com/api/products/$id
    • Service Items - https://uberall.com/api/service-items/$id

    The API response for successfully deleted Content Collection:

    {
        "status": "SUCCESS",
        "message": "Product has been successfully deleted.",
        "response": {}
    }
    Delete


    Was this article helpful?

    Save as PDF