Skip to content
Panel(opens in a new tab)

Quickstart: Make Your First Request

In this quickstart, you search your catalog through the Platform API with curl, read the products and filters it returns, and send the search again with a filter. It takes about 10 minutes.

You need:

  1. Save your read-only token in a shell variable, so the commands below can use it:

    Terminal window
    export VVIINN_TOKEN="YOUR_READ_ONLY_TOKEN"
  2. Send a text search for a word that matches products in your catalog:

    Terminal window
    curl https://api.vviinn.com/text-search \
    -H "Authorization: Bearer $VVIINN_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"query": "shoes", "resultsCount": 5}'

    query is the only required field. resultsCount asks for up to 5 products. The request names no campaign, so it runs on your default Text Search campaign.

    The API answers with status 200 and a JSON body.

  3. Read the response. Shortened, it looks like this:

    {
    "requestId": "6edf9d4d-60e8-49f3-b120-e89d728b8a89",
    "data": {
    "products": [
    {
    "entityType": "product",
    "productId": "SKU-001",
    "groupId": null,
    "title": "Running Shoe",
    "brand": "Acme",
    "productType": "Shoes",
    "deeplink": "https://www.example.com/products/sku-001",
    "image": {
    "original": "https://www.example.com/images/sku-001.jpg",
    "thumbnail": null
    },
    "price": { "actual": 79.9, "sale": null }
    }
    ]
    },
    "interactions": {
    "dynamicFilters": [
    {
    "type": "categorical",
    "column": "brand",
    "label": "Brand",
    "isPrimary": true,
    "values": [
    { "value": "Acme", "label": "Acme", "active": true, "selected": false }
    ]
    }
    ]
    }
    }

    Two parts matter here:

    • data.products holds the ranked products, with the columns you need to show them: title, brand, price, image, and the deeplink to the product page.
    • interactions.dynamicFilters lists the filters your campaign offers for these results. Each has a column, a label to show, and values, where value is what you send back and label is what shoppers see.

    If interactions.dynamicFilters is empty, your campaign has no filters set up yet. Campaigns explains how to add them.

  4. Send the search again with a filter. Take a column and one of its value entries from the previous response and pass them in dynamicFilters:

    Terminal window
    curl https://api.vviinn.com/text-search \
    -H "Authorization: Bearer $VVIINN_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
    "query": "shoes",
    "resultsCount": 5,
    "dynamicFilters": [
    { "column": "brand", "values": ["Acme"] }
    ]
    }'

    Copy each value exactly as the response returned it. Category columns such as product_type return encoded category paths, and the API expects them back in the same form.

Your requests work when:

  • the first request returns status 200 with products in data.products
  • the filtered request returns only products that match the value you picked, so every product in this example has "brand": "Acme"

A 401 response with {"message": "Authentication Error"} means the token is missing or wrong. An empty data.products usually means the feed isn’t imported yet. Troubleshooting: Platform API covers the first and Troubleshooting: Panel the second.

Continue with:

  • Text-Search Products: every request field, including staticFilters and campaign
  • Platform API: the response format, errors, and the other operations
  • Text Search: what the feature does and the campaign settings that shape its results
  • Authentication: the site credentials that product management needs