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.
Before You Start
Section titled “Before You Start”You need:
- a site in Panel with an imported product feed (see Connect Your Product Feed)
- an active default Text Search campaign, which the free trial creates for you (see Campaigns)
- your site’s read-only token (see Authentication)
- curl in a terminal
-
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" -
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}'queryis the only required field.resultsCountasks for up to 5 products. The request names nocampaign, so it runs on your default Text Search campaign.The API answers with status
200and a JSON body. -
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.productsholds the ranked products, with the columns you need to show them:title,brand,price,image, and thedeeplinkto the product page.interactions.dynamicFilterslists the filters your campaign offers for these results. Each has acolumn, alabelto show, andvalues, wherevalueis what you send back andlabelis what shoppers see.
If
interactions.dynamicFiltersis empty, your campaign has no filters set up yet. Campaigns explains how to add them. -
Send the search again with a filter. Take a
columnand one of itsvalueentries from the previous response and pass them indynamicFilters: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
valueexactly as the response returned it. Category columns such asproduct_typereturn encoded category paths, and the API expects them back in the same form.
Check That It Works
Section titled “Check That It Works”Your requests work when:
- the first request returns status
200with products indata.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.
Next Steps
Section titled “Next Steps”Continue with:
- Text-Search Products: every request field, including
staticFiltersandcampaign - 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